Skip to content
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

OpenCell reader extension #197

Merged
merged 4 commits into from
Oct 25, 2023
Merged

OpenCell reader extension #197

merged 4 commits into from
Oct 25, 2023

Conversation

ieivanov
Copy link
Contributor

The OpenCell acquisition starts with a large number of positions in the position list, but only some of those are actually imaged. When we save the data, we need to use a continuous position index starting at 0 because of a Micro-manager bug: micro-manager/micro-manager#1723, i.e. if we are imaging positions (5, 6, 13, 12) in the position list, they are saved with index (0, 1, 2, 3). In this case, we need to parse the correct position label from the tif filename.

I've implemented this as a special version of Micro-manager metadata. If we change the MM version on the Dragonfly microscope (unlikely) or the "raw_data" prefix (also very unlikely) this code will not work an will need to be modified. I've also switched the order of _gather_index_maps() and _set_mm_meta() to make this work. I didn't see unintended consequences here, but I think this may be making some of the tests fail. @ziw-liu can you help me take a look?

cc: @Soorya19Pradeep

@Soorya19Pradeep
Copy link

@ieivanov , thank you so much for implementing the reader. The iohub conversion works for both opencell data as well MM data now. I have tested it on data from DragonFly OpenCell imaging and MM HCS data.

@ziw-liu
Copy link
Collaborator

ziw-liu commented Oct 18, 2023

I've also switched the order of _gather_index_maps() and _set_mm_meta() to make this work. I didn't see unintended consequences here, but I think this may be making some of the tests fail. @ziw-liu can you help me take a look?

The _set_mm_meta() method sets self.frames based on MM summary metadata, which may be inaccurate for incomplete datasets, and _gather_index_maps() will overwrite the initial value based on the index map.

Also this line breaks single page TIFF conversion because it has an empty reader.stage_positions:

                name = self.reader.stage_positions[p].get("Label") or p

@ziw-liu ziw-liu added enhancement New feature or request μManager Micro-Manager files and metadata labels Oct 18, 2023
Comment on lines +215 to +222

# dimensions based on mm metadata
# do not reflect final written dimensions
# these set in _gather_index_maps
#
# self.frames = self.mm_meta["Summary"]["Frames"]
# self.slices = self.mm_meta["Summary"]["Slices"]
# self.channels = self.mm_meta["Summary"]["Channels"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this @ziw-liu. I commented out these lines so they don't overwrite the dimensions set by _gather_index_maps

Copy link
Collaborator

@ziw-liu ziw-liu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good! (I haven't tested the added functionality.)

It would be nice if this can be tested automatically somehow.

@ieivanov
Copy link
Contributor Author

Thanks @ziw-liu. I opened a new issue for adding a test dataset

@ieivanov ieivanov merged commit ca593de into main Oct 25, 2023
7 checks passed
@ziw-liu ziw-liu deleted the opencell_converter branch October 30, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request μManager Micro-Manager files and metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants