Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Create mosaïc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
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
Create mosaïc
Commits
c563f8b2
Commit
c563f8b2
authored
4 months ago
by
Hugo CHAUVET
Browse files
Options
Downloads
Patches
Plain Diff
Correct new position of ANDOR camera for data after april 2025
parent
a50c45e6
No related branches found
Tags
hdbtdbArchivingServers-2.4.3
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ImageJ/script_mosaic_telemos.py
+22
-3
22 additions, 3 deletions
ImageJ/script_mosaic_telemos.py
with
22 additions
and
3 deletions
ImageJ/script_mosaic_telemos.py
+
22
−
3
View file @
c563f8b2
...
@@ -15,6 +15,7 @@ and launch it from the script editor by pressing F5. Or using the Run button.
...
@@ -15,6 +15,7 @@ and launch it from the script editor by pressing F5. Or using the Run button.
@author: H. Chauvet (synchrotron-soleil)
@author: H. Chauvet (synchrotron-soleil)
Used IJ plugins: Bio-Formats, BaSIC
Used IJ plugins: Bio-Formats, BaSIC
VERSION: 02042025
"""
"""
...
@@ -126,6 +127,16 @@ def getWidthHeight(metadata):
...
@@ -126,6 +127,16 @@ def getWidthHeight(metadata):
return
width
,
height
return
width
,
height
def
getAcqDate
(
metadata
):
"""
Get the acquisition date from metadata
"""
starttime
=
metadata
[
'
Summary
'
][
'
StartTime
'
].
split
(
'
'
)[
0
]
year
,
month
,
day
=
starttime
.
split
(
'
-
'
)
return
int
(
year
),
int
(
month
),
int
(
day
)
def
load_image_tiles_stack
(
images_dir
):
def
load_image_tiles_stack
(
images_dir
):
"""
"""
Fonction pour charge le stack d
'
images depuis
Fonction pour charge le stack d
'
images depuis
...
@@ -183,7 +194,7 @@ def load_image_tiles_stack(images_dir):
...
@@ -183,7 +194,7 @@ def load_image_tiles_stack(images_dir):
regex_cpt_roi
=
None
regex_cpt_roi
=
None
name_pattern
=
'
Default
'
name_pattern
=
'
Default
'
#
Save the base directory
#Save the base directory
base_dir
=
os
.
path
.
abspath
(
d
)
base_dir
=
os
.
path
.
abspath
(
d
)
if
regex_cpt_roi
is
not
None
:
if
regex_cpt_roi
is
not
None
:
...
@@ -870,7 +881,14 @@ def extract_tile_positions(metadata, selected_roi, tilesondisk, tilename='tile_'
...
@@ -870,7 +881,14 @@ def extract_tile_positions(metadata, selected_roi, tilesondisk, tilename='tile_'
yt
=
[
yt
[
i
]
for
i
in
igood
]
yt
=
[
yt
[
i
]
for
i
in
igood
]
if
ANDOR
:
if
ANDOR
:
# Test the date of acquisition Their as been a rotation of the ANDOR Camera at the beginning of APRIL 2025
y
,
m
,
d
=
getAcqDate
(
metadata
)
if
y
<=
2025
and
m
<
4
:
IJ
.
log
(
'
Use the old position of the ANDOR camera
'
)
xt
=
[
-
x
for
x
in
xt
]
xt
=
[
-
x
for
x
in
xt
]
else
:
IJ
.
log
(
'
Use the new position of the ANDOR camera after 01/04/2025
'
)
yt
=
[
-
y
for
y
in
yt
]
xt
=
map
(
lambda
x
:
x
/
pix2um
,
xt
)
xt
=
map
(
lambda
x
:
x
/
pix2um
,
xt
)
yt
=
map
(
lambda
x
:
x
/
pix2um
,
yt
)
yt
=
map
(
lambda
x
:
x
/
pix2um
,
yt
)
...
@@ -878,6 +896,7 @@ def extract_tile_positions(metadata, selected_roi, tilesondisk, tilename='tile_'
...
@@ -878,6 +896,7 @@ def extract_tile_positions(metadata, selected_roi, tilesondisk, tilename='tile_'
xt
=
map
(
lambda
x
:
x
-
int
(
roiwidth
/
2
),
xt
)
xt
=
map
(
lambda
x
:
x
-
int
(
roiwidth
/
2
),
xt
)
yt
=
map
(
lambda
x
:
x
-
int
(
roiwidth
/
2
),
yt
)
yt
=
map
(
lambda
x
:
x
-
int
(
roiwidth
/
2
),
yt
)
# minus the minimum (before it was minus the first position)
xt
=
[
x
-
xt
[
0
]
for
x
in
xt
]
xt
=
[
x
-
xt
[
0
]
for
x
in
xt
]
yt
=
[
y
-
yt
[
0
]
for
y
in
yt
]
yt
=
[
y
-
yt
[
0
]
for
y
in
yt
]
...
@@ -912,7 +931,7 @@ if __name__ in ['__builtin__','__main__']:
...
@@ -912,7 +931,7 @@ if __name__ in ['__builtin__','__main__']:
fwhite
=
fwhite
.
absolutePath
fwhite
=
fwhite
.
absolutePath
# Start Log
# Start Log
IJ
.
log
(
"
------- Start MOSAIC TELEMOS -------
"
)
IJ
.
log
(
"
------- Start MOSAIC TELEMOS
(version: 02042025)
-------
"
)
IJ
.
log
(
"
Image stack: %s
"
%
fdata
)
IJ
.
log
(
"
Image stack: %s
"
%
fdata
)
IJ
.
log
(
"
Dark stack: %s
"
%
fdark
)
IJ
.
log
(
"
Dark stack: %s
"
%
fdark
)
IJ
.
log
(
"
Dark of white stack: %s
"
%
fdarkwhite
)
IJ
.
log
(
"
Dark of white stack: %s
"
%
fdarkwhite
)
...
...
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