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
25b8746f
Commit
25b8746f
authored
6 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Allow shading model to be None, with no correction being done then
parent
b55646ba
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
+11
-9
11 additions, 9 deletions
src/imcflibs/imagej/shading.py
with
11 additions
and
9 deletions
src/imcflibs/imagej/shading.py
+
11
−
9
View file @
25b8746f
...
...
@@ -66,8 +66,9 @@ def correct_and_project(filename, path, model, proj, fmt):
path : str
The full path to a directory for storing the results. Will be created in
case it doesn
'
t exist yet. Existing files will be overwritten.
model : ij.ImagePlus
A 32-bit floating point image to be used as the shading model.
model : ij.ImagePlus or None
A 32-bit floating point image to be used as the shading model. If model
is None, no shading correction will be applied.
proj : str
A string describing the projections to be created. Use
'
None
'
for not
creating any projections,
'
ALL
'
to do all supported ones.
...
...
@@ -80,13 +81,14 @@ def correct_and_project(filename, path, model, proj, fmt):
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
)
orig
=
bioformats
.
import_image
(
filename
,
split_c
=
True
)
corrected
=
apply_model
(
orig
,
model
)
bioformats
.
export_using_orig_name
(
corrected
,
path
,
filename
,
""
,
fmt
,
True
)
imps
=
bioformats
.
import_image
(
filename
,
split_c
=
True
)
if
model
is
not
None
:
log
.
debug
(
"
Applying shading correction on [%s]...
"
,
filename
)
imps
=
apply_model
(
imps
,
model
)
bioformats
.
export_using_orig_name
(
imps
,
path
,
filename
,
""
,
fmt
,
True
)
if
proj
==
'
None
'
:
projs
=
[]
...
...
@@ -94,10 +96,10 @@ def correct_and_project(filename, path, model, proj, fmt):
projs
=
[
'
Average
'
,
'
Maximum
'
]
else
:
projs
=
[
proj
]
projections
.
create_and_save
(
corrected
,
projs
,
path
,
filename
,
fmt
)
projections
.
create_and_save
(
imps
,
projs
,
path
,
filename
,
fmt
)
#
corrected
.show()
corrected
.
close
()
#
imps
.show()
imps
.
close
()
log
.
debug
(
"
Done processing [%s].
"
,
os
.
path
.
basename
(
filename
))
...
...
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