Skip to content

Commit dec2f94

Browse files
committed
Use fully-qualified calls
1 parent 710070f commit dec2f94

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/imcflibs/imagej/shading.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
import os
44

5-
from ij import IJ
6-
from ij.plugin import ImageCalculator, RGBStackMerge
5+
import ij # pylint: disable-msg=import-error
76

87
from ..imagej import bioformats
98
from ..imagej import projections
@@ -39,15 +38,15 @@ def apply_model(imps, model, merge=True):
3938
The merged ImagePlus with all channels, or the original list of stacks
4039
with the shading-corrected image planes.
4140
"""
42-
calc = ImageCalculator()
41+
calc = ij.plugin.ImageCalculator()
4342
for stack in imps:
4443
# log.debug("Processing channel...")
4544
calc.run("Divide stack", stack, model)
4645

4746
if not merge:
4847
return imps
4948

50-
merger = RGBStackMerge()
49+
merger = ij.plugin.RGBStackMerge()
5150
merged_imp = merger.mergeChannels(imps, False)
5251
return merged_imp
5352

@@ -119,9 +118,9 @@ def process_folder(path, suffix, outpath, model_file, fmt):
119118
fmt : str
120119
The file format suffix for storing the results.
121120
"""
121+
imp = ij.IJ.openImage(model_file)
122122
matching_files = listdir_matching(path, suffix)
123123

124-
imp = IJ.openImage(model_file)
125124
imp.show() # required, otherwise the IJ.run() call will ignore the imp
126125
for orig_file in matching_files:
127126
in_file = os.path.join(path, orig_file)

0 commit comments

Comments
 (0)