|
@ -156,12 +156,22 @@ class Nd2Reader(object): |
|
|
|
|
|
|
|
|
""" |
|
|
""" |
|
|
pattern = r""".*?T'\((\d+)\).*?""" |
|
|
pattern = r""".*?T'\((\d+)\).*?""" |
|
|
return int(re.match(pattern, self._dimensions).group(1)) |
|
|
|
|
|
|
|
|
try: |
|
|
|
|
|
count = int(re.match(pattern, self._dimensions).group(1)) |
|
|
|
|
|
except AttributeError: |
|
|
|
|
|
return 1 |
|
|
|
|
|
else: |
|
|
|
|
|
return count |
|
|
|
|
|
|
|
|
@property |
|
|
@property |
|
|
def z_level_count(self): |
|
|
def z_level_count(self): |
|
|
pattern = r""".*?Z\((\d+)\).*?""" |
|
|
pattern = r""".*?Z\((\d+)\).*?""" |
|
|
return int(re.match(pattern, self._dimensions).group(1)) |
|
|
|
|
|
|
|
|
try: |
|
|
|
|
|
count = int(re.match(pattern, self._dimensions).group(1)) |
|
|
|
|
|
except AttributeError: |
|
|
|
|
|
return 1 |
|
|
|
|
|
else: |
|
|
|
|
|
return count |
|
|
|
|
|
|
|
|
@property |
|
|
@property |
|
|
def field_of_view_count(self): |
|
|
def field_of_view_count(self): |
|
@ -173,12 +183,22 @@ class Nd2Reader(object): |
|
|
|
|
|
|
|
|
""" |
|
|
""" |
|
|
pattern = r""".*?XY\((\d+)\).*?""" |
|
|
pattern = r""".*?XY\((\d+)\).*?""" |
|
|
return int(re.match(pattern, self._dimensions).group(1)) |
|
|
|
|
|
|
|
|
try: |
|
|
|
|
|
count = int(re.match(pattern, self._dimensions).group(1)) |
|
|
|
|
|
except AttributeError: |
|
|
|
|
|
return 1 |
|
|
|
|
|
else: |
|
|
|
|
|
return count |
|
|
|
|
|
|
|
|
@property |
|
|
@property |
|
|
def channel_count(self): |
|
|
def channel_count(self): |
|
|
pattern = r""".*?λ\((\d+)\).*?""" |
|
|
pattern = r""".*?λ\((\d+)\).*?""" |
|
|
return int(re.match(pattern, self._dimensions).group(1)) |
|
|
|
|
|
|
|
|
try: |
|
|
|
|
|
count = int(re.match(pattern, self._dimensions).group(1)) |
|
|
|
|
|
except AttributeError: |
|
|
|
|
|
return 1 |
|
|
|
|
|
else: |
|
|
|
|
|
return count |
|
|
|
|
|
|
|
|
def get_raw_image_data(self, image_set_number, channel_offset): |
|
|
def get_raw_image_data(self, image_set_number, channel_offset): |
|
|
chunk = self._label_map["ImageDataSeq|%d!" % image_set_number] |
|
|
chunk = self._label_map["ImageDataSeq|%d!" % image_set_number] |
|
|