Skip to content

Commit

Permalink
Merge pull request #13 from filippocastelli/pyproject
Browse files Browse the repository at this point in the history
omexml.py refactor, Channel bugfix in OMETIFFReader
  • Loading branch information
filippocastelli authored Feb 3, 2024
2 parents a24c5f9 + 924d095 commit b473d43
Show file tree
Hide file tree
Showing 3 changed files with 398 additions and 404 deletions.
6 changes: 5 additions & 1 deletion pyometiff/omereader.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ def parse_metadata(self, omexml_string):
metadata["ObjMag"] = None

# get channel names
metadata["Channels"] = self._parse_channels(metadata["SizeC"], self.ox, self.imageseries)
try:
metadata["Channels"] = self._parse_channels(metadata["SizeC"], self.ox, self.imageseries)
except (KeyError, AttributeError, IndexError) as e:
metadata["Channels"] = None

# for c in range(metadata["SizeC"]):
# channel_names.append(
# self.ox.image(self.imageseries).Pixels.Channel(c).Name
Expand Down
2 changes: 1 addition & 1 deletion pyometiff/omewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def write_stack(self, array, xml_meta):
logging.warning("array size is larger than 4GB, using BigTIFF")

with tifffile.TiffWriter(str(self.fpath), bigtiff=use_bigtiff) as tif:
tif.save(
tif.write(
array, description=xml_meta, photometric=self.photometric, metadata=None, compression=self.compression
)

Expand Down
Loading

0 comments on commit b473d43

Please sign in to comment.