Re: Getting stats from Trainable Weka Segmentation plugin?

Posted by Ignacio Arganda-Carreras on
URL: http://imagej.273.s1.nabble.com/Getting-stats-from-Trainable-Weka-Segmentation-plugin-tp5004723p5004724.html

Dear Patrick,

Here you are a macro that does (I believe) what you want. Let me know if
you have questions.

(i copy/paste it here because the server doesn't seem to like me attaching
it)

<code>


// id values of each class in the classified image
classLabels = newArray( 0, 64, 128, 191, 255 );

setBatchMode( true );
run("Set Measurements...", "area_fraction redirect=None decimal=3");

for( i=0; i<classLabels.length; i ++ )
{
minTh = classLabels[ i ];
maxTh = classLabels[ i ];
 if( i < classLabels.length - 1 )
 maxTh = classLabels[ i+1 ] -1;
else // last value is assumed to be 255
 {
minTh = classLabels[ i-1 ] +1;
 maxTh = classLabels[ i ];
}
 selectWindow("Classified image");
 run("Duplicate...", "title=[to-be-thresholded]");
selectWindow("to-be-thresholded");
 setThreshold( minTh, maxTh );
run("Convert to Mask");
 run("Measure");
close();
}




</code>



Cheers!

ignacio



On Mon, Sep 9, 2013 at 7:47 AM, Mr Patrick Fortuna <
[hidden email]> wrote:

> Hi ImageJ users/developers,
>
> I'm quite new with using ImageJ (Fiji) and was wondering if anyone could
> help out with getting some stats?
> I'm using the Trainable Weka Segmentation plugin through Fiji to train and
> segment an H/E stained section of a teratoma (benign tumor formed from
> undifferentiated stem cells).
> Once I've trained the classifiers for the various classes I'm interested
> in, I'd be really interested in getting stats on what percentage of each
> classifier is present within the image I'm working with.
> I've tried using the Measurement of Percent Area (as described here:
> http://www.nist.gov/lispix/imlab/measure/pctarea.html) although I
> couldn't seem to set the threshold cause I have more than one color in the
> segmented image (due to 5 classifiers being run at the same time).
> Could anyone recommend how to get the stats of my interested classes?
> Any help would be much appreciated!
>
> Thanks and regards,
> Patrick
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Ignacio Arganda-Carreras, Ph.D.
Seung's lab, 46-5065
Department of Brain and Cognitive Sciences
Massachusetts Institute of Technology
43 Vassar St.
Cambridge, MA 02139
USA

Phone: (001) 617-324-3747
Website: http://bioweb.cnb.csic.es/~iarganda/index_EN.html

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