-
Notifications
You must be signed in to change notification settings - Fork 7
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
[Feature]: Import mean or summary images from all segmentation methods #228
Comments
Hi @RichieHakim, I'm actually pleasantly surprised so many of the example data formats do return something for that field - in practice whenever we've worked with data of these formats from individual labs they have only occasionally had those fields present, which is why ROIExtractors considers them optional fields (with a fallback of I can specifically comment on this aspect for the NWBSegmentationExtractor, which does not require such summary images to be present in the file However, as I look through the codebase, it seems that it should not raise an error but rather return a dictionary with So I'm curious why you had to wrap a try/except for the demonstration? Otherwise, I'd be interested in two not-necessarily-exclusive pathways towards improving this... a) Check if the Caiman issue is a bug (are there summary images in the example data that should be imported but currently aren't for some reason?) b) Add some helper functions somewhere (would need to discuss where would be best) for extracting/generating summary image information for a given Segmentation object given the Imaging object that it corresponds to What are you thoughts @RichieHakim? |
@CodyCBakerPhD: thank you for the prompt reply.
I didn't. I should have removed it. Sorry for the confusion. I think your suggested paths forward seem right.
The caiman .h5 dataset in the gin repo is missing the 'Cn' field. I think I have seen FOV image fields in a caiman dataset I've worked with before. It may be worth looking into running your data through the caiman pipeline again.
The exact functions necessary to point to and extract images from the dataset would like come from a walk through the structure of each data file. Let me know if that all makes sense and if you'd like to delegate anything to us. |
Absolutely not recent: these are just collections of examples we've found over the years. Sometimes the experimenter used a years old version of the software, and that was already years ago so I'm sure it adds up If you could help round up some more up-to-date examples (as well as help identify ways to distinguish past and present versions - usually in the form of a metadata field that records the version used within the source files) that would be fantastic
To clarify, these aren't our data and I don't think we were ever the ones that ran it through a given pipeline 😅 If you have more a recent example, especially one that has that optional field present, that would be great to add to the testing suite The process for adding data to GIN and getting it into the testing suites is somewhat documented, but might be more convenient to just share a google drive and we'd be happy to handle it
Yes, ideally the summary images would have been pre-calculated and saved/cached along with the segmented data - but in principle the information should be recoverable from the full images (I'm unsure how intensive of an operation this is?) So if your group would know how to implement the computation of summary images of each time, that could be a great contribution! Probably somewhere under the 'extraction_tools.py` for now (can discuss better organization structure in the future) |
I do not have example data from various pipelines, nor do I think I am in a position to round it up easily. If we were given appropriate files I think we would be able to implement and PR it quickly though.
I don't know if it is necessary to actually perform any processing on the data. Simply storing and cataloging the images (as is already done) should be sufficient. I think the main issue is simply that I don't think that all classes are importing everything. Specifically: CaImAn is not importing anything, and CNMFE is only importing a correlation image. I know this is incomplete for caiman and I'd guess that CNMFE probably has a mean or other simple summary image in addition to the correlation image. If these holes were filled, I think it would be sufficient to being using roiextractors as an ingestion method. |
As a bandaid, I added retrieving an image from the caiman dataset that is similar to a mean image: data['estimates']['b'].
|
What would you like to see added to ROI Extractors?
This is related to #224 (comment) but deserves its own post.
Some of the segmentation classes do not import a standard field of view image from the ingested data. This is a key piece of data for many workflows. In particular, caiman is missing everything, and cnmfe is missing a summary/mean image.
Code to check this:
Returns output:
Do you have any interest in helping implement the feature?
Yes, but I would need guidance.
Code of Conduct
The text was updated successfully, but these errors were encountered: