Browse Source

added channel name convenience method

zolfa-add_slices_loading
jim 10 years ago
parent
commit
f4c379f685
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      nd2reader/service/__init__.py

+ 11
- 0
nd2reader/service/__init__.py View File

@ -55,6 +55,17 @@ class BaseNd2(object):
camera = metadata['sSampleSetting'][label]['pCameraSetting']['CameraUserName'] camera = metadata['sSampleSetting'][label]['pCameraSetting']['CameraUserName']
yield Channel(name, camera, exposure_time) yield Channel(name, camera, exposure_time)
@property
def channel_names(self):
"""
A convenience method for getting an alphabetized list of channel names.
:return: list[str]
"""
for channel in sorted(self.channels, key=lambda x: x.name):
yield channel.name
@property @property
def _image_count(self): def _image_count(self):
return self._metadata['ImageAttributes']['SLxImageAttributes']['uiSequenceCount'] return self._metadata['ImageAttributes']['SLxImageAttributes']['uiSequenceCount']


Loading…
Cancel
Save