Convex hull method not found and GetMask null value

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

Convex hull method not found and GetMask null value

Eddie Iannuccelli
Hello,
I am trying to translate a macro into plugin but I encounter some problems
;)
Basically, I browse a particle analyser result table (ran on a stack
z-projection image) to extract each particle from the source stack into
dedicated image.

For each particle :
        {
        use Wand class to get outline -> OK
        transform outline to roi -> OK
        run a convex hull to enlarge this roi -> did not find any hull
method except
                                                             using the macro
launcher IJ.run which throws following  error:
                                                            Convex Hull:
Polygonal or point selection required -> ?
        create a mask for current particle    -> getMask return null ->
still don't understand the null/not null
                                                                for
irregular/regular shapes-> :(
        }

Thanks for your help.


Here is my code
////////////////////////////////////////////////
//ipProcess is the
for (int i=0;i<resTable.getCounter();i++)
        {
      Wand myWand = new Wand(ipProcess);    
      myWand.autoOutline((int)x,(int)y);
      PolygonRoi myROI= new PolygonRoi(myWand.xpoints,
myWand.ypoints,myWand.npoints, Roi.TRACED_ROI);
      ipProcess.setRoi(myROI);
      IJ.run("Convex Hull");
      ipMask=myROI.getMask();
        }
////////////////////////////////////////////////

----------------------------------------
Eddie Iannuccelli
Laboratoire de génétique cellulaire
INRA - Castanet Tolosan
Tel: 05 61 28 54 44 / Fax: 05 61 28 53 08
Reply | Threaded
Open this post in threaded view
|

Re: Convex hull method not found and GetMask null value

Thomas Boudier-2
Eddie Iannuccelli a écrit :

> Hello,
> I am trying to translate a macro into plugin but I encounter some problems
> ;)
> Basically, I browse a particle analyser result table (ran on a stack
> z-projection image) to extract each particle from the source stack into
> dedicated image.
>
> For each particle :
> {
> use Wand class to get outline -> OK
> transform outline to roi -> OK
> run a convex hull to enlarge this roi -> did not find any hull
> method except
>  

Hi Eddie,

Ca va ?

Maybe you can use the dilate operation on the mask of the roi using the
methods getMask() in Roi and then dilate() in imageProcessor.

a+

Thomas

>     using the macro
> launcher IJ.run which throws following  error:
>    Convex Hull:
> Polygonal or point selection required -> ?
> create a mask for current particle    -> getMask return null ->
> still don't understand the null/not null
> for
> irregular/regular shapes-> :(
> }
>
> Thanks for your help.
>
>
> Here is my code
> ////////////////////////////////////////////////
> //ipProcess is the
> for (int i=0;i<resTable.getCounter();i++)
> {
>       Wand myWand = new Wand(ipProcess);    
>       myWand.autoOutline((int)x,(int)y);
>       PolygonRoi myROI= new PolygonRoi(myWand.xpoints,
> myWand.ypoints,myWand.npoints, Roi.TRACED_ROI);
>       ipProcess.setRoi(myROI);
>       IJ.run("Convex Hull");
>       ipMask=myROI.getMask();
> }
> ////////////////////////////////////////////////
>
> ----------------------------------------
> Eddie Iannuccelli
> Laboratoire de génétique cellulaire
> INRA - Castanet Tolosan
> Tel: 05 61 28 54 44 / Fax: 05 61 28 53 08
>
> .
>
>  


--
/*****************************************************/
 Thomas Boudier, MCU Université Pierre et Marie Curie
 Imagerie Intégrative,Institut Curie - INSERM U759.
 Tél : 01 69 86 31 72  Fax : 01 69 07 53 27
/*****************************************************/


 
Reply | Threaded
Open this post in threaded view
|

Re: Convex hull method not found and GetMask null value

Wayne Rasband
In reply to this post by Eddie Iannuccelli
ImageJ commands invoked using the IJ.run() method operate on the
current image so you need to use code something like this:

     IJ.doWand(x,y);
     IJ.run("Convex Hull");
     mask = IJ.getImage().getMask();

-wayne

On Jul 12, 2006, at 4:46 AM, Eddie Iannuccelli wrote:

> Hello,
> I am trying to translate a macro into plugin but I encounter some
> problems
> ;)
> Basically, I browse a particle analyser result table (ran on a stack
> z-projection image) to extract each particle from the source stack into
> dedicated image.
>
> For each particle :
> {
> use Wand class to get outline -> OK
> transform outline to roi -> OK
> run a convex hull to enlarge this roi -> did not find any hull
> method except
>     using the macro
> launcher IJ.run which throws following  error:
>    Convex Hull:
> Polygonal or point selection required -> ?
> create a mask for current particle    -> getMask return null ->
> still don't understand the null/not null
> for
> irregular/regular shapes-> :(
> }
>
> Thanks for your help.
>
>
> Here is my code
> ////////////////////////////////////////////////
> //ipProcess is the
> for (int i=0;i<resTable.getCounter();i++)
> {
>       Wand myWand = new Wand(ipProcess);
>       myWand.autoOutline((int)x,(int)y);
>       PolygonRoi myROI= new PolygonRoi(myWand.xpoints,
> myWand.ypoints,myWand.npoints, Roi.TRACED_ROI);
>       ipProcess.setRoi(myROI);
>       IJ.run("Convex Hull");
>       ipMask=myROI.getMask();
> }
> ////////////////////////////////////////////////
>
> ----------------------------------------
> Eddie Iannuccelli
> Laboratoire de génétique cellulaire
> INRA - Castanet Tolosan
> Tel: 05 61 28 54 44 / Fax: 05 61 28 53 08
>