diff --git a/nd2reader/__init__.py b/nd2reader/__init__.py index 27b0b6e..d53beeb 100644 --- a/nd2reader/__init__.py +++ b/nd2reader/__init__.py @@ -24,7 +24,7 @@ class Nd2(BaseNd2): """ for i in range(self._image_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: image = self.get_image(i, fov, channel.name, z_level) if image.is_valid: @@ -34,9 +34,9 @@ class Nd2(BaseNd2): """ 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 - 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: image_set = ImageSet() diff --git a/nd2reader/service/__init__.py b/nd2reader/service/__init__.py index 5393db9..b07fbc3 100644 --- a/nd2reader/service/__init__.py +++ b/nd2reader/service/__init__.py @@ -53,11 +53,11 @@ class BaseNd2(object): return self._metadata['ImageEvents']['RLxExperimentRecord']['uiCount'] @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 - def _z_level_count(self): + def z_level_count(self): return self._image_count / self._sequence_count @property @@ -72,7 +72,7 @@ class BaseNd2(object): return sum(self._metadata['ImageMetadata']['SLxExperiment']['ppNextLevelEx']['']['pItemValid']) @property - def _channel_count(self): + def channel_count(self): return self._reader.channel_count @property @@ -88,7 +88,7 @@ class BaseNd2(object): return self._reader.metadata 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):