Skip to content

Update SP_SpecimenID.py#4

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

Update SP_SpecimenID.py#4
totochin1222 wants to merge 1 commit into
VirtualPregnancy:masterfrom
totochin1222:patch-1

Conversation

@totochin1222
Copy link
Copy Markdown

1.	Input & Directory Handling •	Replaced dataHome and size parameters with a single dataRoot input for clarity. •	Now automatically traverses all specimen directories under derivative/boyd-collection/histology/. •	Reference image imgref is optional; if not provided, no color normalization is applied.
2.	Output Structure •	Updated output directories to new structure: •	Masks → mask/ •	Masked samples → mask-sample/ •	QA plots → qa-plot/
3.	Image Naming •	Masked sample files now follow the format {specimen}-s{id} to maintain consistent naming across specimens.
4.	Processing Logic •	Retains all previous steps: •	Specimen-specific cropping •	Background removal and smoothing •	Adaptive binarization •	Single feature identification via flood-fill •	Mask application and color normalization (if imgref provided) •	Supports both serial (cpuNo=1) and parallel processing with multiple cores.
5.	Removed / Deprecated Elements •	Old specID/size logic largely replaced; section selection is now central. •	High-resolution TIF path handling commented out (can be extended later if needed). •	Optional plotting preserved with updated QA plot paths.
6.	General Enhancements •	More robust handling of missing reference images. •	Improved consistency and readability of directory and file handling. •	Code is ready to scale to multiple specimens without manual path changes.

	1.	Input & Directory Handling
	•	Replaced dataHome and size parameters with a single dataRoot input for clarity.
	•	Now automatically traverses all specimen directories under derivative/boyd-collection/histology/.
	•	Reference image imgref is optional; if not provided, no color normalization is applied.
	2.	Output Structure
	•	Updated output directories to new structure:
	•	Masks → mask/
	•	Masked samples → mask-sample/
	•	QA plots → qa-plot/
	3.	Image Naming
	•	Masked sample files now follow the format {specimen}-s{id} to maintain consistent naming across specimens.
	4.	Processing Logic
	•	Retains all previous steps:
	•	Specimen-specific cropping
	•	Background removal and smoothing
	•	Adaptive binarization
	•	Single feature identification via flood-fill
	•	Mask application and color normalization (if imgref provided)
	•	Supports both serial (cpuNo=1) and parallel processing with multiple cores.
	5.	Removed / Deprecated Elements
	•	Old specID/size logic largely replaced; section selection is now central.
	•	High-resolution TIF path handling commented out (can be extended later if needed).
	•	Optional plotting preserved with updated QA plot paths.
	6.	General Enhancements
	•	More robust handling of missing reference images.
	•	Improved consistency and readability of directory and file handling.
	•	Code is ready to scale to multiple specimens without manual path changes.
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