Skip to content
Draft
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
3 changes: 2 additions & 1 deletion iohub/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ def __call__(self) -> None:
):
zarr_img = self.writer[zarr_pos_name]["0"]
to_zarr(fov.xdata.data.rechunk(self.chunks), zarr_img)
self._convert_image_plane_metadata(fov, zarr_img.path)
# Skip image plane metadata conversion, throws error
# self._convet_image_plane_metadata(fov, zarr_img.path)
self.writer.zgroup.attrs.update(self.metadata)
self.writer.close()
self.reader.close()
10 changes: 10 additions & 0 deletions iohub/mmstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ def _parse_data(self):
(axis, size)
for axis, size in zip(series.get_axes(), series.get_shape())
)
_rgb = False
if "S" in raw_dims and "C" not in raw_dims:
# Map samples "S" from RGB images to channels "C"
# in datasets that don't already have a channel dimension
_rgb = True
_channels = raw_dims.pop("S")
raw_dims["C"] = _channels
axes = ("R", "T", "C", "Z", "Y", "X")
dims = dict((ax, raw_dims.get(ax, 1)) for ax in axes)
_logger.debug(f"Got dataset dimensions from tifffile: {dims}.")
Expand All @@ -163,6 +170,9 @@ def _parse_data(self):
xarr = img.expand_dims(
[ax for ax in axes if ax not in img.dims]
).transpose(*axes)
# Rename RGB channels
if _rgb and self.channels == 3:
self.channel_names = ["Red", "Green", "Blue"]
if self.channels > len(self.channel_names):
for c in range(self.channels):
if c >= len(self.channel_names):
Expand Down
Loading