Posted by
Fabrice Cordelières on
Sep 11, 2008; 2:03pm
URL: http://imagej.273.s1.nabble.com/ROI-Thresholding-tp3695022p3695026.html
Hi Brandee,
Try first to make a threshold (Image/Adjust/Threshold), then use the
magic wand tool: click on the "red" zone on the image, and the ROI
will be drawn around the thresholded area.
Alternatively, you may use this macro to automate the measurement over
all slices: simply copy the following lines, go to plugins/macro/new
and paste the text:
8<------------------------------------------
roiManager("Reset");
x=getWidth/2;
y=getHeight/2;
setThreshold(1, pow(2,bitDepth()));
for (i=1; i<=nSlices; i++){
setSlice(i);
doWand(x, y);
roiManager("Add");
roiManager("Select", i-1);
roiManager("Rename", "ROI on slice n°"+i);
}
roiManager("Deselect");
run("Set Measurements...", "area redirect=None decimal=3");
roiManager("Multi Measure");
8<------------------------------------------
Open your image then go to the macro window: macro/run macro. In the
result table, the value indicate the area for each ROI.
NB: in this example, the threshold is set to 1 (change the value if
necessary). I tried it on the sample MRI stack it worked well except
on some slices such as n°12... I can't figure out why the doWand
fails: any idea ?
Fabrice
Le 10 sept. 08 à 17:10, Brandee Winstead a écrit :
> I'm new to ImageJ, having only done simple ROI measurements
> successfully. Now I am needing to get total intracranial volume from
> an MRI and I am hoping to find an easier way to do this than
> manually tracing the brain on each slice. I thought that if I had a
> tool similar to the wand select tool in Photoshop that I could
> adjust thresholds and automatically have an ROI of the brain, since
> everything but the brain is black. Are there any suggestions as how
> to go about doing this? Thank you.
>
> Brandee Winstead
> Emory University
>
Fabrice Cordelières, PhD
Institut Curie - Section de recherche/ CNRS UMR 146
Plateforme d'Imagerie Cellulaire et Tissulaire
Bâtiment 112 - Centre universitaire
91405 Orsay Cedex
FRANCE
Tél. : +33 1 69 86 31 30
Fax. : +33 1 69 86 17 03
Consultez mes disponibilités sur
http://www.google.com/calendar/embed?src=fabrice.cordelieres%40gmail.com