From dec2f94747df965d1123e2cb8ef32833f1d64f13 Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Mon, 25 Feb 2019 17:19:57 +0100
Subject: [PATCH] Use fully-qualified calls

---
 src/imcflibs/imagej/shading.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/imcflibs/imagej/shading.py b/src/imcflibs/imagej/shading.py
index 0121198..8417631 100644
--- a/src/imcflibs/imagej/shading.py
+++ b/src/imcflibs/imagej/shading.py
@@ -2,8 +2,7 @@
 
 import os
 
-from ij import IJ
-from ij.plugin import ImageCalculator, RGBStackMerge
+import ij  # pylint: disable-msg=import-error
 
 from ..imagej import bioformats
 from ..imagej import projections
@@ -39,7 +38,7 @@ def apply_model(imps, model, merge=True):
         The merged ImagePlus with all channels, or the original list of stacks
         with the shading-corrected image planes.
     """
-    calc = ImageCalculator()
+    calc = ij.plugin.ImageCalculator()
     for stack in imps:
         # log.debug("Processing channel...")
         calc.run("Divide stack", stack, model)
@@ -47,7 +46,7 @@ def apply_model(imps, model, merge=True):
     if not merge:
         return imps
 
-    merger = RGBStackMerge()
+    merger = ij.plugin.RGBStackMerge()
     merged_imp = merger.mergeChannels(imps, False)
     return merged_imp
 
@@ -119,9 +118,9 @@ def process_folder(path, suffix, outpath, model_file, fmt):
     fmt : str
         The file format suffix for storing the results.
     """
+    imp = ij.IJ.openImage(model_file)
     matching_files = listdir_matching(path, suffix)
 
-    imp = IJ.openImage(model_file)
     imp.show()  # required, otherwise the IJ.run() call will ignore the imp
     for orig_file in matching_files:
         in_file = os.path.join(path, orig_file)
-- 
GitLab