angelolab / Nimbus

Other
12 stars 1 forks source link

Added exclude_background_tiles and fixed normalization #31

Closed JLrumberger closed 1 year ago

JLrumberger commented 2 years ago

What is the purpose of this PR?

This PR changes the SegmentationTFRecords class:

  1. quantile normalization now only calculates quantiles on pixels whose intensity is > 0, so that sparse markers don't get super dim because of normalization
  2. we add an argument exlude_background_tiles to the class, if it's set to true, only tiles that contain foreground in the label mask (i.e. 1s or 2s) are stored in the tfrecord. All tiles that only contain background (0s) are not saved in the tfrecord.

How did you implement your changes

Changed a few lines in segmentation_data_prep.py

Remaining issues

None