Refactor for dataset reproducibility step 2: Dataset Cropping Support infrastructure. #14
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.
TL;DR
Adds bounding-box schema + image cropping utilities (with unit tests) as part of the ongoing
virtual_stain_flow.datasetsrefactor.PR Description
This PR is part 2a of the
virtual_stain_flow.datasetsrefactor, which focuses on creating reproducible, logging-friendly datasets. The feature addition part is being split into smaller, stacked PRs to keep the review scope manageable.This PR introduces support for cropping square/rectangular regions from raw microscopy images, along with supporting infrastructure.
Changes in this PR
src/virtual_stain_flow/datasets/bbox_schema.pyself.bbox_accessor.coords(i) ;self.bbox_accessor.rot_centers(i);self.bbox_accessor.angle_of(i)to retrieve the parameters defining the ith crop.src/virtual_stain_flow/datasets/image_utils.pycrop_and_rotate_image(image, ...)where...are the bbox parameters retrieved fromself.bbox_accessorand get the image properly cropped and rotated.Unit tests
Next Steps