|
2 | 2 |
|
3 | 3 | import os |
4 | 4 |
|
5 | | -from ij import IJ |
6 | | -from ij.plugin import ImageCalculator, RGBStackMerge |
| 5 | +import ij # pylint: disable-msg=import-error |
7 | 6 |
|
8 | 7 | from ..imagej import bioformats |
9 | 8 | from ..imagej import projections |
@@ -39,15 +38,15 @@ def apply_model(imps, model, merge=True): |
39 | 38 | The merged ImagePlus with all channels, or the original list of stacks |
40 | 39 | with the shading-corrected image planes. |
41 | 40 | """ |
42 | | - calc = ImageCalculator() |
| 41 | + calc = ij.plugin.ImageCalculator() |
43 | 42 | for stack in imps: |
44 | 43 | # log.debug("Processing channel...") |
45 | 44 | calc.run("Divide stack", stack, model) |
46 | 45 |
|
47 | 46 | if not merge: |
48 | 47 | return imps |
49 | 48 |
|
50 | | - merger = RGBStackMerge() |
| 49 | + merger = ij.plugin.RGBStackMerge() |
51 | 50 | merged_imp = merger.mergeChannels(imps, False) |
52 | 51 | return merged_imp |
53 | 52 |
|
@@ -119,9 +118,9 @@ def process_folder(path, suffix, outpath, model_file, fmt): |
119 | 118 | fmt : str |
120 | 119 | The file format suffix for storing the results. |
121 | 120 | """ |
| 121 | + imp = ij.IJ.openImage(model_file) |
122 | 122 | matching_files = listdir_matching(path, suffix) |
123 | 123 |
|
124 | | - imp = IJ.openImage(model_file) |
125 | 124 | imp.show() # required, otherwise the IJ.run() call will ignore the imp |
126 | 125 | for orig_file in matching_files: |
127 | 126 | in_file = os.path.join(path, orig_file) |
|
0 commit comments