Update SP_AlignSamples.py#8
Open
totochin1222 wants to merge 1 commit into
Open
Conversation
totochin1222
commented
Sep 25, 2025
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.
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.