Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python-imcflibs
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
imcf
python-imcflibs
Commits
0aa41d09
Commit
0aa41d09
authored
6 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Only create shading-corrected images if they don't exist yet
parent
468b7953
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/imcflibs/imagej/shading.py
+12
-2
12 additions, 2 deletions
src/imcflibs/imagej/shading.py
with
12 additions
and
2 deletions
src/imcflibs/imagej/shading.py
+
12
−
2
View file @
0aa41d09
...
...
@@ -7,7 +7,7 @@ from ij.plugin import ImageCalculator, RGBStackMerge
from
..imagej
import
bioformats
from
..imagej
import
projections
from
..pathtools
import
listdir_matching
from
..pathtools
import
listdir_matching
,
gen_name_from_orig
from
..log
import
LOG
as
log
...
...
@@ -55,6 +55,11 @@ def apply_model(imps, model, merge=True):
def
correct_and_project
(
filename
,
path
,
model
,
proj
,
fmt
):
"""
Apply a shading correction to an image and create a projection.
In case the target file for the shading corrected image already exists,
nothing is done - neither the shading correction is re-created nor any
projections will be done (independent on whether the latter one already
exist or not).
Parameters
----------
filename : str
...
...
@@ -71,7 +76,12 @@ def correct_and_project(filename, path, model, proj, fmt):
The file format suffix to be used for the results and projections, e.g.
'
.ics
'
for ICS2 etc. See the Bio-Formats specification for details.
"""
log
.
debug
(
"
Processing [%s]...
"
,
filename
)
target
=
gen_name_from_orig
(
path
,
filename
,
""
,
fmt
)
if
os
.
path
.
exists
(
target
):
log
.
info
(
"
Found shading corrected file, not re-creating: %s
"
,
target
)
return
log
.
debug
(
"
Applying shading correction on [%s]...
"
,
filename
)
if
not
os
.
path
.
exists
(
path
):
os
.
makedirs
(
path
)
...
...
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