-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fix bugs in visualize segmentation #357
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
So this method works to fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Can you update the description with which of the issues this is the closing?
The thing I don't like about visualize_segmentation
is that there are two separate things people will want to do.
- Cycle through different example images in the notebook, seeing how the overlays look
- Save the segmentation output for all FOVs in their dataset.
Right now, they're combined together into the same function. This is partly what lead to the show=true errors. What do you think the best way to split these up would be?
@ngreenwald I think the best way to do this is to have This is great for making the functionality clearer, but in terms of the issues people have been bringing up, I don't think it's actually |
The Okay great, I agree. I think as a further simplification, we don't even need Once they're done with that, then we can have them call visualize_segmentation (which we'll call something else). That function will loop through, and save the output files for all of the fovs in the xarray |
@ngreenwald a few questions:
|
I think we should move all of the stuff that's in Then there will be one cell where the user calls plot_overlay directly, with a single FOV specified, to look at the output. And a separate cell which loops over all of the data and produces the borders. |
Even better, we should modifiy plot_overlay to be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a few last remaining skeletons to remove from the plot function that can be moved into the segmentation_labels function, so that all the plot function is responsible for is taking an image and creating an RGB overlay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, almost there
@ngreenwald OK, the new channel structure has been added, ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close, just need to update the colors of the input data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice stuff
raise ValueError("max 3 channels of overlay supported, got {}". | ||
format(plotting_tif.shape)) | ||
|
||
# set first n channels (in reverse order) of formatted_tif to plotting_tif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clever!
* Fix bug in Segment_Image_Data: change data_xr to data_xr_summed * Handle cases for both compartments and channels * Make visualize_segmentation easier to understand * Change compartments to channels and add comment allowing user to set fovs_to_display to None * Logic and testing added for new plot overlay workflow * Last commit before nuking previous implementation * Nuke previous implementation * Documentation fix * Address code review * Fix call in notebook * Fix documentation for extract_delimited_names * Address code review comments * Assign to RGB channels in BGR order * Add notebook visualization * Address (hopefully) final review comments
* Fix bug in Segment_Image_Data: change data_xr to data_xr_summed * Handle cases for both compartments and channels * Make visualize_segmentation easier to understand * Change compartments to channels and add comment allowing user to set fovs_to_display to None * Logic and testing added for new plot overlay workflow * Last commit before nuking previous implementation * Nuke previous implementation * Documentation fix * Address code review * Fix call in notebook * Fix documentation for extract_delimited_names * Address code review comments * Assign to RGB channels in BGR order * Add notebook visualization * Address (hopefully) final review comments
What is the purpose of this PR?
We've received a lot of bugs that have resulted from merging #193 in. This PR encompasses the following 3 issues:
How did you implement your changes
It seems that the bugs aren't completely related to
visualize_segmentation
but rather on what's being passed in.data_xr
instead ofdata_xr_summed
, for example, was incorrectly passed in, which likely caused @awedwards issue.chan_list
verification logic was a little buggy, so that was improved as well.