3D object counter : extract data from the windows Statistics ...

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

3D object counter : extract data from the windows Statistics ...

SUBSCRIBE IMAGEJ Marie-Laure B
Hi,

I have one object per image (16 bits), and would like to extract the max of the image to treat other images with these data ?

How do I  extract this information from the windows Statistics about objects automatically ?

run("3D object counter...", "threshold=1 slice=56 min.=1 max.=963664 statistics summary");
maxcontrol=getStatistics("Max");

I suppose it's obvious, but ... not easy to find this information.
thank you for your help,

MLB

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

Re: 3D object counter : extract data from the windows Statistics ...

SUBSCRIBE IMAGEJ Marie-Laure B
This function do the staff, but don't answer to the question :

function ExtractMaxSlices(){

MonMax=0;
for (i=1; i<=nSlices; i++)
                {
        setSlice(i);
          getStatistics(area, mean, min, max, std);
   //      waitForUser( "max   "+max);

                                if(max>MonMax ) {
                                                MonMax = max; //find the value and location of the largest value
               
                     }
             }

             //waitForUser( "MonMax   "+MonMax);
             return MonMax;

}


lemax=ExtractMaxSlices();
waitForUser( "lemax   -> "+lemax);

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

Re: 3D object counter : extract data from the windows Statistics ...

Michael Schmid
In reply to this post by SUBSCRIBE IMAGEJ Marie-Laure B
Hi Marie-Laure,

Note that "getStatistics" cares about the sequence of the arguments. E.g. the first one is always the area. You can omit arguments only at the end.

  getStatistics(area, mean, min, max);
This will give you the values for the current image (or the current selection, if any) and write it to the variables named 'area', 'mean', 'min' and 'max'.

  getStatistics(x0, x1, x2, x3);
will get the same values, but the maximum pixel value is now written to variable 'x3'.

Michael
________________________________________________________________
On Nov 25, 2014, at 12:29, MLB wrote:

> Hi,
>
> I have one object per image (16 bits), and would like to extract the max of the image to treat other images with these data ?
>
> How do I  extract this information from the windows Statistics about objects automatically ?
>
> run("3D object counter...", "threshold=1 slice=56 min.=1 max.=963664 statistics summary");
> maxcontrol=getStatistics("Max");
>
> I suppose it's obvious, but ... not easy to find this information.
> thank you for your help,
>
> MLB
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: 3D object counter : extract data from the windows Statistics ...

SUBSCRIBE IMAGEJ Marie-Laure B
In reply to this post by SUBSCRIBE IMAGEJ Marie-Laure B
Thank you for your help,

For stacks : 3D image, it doesn't work

run("Bat Cochlea Volume (19K)");

//open(dirRes+img);
setSlice(1);
getStatistics(area, mean, min, max);
waitForUser("area -> "+area);

setSlice(100);
getStatistics(area, mean, min, max);
waitForUser("area -> "+area);

Do I miss something ?

Marie Laure

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

Re: 3D object counter : extract data from the windows Statistics ...

Krs5
Dear Marie,

There is no selection in your image, so you get the stats from the whole image.

To get an idea, something like below should work. However I have to duplicate the second ("Analyze Particles...","add slice"); for this to work. Looks like a bug.

run("Bat Cochlea Volume (19K)");

setAutoThreshold("Default dark");
//run("Threshold...");
//setThreshold(129, 255);
setOption("BlackBackground", false);
run("Convert to Mask", "stack");
run("Analyze Particles...", "stack");

//open(dirRes+img);
setSlice(1);
run("Analyze Particles...","add slice");
roiManager("select", 0);
getStatistics(area, mean, min, max);
waitForUser("area -> "+area);


setSlice(100);
run("Analyze Particles...","add slice");

run("Analyze Particles...","add slice"); // BUG

roiManager("select", 1);
getStatistics(area, mean, min, max);
waitForUser("area -> "+area);

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/lite/aif


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of SUBSCRIBE IMAGEJ Marie-Laure B
Sent: 25 November 2014 16:43
To: [hidden email]
Subject: Re: 3D object counter : extract data from the windows Statistics ...

Thank you for your help,

For stacks : 3D image, it doesn't work

run("Bat Cochlea Volume (19K)");

//open(dirRes+img);
setSlice(1);
getStatistics(area, mean, min, max);
waitForUser("area -> "+area);

setSlice(100);
getStatistics(area, mean, min, max);
waitForUser("area -> "+area);

Do I miss something ?

Marie Laure

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

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

Re: 3D object counter : extract data from the windows Statistics ...

Thomas Boudier
In reply to this post by SUBSCRIBE IMAGEJ Marie-Laure B
Dear MLB,

The function getStatistics works only for 2D images, for 3D images use :

Stack.getStatistics(voxelCount, mean, min, max, stdDev) ; // no ""

then

maxcontrol=max;

Best,

Thomas


On 25/11/14 19:29, MLB wrote:

> Hi,
>
> I have one object per image (16 bits), and would like to extract the max of the image to treat other images with these data ?
>
> How do I  extract this information from the windows Statistics about objects automatically ?
>
> run("3D object counter...", "threshold=1 slice=56 min.=1 max.=963664 statistics summary");
> maxcontrol=getStatistics("Max");
>
> I suppose it's obvious, but ... not easy to find this information.
> thank you for your help,
>
> MLB
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
   /***************************************************************/
      Thomas Boudier, Associate Professor, UPMC,
      Université Pierre et Marie Curie, Paris, France.
      BioInformatics Institute (BII)/IPAL, Singapore.
/**************************************************************/

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

Re: 3D object counter : extract data from the windows Statistics ...

SUBSCRIBE IMAGEJ Marie-Laure B
In reply to this post by SUBSCRIBE IMAGEJ Marie-Laure B
Hi Thomas,

Thank you for your help,

Stack.getStatistics(voxelCount, mean, min, max, stdDev) ; // no ""
give me general statistics about image and not about objects.

3D object counter
run("3D object counter...", "threshold=128 slice=56 min.=0 max.=963664 objects statistics summary");
give me Volume, Surface , ...
But I would like to extract it to put it into a variable.
How can I do ?

Marie Laure

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

Re: 3D object counter : extract data from the windows Statistics ...

Thomas Boudier
Hi Marie Laure,

In order to get the values from 3D Object Counter, you have to save the
results (File / save  as results) and then import the file (File/import
results). Then you can use the getResults functions, maybe you can also
have a look to 3DManager with extended macro functions :
http://imagejdocu.tudor.lu/doku.php?id=plugin:stacks:3d_roi_manager:start

best,

Thomas


Le 26/11/2014 19:31, SUBSCRIBE IMAGEJ Marie-Laure B a écrit :

> Hi Thomas,
>
> Thank you for your help,
>
> Stack.getStatistics(voxelCount, mean, min, max, stdDev) ; // no ""
> give me general statistics about image and not about objects.
>
> 3D object counter
> run("3D object counter...", "threshold=128 slice=56 min.=0 max.=963664 objects statistics summary");
> give me Volume, Surface , ...
> But I would like to extract it to put it into a variable.
> How can I do ?
>
> Marie Laure
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>

--
   /***************************************************************/
      Thomas Boudier, Associate Professor, UPMC,
      Université Pierre et Marie Curie, Paris, France.
      BII (BioInformatics Institute)/UMI 2955 IPAL, Singapore.
/**************************************************************/

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