Bug in init when calling from macro ABSnake plugin.

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

Bug in init when calling from macro ABSnake plugin.

feelc
Hi!

When I run the active contourns plugin from the imageJ interface it runs
properly.
But when I call from a macro it shows some Polygonroi init issue and fails.
Any ideas how to fix it. Any alternatives of such good quality?

I paste below the exception code.
Thanks a lot for your time,

Felipe Contreras,
Universidad de Oviedo


*java.lang.NegativeArraySizeException*
* at ij.gui.PolygonRoi.<init>(PolygonRoi.java:39)*
* at ABSnake.createRoi(ABSnake.java:216)*
* at ABSnake_.run(ABSnake_.java:211)*
* at
ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:263)*
* at
ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:112)*
* at ij.IJ.runUserPlugIn(IJ.java:201)*
* at ij.IJ.runPlugIn(IJ.java:163)*
* at ij.Executer.runCommand(Executer.java:131)*
* at ij.Executer.run(Executer.java:64)*
* at ij.IJ.run(IJ.java:275)*
* at ij.macro.Functions.doRun(Functions.java:597)*

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Bug in init when calling from macro ABSnake plugin.

feelc
Ok,
My bad. The plugin doesn't work with every type of Roi.
Rois found with ParticleFinder must be converted to PolygonRoi.
In case somebody needs it (I've seen it asked before), find the code below:

*RoisList=getFileList(RoisPath);//The files in a path that contains Rois*
*for (i=0; i<lengthOf(RoisList); i++){ *
* if(endsWith(RoisList[i],"roi")){ //filtering only rois*
* roiManager("Open", RoisPath+"\\"+RoisList[i]); //open a RoiFile*
* Name=call("ij.plugin.frame.RoiManager.getName", 0);//get the roi name in
case you want to use it*

* selectImage("8bit"); //only works on 8 bits*

* roiManager("select",0); //select the just opened roi*

* getSelectionCoordinates(x, y); //get the coordinates that describe the
roi*
* run("Select None"); *

* makeSelection("polygon", x, y); //create a new poylgonal selection with
those coordinates*

* roiManager("Add"); //add the selection to roi manager*
* roiManager("select",0); //select the non-polygonal roi*
* roiManager("delete"); //delete the non-polygonal roi*

* run("ABSnake", "gradient_threshold=5 number_of_iterations=5
step_result_show=1 save draw_color=Red save_coords"); /
  //run active contounrs with save_coords to save the new roi also,*
*             }*
*      }*
*}*

*IJDirectory=getDirectory("imagej"); //the ABSnake plugin places its output
in imagej default dir.*


2015-07-20 21:12 GMT+02:00 Feel Contraire <[hidden email]>:

> Hi!
>
> When I run the active contourns plugin from the imageJ interface it runs
> properly.
> But when I call from a macro it shows some Polygonroi init issue and fails.
> Any ideas how to fix it. Any alternatives of such good quality?
>
> I paste below the exception code.
> Thanks a lot for your time,
>
> Felipe Contreras,
> Universidad de Oviedo
>
>
> *java.lang.NegativeArraySizeException*
> * at ij.gui.PolygonRoi.<init>(PolygonRoi.java:39)*
> * at ABSnake.createRoi(ABSnake.java:216)*
> * at ABSnake_.run(ABSnake_.java:211)*
> * at
> ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:263)*
> * at
> ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:112)*
> * at ij.IJ.runUserPlugIn(IJ.java:201)*
> * at ij.IJ.runPlugIn(IJ.java:163)*
> * at ij.Executer.runCommand(Executer.java:131)*
> * at ij.Executer.run(Executer.java:64)*
> * at ij.IJ.run(IJ.java:275)*
> * at ij.macro.Functions.doRun(Functions.java:597)*
>
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html