Removed ApplyWatershed class from augmentations.py and added a new file called watershed.py under src/models. In the watershed.py class added a function called getAverages. This function finds the average intensity of non-black pixels. We ignore the black pixels as those are typically the background and we want it so that it doesn't skew our average intensity distribution. This is used to find the threshold in the get_mask function. With the threshold, we convert the image to a black-and-white image. Then with the black-and-white image, we find the foreground, background, and unknown region. We use this information to construct the mask per standard watershed technique.
closes #8 #5
How to use
[ ] Get images using the bps_dataset make sure it returns a numpy array and not a tensor, NORMALIZE TRANSFORMATION IS REQUIRED
[ ] Numpy array should also be uint8, the bps_dataset class should already handle that, but in case of running it without our bps_dataset class
[ ] Returns a 32bit single channel image of the mask (the mask is the outline of the focci)
How has this been tested
[x] This has mainly been tested in our test-05 branch and we just moved the changes over.
Checklist
[x] My code conforms with the style guidelines of this project
Description
Removed ApplyWatershed class from augmentations.py and added a new file called watershed.py under src/models. In the watershed.py class added a function called getAverages. This function finds the average intensity of non-black pixels. We ignore the black pixels as those are typically the background and we want it so that it doesn't skew our average intensity distribution. This is used to find the threshold in the get_mask function. With the threshold, we convert the image to a black-and-white image. Then with the black-and-white image, we find the foreground, background, and unknown region. We use this information to construct the mask per standard watershed technique.
closes #8 #5
How to use
How has this been tested
Checklist