Update SP_SpecimenID.py#4
Open
totochin1222 wants to merge 1 commit into
Open
Conversation
totochin1222
commented
Sep 25, 2025
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.