Login  Register

Re: Thresholding and batch processing in FIJI/ImageJ

Posted by ctrueden on Feb 16, 2016; 4:07am
URL: http://imagej.273.s1.nabble.com/Thresholding-and-batch-processing-in-FIJI-ImageJ-tp5015626p5015646.html

Hi Miles,

> I have a series of images all in the same folder and want to apply the
> same operations to them all and save the resultant excel files and
> images in an output folder.

You can use the Process > Batch > Macro... command for this.

For further details, see the Batch Processing page of the ImageJ wiki:
    http://imagej.net/Batch_Processing

I also posted this same answer to your cross-post on StackOverflow:
    http://stackoverflow.com/a/35423532/1207769

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - http://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/


On Sat, Feb 13, 2016 at 8:16 PM, wustlmed <[hidden email]> wrote:

> I know this has been posted elsewhere and that this is no means a difficult
> problem but I'm very new to writing macros in FIJI and am having a hard
> time
> even understanding the solutions described in various online resources.
>
> I have a series of images all in the same folder and want to apply the same
> operations to them all and save the resultant excel files and images in an
> output folder. Specifically, I'd like to open, smooth the image, do a Max
> intensity Z projection, then threshold the images to the same relative
> value.
>
> This thresholding is one step causing a problem. By relative value I mean
> that I would like to set the threshold so that the same % of the intensity
> histogram is included. Currently, in FIJI if you go to
> image>adjust>threshold you can move the sliders such that a certain
> percentage of the image is thresholded and it will display that value for
> you in the open window. In my case 98% is what I am trying to achieve, eg
> thresholding all but the top 2% of the data.
>
> Once the threshold is applied to the MIP, I convert it to binary and do
> particle analysis and save the results (summary table, results, image
> overlay.
>
> My approach has been to try and automate all the steps/ do batch processing
> but I have been having a hard time adapting what I have written to work
> based on instructions found online. Instead I've been just opening every
> image in the directory one by one and applying the macro that I wrote, then
> saving the results manually. Obviously this is a tedious approach so any
> help would be much appreciated!
>
> What I have been using for my simple macro:
>
>      run("Smooth", "stack");
>      run("Z Project...", "projection=[Max Intensity]");
>
>      setAutoThreshold("Default");
>      //run("Threshold...");
>      run("Convert to Mask");
>
>      run("Make Binary");
>      run("Analyze Particles...", "  show=[Overlay Masks] display exclude
> clear include summarize in_situ");
>
>
>
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/Thresholding-and-batch-processing-in-FIJI-ImageJ-tp5015626.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