Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion nd2reader/raw_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def get_parsed_metadata(self):
"frames": self._parse_frames(),
"z_levels": self._parse_z_levels(),
"z_coordinates": parse_if_not_none(self.z_data, self._parse_z_coordinates),
"x_coordinates": parse_if_not_none(self.x_data, self._parse_x_coordinates),
"y_coordinates": parse_if_not_none(self.y_data, self._parse_y_coordinates),
"total_images_per_channel": frames_per_channel,
"channels": self._parse_channels(),
"pixel_microns": parse_if_not_none(self.image_calibration, self._parse_calibration)
Expand Down Expand Up @@ -195,6 +197,22 @@ def _parse_z_coordinates(self):
"""
return self.z_data.tolist()

def _parse_x_coordinates(self):
"""The coordinate in micron for all x.

Returns:
list: the x coordinates in micron
"""
return self.x_data.tolist()

def _parse_y_coordinates(self):
"""The coordinate in micron for all y.

Returns:
list: the y coordinates in micron
"""
return self.y_data.tolist()

def _parse_dimension_text(self):
"""While there are metadata values that represent a lot of what we want to capture, they seem to be unreliable.
Sometimes certain elements don't exist, or change their data type randomly. However, the human-readable text
Expand Down Expand Up @@ -662,4 +680,3 @@ def image_events(self):
if self._label_map.image_metadata:
for event in self._metadata_parsed["events"]:
yield event

2 changes: 1 addition & 1 deletion nd2reader/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def get_timesteps(self):
return self._timesteps

self._timesteps = (
np.array(list(self._parser._raw_metadata.acquisition_times), dtype=np.float)
np.array(list(self._parser._raw_metadata.acquisition_times), dtype='float')
* 1000.0
)

Expand Down