Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DITB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DISCO Beamline
DITB
Commits
14cd839e
Commit
14cd839e
authored
Jun 26, 2024
by
Hugo chauvet
Browse files
Options
Downloads
Patches
Plain Diff
fix bug in metadata loading for slideexplorer multi roi
parent
334ec795
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ditb/io/metadata.py
+19
-3
19 additions, 3 deletions
ditb/io/metadata.py
pyproject.toml
+1
-1
1 addition, 1 deletion
pyproject.toml
with
20 additions
and
4 deletions
ditb/io/metadata.py
+
19
−
3
View file @
14cd839e
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
1
View file @
14cd839e
...
@@ -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
=
"2024052
5
rc
6
"
version
=
"2024052
6
rc
1
"
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"
}
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment