henrypinkard / Pygellan

[DEPREACATED] Python interface for data-driven microscopy with Micro-manager/Micro-Magellan
BSD 3-Clause "New" or "Revised" License
14 stars 3 forks source link

ChNames in metadata not accessible #23

Closed kdmarchuk closed 4 years ago

kdmarchuk commented 4 years ago

Demo dataset acquired with MM2.0gamma nightly 10/14/2019 includes 4 channel, 3 timepoints, 11 z, on a 2x2 grid.

Cannot access magellan.summary_metadata['ChNames'] without crashing. KeyError: 'ChNames' Code worked for dataset acquired with MM 1.4 Magellan.

your code in magellan_data.py

if 'ChNames' in self.summary_metadata:
                    #Legacy magellan files--load channel names here
                    self._channel_names = {i: ch for i, ch in enumerate(self.summary_metadata['ChNames'])}
                else:
                    self._channel_names = {} #read them from image metadata

how should we access channel names in the new version?

Thanks! Kyle

henrypinkard commented 4 years ago

Channel names aren't specified when acquisition started, so that you can arbitrarily add/remove at runtime. Just below that line, they are read from image metadata:

https://github.com/henrypinkard/Pygellan/blob/7f40462818040c76ce018eb73c59e76e86101c22/pygellan/magellan_data.py#L308

Call this function to get a list of them:

https://github.com/henrypinkard/Pygellan/blob/7f40462818040c76ce018eb73c59e76e86101c22/pygellan/magellan_data.py#L528

kdmarchuk commented 4 years ago

Thanks!