Skip to content

Commit

Permalink
Add default names for Scenes for missing image names
Browse files Browse the repository at this point in the history
  • Loading branch information
annshress committed Sep 6, 2023
1 parent df0ae6d commit 874ac7c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pytools/utils/OMEInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ def number_of_images(self) -> int:
return len(self._root_element.findall("OME:Image", self._ome_ns))

def image_names(self) -> Iterable[str]:
counter = 1
for e in self._root_element.iterfind("OME:Image", self._ome_ns):
yield e.attrib["Name"]
yield e.attrib["Name"] or f"Scene #{counter}"
counter += 1

def channel_names(self, image_index) -> Iterable[str]:
el = self._image_element(image_index).iterfind("OME:Pixels/OME:Channel", self._ome_ns)
Expand Down

0 comments on commit 874ac7c

Please sign in to comment.