substact no working on mac (IJ version 1,38 n)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

substact no working on mac (IJ version 1,38 n)

Philippe Rosay
hello,
within ROI manager i need to make the difference between two selections.
on opening of Image J, macro is ok.
second time : error. (on older versions of IJ it was ok).
weird ?
any step i can follow? i'm not a programmer...
thanks for your help!
Philippe

java.lang.NullPointerException
        at ij.gui.Roi.modifyRoi(Roi.java:584)
        at ij.gui.PolygonRoi.finishPolygon(PolygonRoi.java:279)
        at ij.gui.PolygonRoi.<init>(PolygonRoi.java:63)
        at ij.gui.ShapeRoi.createRoi(ShapeRoi.java:553)
        at ij.gui.ShapeRoi.parsePath(ShapeRoi.java:946)
        at ij.gui.ShapeRoi.shapeToRoi(ShapeRoi.java:470)
        at ij.plugin.filter.ThresholdToSelection.getRoi(ThresholdToSelection.java:255)
        at ij.plugin.filter.ThresholdToSelection.run(ThresholdToSelection.java:33)
        at ij.IJ.runFilterPlugIn(IJ.java:204)
        at ij.IJ.runPlugIn(IJ.java:132)
        at ij.IJ.runPlugIn(IJ.java:112)
        at ij.plugin.Selection.createSelectionFromMask(Selection.java:331)
        at ij.plugin.Selection.run(Selection.java:42)
        at ij.IJ.runPlugIn(IJ.java:130)
        at ij.Executer.runCommand(Executer.java:95)
        at ij.Executer.run(Executer.java:49)
        at ij.IJ.run(IJ.java:338)
        at ij.IJ.run(IJ.java:311)
        at ij.macro.Functions.doRun(Functions.java:523)
        at ij.macro.Functions.doFunction(Functions.java:65)
        at ij.macro.Interpreter.doStatement(Interpreter.java:204)
        at ij.macro.Interpreter.doStatements(Interpreter.java:194)
        at ij.macro.Interpreter.run(Interpreter.java:98)
        at ij.macro.Interpreter.run(Interpreter.java:64)
        at ij.macro.MacroRunner.run(MacroRunner.java:103)
        at java.lang.Thread.run(Thread.java:613)`



the macro i'm using is :

// "SelectionSoustraire"
// This macro creates a selection that is the difference
// between two selections in the ROI Manager.

  requires("1.36b");
  orig = getImageID();
  setBatchMode(true);
  if (roiManager("Count")!=2)
      exit("Two ROIs in ROI Manager required");
  roiManager("Select", 1);
  run("Create Mask");
  rename("Mask1");
  mask1 = getImageID();
  roiManager("Select", 0);
  run("Create Mask");
  mask2 = getImageID();
  imageCalculator("SUB", mask2, mask1);
  run("Create Selection");
  roiManager("Add");
  selectImage(orig);
  roiManager("Select", 2);
  roiManager("Rename", "Soustrait");