Skip to content

Conversation

camisowers
Copy link
Contributor

@camisowers camisowers commented Jun 19, 2023

If you haven't already, please read through our contributing guidelines before opening your PR

What is the purpose of this PR?

Closes #1009. Changes shape of the segmentation masks from 3d to 2d. (1, 1024, 1024) --> (1024, 1024)
This now allows the images to be stitched in Image_Stitching.ipynb without issue.

How did you implement your changes

Squeeze the ranked_segmentation_mask before saving it to a tiff.

Remaining issues

  • Run segmentation notebook and check output mask shape
  • Run pixel clustering notebook to check for any issues
  • Run stitching notebook

@camisowers camisowers added the enhancement New feature or request label Jun 19, 2023
@camisowers camisowers self-assigned this Jun 19, 2023
@camisowers camisowers requested a review from srivarra June 20, 2023 17:36
Copy link
Contributor

@srivarra srivarra left a comment

Choose a reason for hiding this comment

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

💀 ❌ 7️⃣

@camisowers camisowers marked this pull request as ready for review June 20, 2023 17:46
@camisowers camisowers requested a review from ngreenwald June 20, 2023 17:46
Copy link
Member

@ngreenwald ngreenwald left a comment

Choose a reason for hiding this comment

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

I'm guessing the majority of the downstream pipeline doesn't actually run this function, and instead creates fake segmentation masks. Therefore, if there's an issue, the tests are unlikely to pick it up. Did you check all the functions that load segmentation masks?

@camisowers
Copy link
Contributor Author

camisowers commented Jun 20, 2023

I'm guessing the majority of the downstream pipeline doesn't actually run this function, and instead creates fake segmentation masks. Therefore, if there's an issue, the tests are unlikely to pick it up. Did you check all the functions that load segmentation masks?

tldr: I looked at a bunch of test functions and seems like usually the pseudo masks we create are 2d anyways, but regardless the load function returns the same array for the 2d vs 3d segmentation masks so we should be good

Yes, the tests for functions that require segmentation masks just create an array and save it to a tiff, then the function calls a loading function from alpineer. Whether those test images created are 2d or 3d, the load_images_from_dir() always handles them accordingly by only retrieving the row and column data. I checked and the load output is the same between the 2d and 3d masks, so nothing should have changed throughout the pipeline.

@ngreenwald ngreenwald merged commit 229b9aa into main Jun 20, 2023
@ngreenwald ngreenwald deleted the 2d_segmentation_masks branch June 20, 2023 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with segmentation mask stitching
3 participants