Skip to content

Commit

Permalink
Merge pull request #134 from TimMonko/change-layer-name-ordering
Browse files Browse the repository at this point in the history
Put channel name at beginning of layer name for reader
  • Loading branch information
TimMonko authored Dec 20, 2024
2 parents 27ec5cb + 53c383e commit c3833c8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/napari_ndev/nimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,21 +185,20 @@ def get_napari_metadata(

meta = {}
scene = self.current_scene
scene_index = self.current_scene_index
scene_idx = self.current_scene_index
single_no_scene = len(self.scenes) == 1 and self.current_scene == "Image:0"
channel_dim = DimensionNames.Channel

if channel_dim in self.napari_data.dims:
# use filename if single scene and no scene name available
if single_no_scene:
channels_with_scene_index = [
f'{Path(path).stem}{LABEL_DELIMITER}{C}'
f'{C}{LABEL_DELIMITER}{Path(path).stem}'
for C in self.napari_data.coords[channel_dim].data.tolist()
]
else:
channels_with_scene_index = [
f'{scene_index}{LABEL_DELIMITER}'
f'{scene}{LABEL_DELIMITER}{C}'
f'{C}{LABEL_DELIMITER}{scene_idx}{LABEL_DELIMITER}{scene}'
for C in self.napari_data.coords[channel_dim].data.tolist()
]
meta['name'] = channels_with_scene_index
Expand Down

0 comments on commit c3833c8

Please sign in to comment.