-
Notifications
You must be signed in to change notification settings - Fork 28
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
Remove .tif/.tiff extension from list_files for MIBItiff reading in Segment_Image_Data.ipynb #281
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
We still may need to address other locations where we need to remove extensions. |
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.
As I mentioned in my comment on the issue, this will fail because FOVs needs to have the .tiff extension for loading mibi-tiff files.
You should change the mibi-tiff flag to be true while making these changes to make sure we fix it
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.
Rather than adding more stuff to the notebook, we could probably put this in the deepcell function itself. For example, this exact cleanup already happens if FOVs are set to None:
fovs = io_utils.extract_delimited_names(tifs, delimiter='.') |
Oh wow, totally forgot about that. Let's do that instead. |
I'm not a huge fan of the logic I'm using to handle the removal of the |
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.
It's a bit messy, but I think it gets the job done. I think 2 things would help:
- A few comments describing what's going on
- A test case for input names with/without extension to make sure it handles properly
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.
A few typos. We'll see if @vacuousplanet has any additional comments about how to handle the file suffixes
Co-authored-by: Noah Greenwald <[email protected]>
Co-authored-by: Noah Greenwald <[email protected]>
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.
So, the messiness of this code depends on how tolerant of user input we are. If we mandate fovs have their file extensions (or mandate they don't have them), then the code is much less messy. However, if we keep fovs file-extension agnostic, this 'clean-up' code it about as optimized as it can be imo.
I'm in favor of keeping file-extension agnosticism, in the hopes of a cleaner issues page 😉 .
Anyways, just one fix and I think we're gtg here
…verifying fovs in deepcell_input_dir
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.
👍
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.
Look good, two small tweaks
…egment_Image_Data.ipynb (#281) * Add method to split delimited files from MIBItiff reading * Need to add the actual file exts to this * Hacky fix for MIBItiff loading * See if removing setup.py install fixes the issue we've been having * Move logic from Segment_Image_Data to deepcell_service_utils * Better (?) way of handling .tif removing? * Add comments to create_deepcell_output and add mixed fov name/file list to tests * Fix typo: existant to existent Co-authored-by: Noah Greenwald <[email protected]> * Remove extra slash from comment Co-authored-by: Noah Greenwald <[email protected]> * Remove extra check for whether .tif file exists * Fix typo and make sure we're handling both .tif and .tiff files when verifying fovs in deepcell_input_dir * Fix comments * Don't remove .zip file after creation, and make sure to handle mixed case of .tif and .tiff files * Explicitly print out error message that zip file is being overwritten Co-authored-by: Noah Greenwald <[email protected]>
…egment_Image_Data.ipynb (#281) * Add method to split delimited files from MIBItiff reading * Need to add the actual file exts to this * Hacky fix for MIBItiff loading * See if removing setup.py install fixes the issue we've been having * Move logic from Segment_Image_Data to deepcell_service_utils * Better (?) way of handling .tif removing? * Add comments to create_deepcell_output and add mixed fov name/file list to tests * Fix typo: existant to existent Co-authored-by: Noah Greenwald <[email protected]> * Remove extra slash from comment Co-authored-by: Noah Greenwald <[email protected]> * Remove extra check for whether .tif file exists * Fix typo and make sure we're handling both .tif and .tiff files when verifying fovs in deepcell_input_dir * Fix comments * Don't remove .zip file after creation, and make sure to handle mixed case of .tif and .tiff files * Explicitly print out error message that zip file is being overwritten Co-authored-by: Noah Greenwald <[email protected]>
What is the purpose of this PR?
A mini-PR that addresses and closes #279. By extension, addresses and closes #278.
How did you implement your changes
We simply add a call to
extract_delimited_names
inio_utils
to fix this.