Skip to content
Snippets Groups Projects
Commit dec2f947 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Use fully-qualified calls

parent 710070f7
No related branches found
No related tags found
No related merge requests found
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
import os import os
from ij import IJ import ij # pylint: disable-msg=import-error
from ij.plugin import ImageCalculator, RGBStackMerge
from ..imagej import bioformats from ..imagej import bioformats
from ..imagej import projections from ..imagej import projections
...@@ -39,7 +38,7 @@ def apply_model(imps, model, merge=True): ...@@ -39,7 +38,7 @@ def apply_model(imps, model, merge=True):
The merged ImagePlus with all channels, or the original list of stacks The merged ImagePlus with all channels, or the original list of stacks
with the shading-corrected image planes. with the shading-corrected image planes.
""" """
calc = ImageCalculator() calc = ij.plugin.ImageCalculator()
for stack in imps: for stack in imps:
# log.debug("Processing channel...") # log.debug("Processing channel...")
calc.run("Divide stack", stack, model) calc.run("Divide stack", stack, model)
...@@ -47,7 +46,7 @@ def apply_model(imps, model, merge=True): ...@@ -47,7 +46,7 @@ def apply_model(imps, model, merge=True):
if not merge: if not merge:
return imps return imps
merger = RGBStackMerge() merger = ij.plugin.RGBStackMerge()
merged_imp = merger.mergeChannels(imps, False) merged_imp = merger.mergeChannels(imps, False)
return merged_imp return merged_imp
...@@ -119,9 +118,9 @@ def process_folder(path, suffix, outpath, model_file, fmt): ...@@ -119,9 +118,9 @@ def process_folder(path, suffix, outpath, model_file, fmt):
fmt : str fmt : str
The file format suffix for storing the results. The file format suffix for storing the results.
""" """
imp = ij.IJ.openImage(model_file)
matching_files = listdir_matching(path, suffix) matching_files = listdir_matching(path, suffix)
imp = IJ.openImage(model_file)
imp.show() # required, otherwise the IJ.run() call will ignore the imp imp.show() # required, otherwise the IJ.run() call will ignore the imp
for orig_file in matching_files: for orig_file in matching_files:
in_file = os.path.join(path, orig_file) in_file = os.path.join(path, orig_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment