Skip to content
Snippets Groups Projects
Commit 14cd839e authored by Hugo chauvet's avatar Hugo chauvet
Browse files

fix bug in metadata loading for slideexplorer multi roi

parent 334ec795
Branches
Tags
No related merge requests found
...@@ -205,6 +205,7 @@ def list_images(full_metadata: dict, roi=None): ...@@ -205,6 +205,7 @@ def list_images(full_metadata: dict, roi=None):
else: else:
stage_position_labels = ['Pos0'] stage_position_labels = ['Pos0']
if roi is not None: if roi is not None:
# Get the format of the label # Get the format of the label
mm_format = mm_label_format(stage_position_labels[0]) mm_format = mm_label_format(stage_position_labels[0])
...@@ -235,16 +236,28 @@ def list_images(full_metadata: dict, roi=None): ...@@ -235,16 +236,28 @@ def list_images(full_metadata: dict, roi=None):
tmpl_MM2 = 'img_channel{c:03d}_position{p:03d}_time{t:09d}_z{z:03d}.tif' tmpl_MM2 = 'img_channel{c:03d}_position{p:03d}_time{t:09d}_z{z:03d}.tif'
# TODO: NEED to implement tmpl_MM1 # TODO: NEED to implement tmpl_MM1
# TODO: Could be a better solution to get the name from the metadata, but not so easy
# to find it in the correct order.
# For slideExplorer with multiple ROI, the position in the .tif name is continous.
pos_slide_expl = 0
# Loop over label, time, channel, position, to populate the name table # Loop over label, time, channel, position, to populate the name table
for i, label in enumerate(stage_position_labels): for i, label in enumerate(stage_position_labels):
#print(i, label) #print(i, label)
for t in range(summary['Frames']): for t in range(summary['Frames']):
for c in range(summary['Channels']): for c in range(summary['Channels']):
for z in range(summary['Slices']): for z in range(summary['Slices']):
p = 0
# The case for multipose
if 'pos' in label.lower(): if 'pos' in label.lower():
p = re.findall(r'\d+', label)[0] p = re.findall(r'\d+', label)[0]
else:
p = 0 # The case for slideexplorer
if 'tile' in label.lower():
p = pos_slide_expl
nn = label + '/' + tmpl_MM2.format(c=int(c), p=int(p), t=int(t), z=int(z)) nn = label + '/' + tmpl_MM2.format(c=int(c), p=int(p), t=int(t), z=int(z))
...@@ -255,6 +268,9 @@ def list_images(full_metadata: dict, roi=None): ...@@ -255,6 +268,9 @@ def list_images(full_metadata: dict, roi=None):
print(f"No {nn} in metadata") print(f"No {nn} in metadata")
# sys.exit() # sys.exit()
# Increment the position of slideExplorer
pos_slide_expl += 1
return unique_file_names return unique_file_names
......
...@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" ...@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "DITB" name = "DITB"
version = "20240525rc6" version = "20240526rc1"
readme = "README.md" readme = "README.md"
requires-python = ">=3.11" requires-python = ">=3.11"
authors = [{ name = "Hugo Chauvet", email = "hugo.chauvet@synchrotron-soleil.fr" }] authors = [{ name = "Hugo Chauvet", email = "hugo.chauvet@synchrotron-soleil.fr" }]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment