Hi Ben,
Have you tried the macro recorder (Plugins -> Macro ->Record)? Turn it
on before you carry out the manual sequence of the steps of your
analysis and it records all the macro commands for your operations.
To convert image type to 8-bit grey use run("8-bit").
To measure a selection, use run("Measure") rather than run("Analyze")
(this is not an ImageJ macro command).
You don't actually need to create a selection for the measurement. You
could just simply tick the 'Limit to Threshold' option in the Set
Measurements menu to only measure the areas that are within the
threshold boundaries.
Hope this helps,
Volko
On 07/06/2016 02:48, dugubn wrote:
> Hi all, I'm trying to calculating %leaf lesion area. the protocol from our
> lab is essentially done by hand, but I have over 1000 pictures to analyze. I
> tried to make a macro, but can't get the kinks out, can anyone help me? The
> problem I have so far is that 1. I can't get ImageJ to change the image type
> from 8-bit Color to 8-bit (step 1) set the threshold (step 2) and create
> selection (step 4).
> Our procedure is:
> For both lesion area and leaf area, open image in ImageJ.
> 1. Image>type>8-bit.
> 2. Image>adjust>threshold.
> 3. To measure lesion area, Set>lower threshold limit=0, upper threshold
> limit=~50 so that it resembles the lesion area image.
> 4. Edit>selection>create selection, Analyze>measure.
> 5. Do the same for the leaf area.
> 6. Transfer pixel information to an Excel file to calculate %lesion area.
>
> The macro I tried to write is:
> requires("1.38o");
> dir = getDirectory("Choose a Directory ");
> list = getFileList(dir);
> setBatchMode(true);
> for (i=0; i<list.length; i++) {
> showProgress(i, list.length);
> open(dir+list[i]);
> setThreshold(0, 50);
> run("Create Selection");
> run("Analyze");
> close;
> }
> selectWindow("Summary");
> saveAs("Text", getDirectory("home")+"Summary.txt");
>
>
> thanks!
> Ben
>
>
>
>
>
> --
> View this message in context:
http://imagej.1557.x6.nabble.com/Question-How-to-setup-batch-conversion-for-leaf-lesion-calculation-tp5016599.html> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html