Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resize individual images within NPZ #113

Merged
merged 2 commits into from
Aug 11, 2020
Merged

Conversation

ngreenwald
Copy link
Collaborator

The current version of build.py accepts a single resize parameter for an entire NPZ of images. However, if the image data within an NPZ is heterogenous, there may be different resize values that are appropriate for each image within that NPZ file.

  • This PR adds the option to specify a separate resize value for each image in an NPZ in the combine_npz_files function.

  • It pulls out the core resizing and cropping functionality from combine_npz_files into a new helper function

  • It adds a compute_cell_size function which calculates the mean cell size within an image, which can be used to generate those resize values.

Copy link
Contributor

@willgraf willgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per our discussion, some small changes to clarify the tests and simplify/improve the compute_cell_sizes code.

@ngreenwald
Copy link
Collaborator Author

  • new implementation of compute_cell_sizes which collects list of lists, and then determines how to calculate average (this looks so much cleaner!!)

  • Comments on hardcoded values in testing functions to explain rationale

  • check that error is raised for invalid resize_ratios

@MekWarrior MekWarrior merged commit be970e5 into master Aug 11, 2020
@MekWarrior MekWarrior deleted the cell_size_normalization branch August 11, 2020 19:56
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.

None yet

3 participants