Skip to content

Update SP_AlignSamples.py#8

Open
totochin1222 wants to merge 1 commit into
VirtualPregnancy:masterfrom
totochin1222:patch-5
Open

Update SP_AlignSamples.py#8
totochin1222 wants to merge 1 commit into
VirtualPregnancy:masterfrom
totochin1222:patch-5

Conversation

@totochin1222

Copy link
Copy Markdown
1.	Imports Updated •	Added import os for filesystem path handling. •	Added import tifffile as tifi to enable reading/writing .tif files in transformSamples.
2.	Function Signature Changes •	align() signature updated: removed size parameter and renamed data → dataRoot. •	align() now only takes dataRoot, cpuNo, and errorThreshold.
3.	Directory Handling Refactored •	Instead of relying on size to construct paths, align() now automatically traverses all specimens under: dataRoot/derivative/boyd-collection/histology/.
•	Corresponding sample, destination, and feature directories updated:
•	maskedSamples/ → mask-sample/
•	alignedSamples/ → aligned-sample/
•	info/ → raw-feature/
•	Added a check to warn if no specimen directories are found.
4.	Directory Creation Added •	dirMaker(destImgPath) called inside the loop to ensure the aligned images directory exists.
5.	General Cleanup / Modernization •	Hardcoded references to size removed. •	Paths now constructed with os.path.join for cross-platform compatibility. •	Processing now iterates over all specimen folders automatically rather than a single path.

	1.	Imports Updated
	•	Added import os for filesystem path handling.
	•	Added import tifffile as tifi to enable reading/writing .tif files in transformSamples.
	2.	Function Signature Changes
	•	align() signature updated: removed size parameter and renamed data → dataRoot.
	•	align() now only takes dataRoot, cpuNo, and errorThreshold.
	3.	Directory Handling Refactored
	•	Instead of relying on size to construct paths, align() now automatically traverses all specimens under:
dataRoot/derivative/boyd-collection/histology/.
	•	Corresponding sample, destination, and feature directories updated:
	•	maskedSamples/ → mask-sample/
	•	alignedSamples/ → aligned-sample/
	•	info/ → raw-feature/
	•	Added a check to warn if no specimen directories are found.
	4.	Directory Creation Added
	•	dirMaker(destImgPath) called inside the loop to ensure the aligned images directory exists.
	5.	General Cleanup / Modernization
	•	Hardcoded references to size removed.
	•	Paths now constructed with os.path.join for cross-platform compatibility.
	•	Processing now iterates over all specimen folders automatically rather than a single path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant