Browse Source

made some attributes public

zolfa-add_slices_loading
jim 10 years ago
parent
commit
19b5ae5221
2 changed files with 8 additions and 8 deletions
  1. +3
    -3
      nd2reader/__init__.py
  2. +5
    -5
      nd2reader/service/__init__.py

+ 3
- 3
nd2reader/__init__.py View File

@ -24,7 +24,7 @@ class Nd2(BaseNd2):
""" """
for i in range(self._image_count): for i in range(self._image_count):
for fov in range(self.field_of_view_count): for fov in range(self.field_of_view_count):
for z_level in range(self._z_level_count):
for z_level in range(self.z_level_count):
for channel in self.channels: for channel in self.channels:
image = self.get_image(i, fov, channel.name, z_level) image = self.get_image(i, fov, channel.name, z_level)
if image.is_valid: if image.is_valid:
@ -34,9 +34,9 @@ class Nd2(BaseNd2):
""" """
Gets all the images for a given field of view and Gets all the images for a given field of view and
""" """
timepoint_set = xrange(self._timepoint_count) if timepoints is None else timepoints
timepoint_set = xrange(self.timepoint_count) if timepoints is None else timepoints
channel_set = [channel.name for channel in self.channels] if channels is None else channels channel_set = [channel.name for channel in self.channels] if channels is None else channels
z_level_set = xrange(self._z_level_count) if z_levels is None else z_levels
z_level_set = xrange(self.z_level_count) if z_levels is None else z_levels
for timepoint in timepoint_set: for timepoint in timepoint_set:
image_set = ImageSet() image_set = ImageSet()


+ 5
- 5
nd2reader/service/__init__.py View File

@ -53,11 +53,11 @@ class BaseNd2(object):
return self._metadata['ImageEvents']['RLxExperimentRecord']['uiCount'] return self._metadata['ImageEvents']['RLxExperimentRecord']['uiCount']
@property @property
def _timepoint_count(self):
return self._image_count / self.field_of_view_count / self._z_level_count
def timepoint_count(self):
return self._image_count / self.field_of_view_count / self.z_level_count
@property @property
def _z_level_count(self):
def z_level_count(self):
return self._image_count / self._sequence_count return self._image_count / self._sequence_count
@property @property
@ -72,7 +72,7 @@ class BaseNd2(object):
return sum(self._metadata['ImageMetadata']['SLxExperiment']['ppNextLevelEx']['']['pItemValid']) return sum(self._metadata['ImageMetadata']['SLxExperiment']['ppNextLevelEx']['']['pItemValid'])
@property @property
def _channel_count(self):
def channel_count(self):
return self._reader.channel_count return self._reader.channel_count
@property @property
@ -88,7 +88,7 @@ class BaseNd2(object):
return self._reader.metadata return self._reader.metadata
def _calculate_image_set_number(self, timepoint, fov, z_level): def _calculate_image_set_number(self, timepoint, fov, z_level):
return timepoint * self.field_of_view_count * self._z_level_count + (fov * self._z_level_count + z_level)
return timepoint * self.field_of_view_count * self.z_level_count + (fov * self.z_level_count + z_level)
class Nd2Reader(object): class Nd2Reader(object):


Loading…
Cancel
Save