Login  Register

Re: Help with macro

Posted by jerie on Dec 06, 2016; 7:24pm
URL: http://imagej.273.s1.nabble.com/Help-with-macro-tp5017698p5017701.html

Dear Pablo,

a viable option to apply recorded macros to a number of files in a set
directory is by using http://imagej.net/Batch_Processing.

Hope that helps,

Abraços, Jens

Dr. Jens Rietdorf, visiting scientist @ center for technological
development in health CDTS, Oswaldo Cruz Foundation Fiocruz, Rio de Janeiro
Brasil.

On Tue, Dec 6, 2016 at 3:59 PM, Pablo M <[hidden email]> wrote:

> Dear ImageJ community,
>
> I want to create  a macro  to analyse a complete folder of my images since
> I do not know how to write the macro I am using the macro record tool.
>
> This is the macro with my instructions,
>
>  selectWindow("1 control.lsm");
> run("Subtract Background...", "rolling=300 stack");
> run("Median...", "radius=1.2 stack");
> run("StackReg", "transformation=Translation disable_global");
> run("Split Channels");
> selectWindow("C1-1 control.lsm");
> run("Duplicate...", "title=CFP");
> setAutoThreshold("Default dark");
> //run("Threshold...");
> setOption("BlackBackground", false);
> run("Convert to Mask");
> run("Divide...", "value=255.000");
> imageCalculator("Divide create 32-bit", "C2-1 control.lsm","C1-1
> control.lsm");
> selectWindow("Result of C2-1 control.lsm");
> imageCalculator("Divide create 32-bit", "Result of C2-1
> control.lsm","CFP");
> selectWindow("Result of Result of C2-1 control.lsm");
> run("16 colors");
> run("Scale Bar...", "width=30 height=8 font=28 color=White background=None
> location=[Lower Right] bold");
> run("Calibration Bar...", "location=[Upper Right] fill=White label=Black
> number=5 decimal=1 font=12 zoom=2");
>
> My problem is when I try to do this with another image with differents name
> (e.g 1 Treatment.lsm, 2 Treatment.lsm , etc) the macro does not work.
> I would like to do this process to a complete folder of images which the
> name of the images are different and save the result in another folder.
>
>  Furthermore, I would like that the macro asks me to adjust the Threshold.
>
> Any suggestion and help I will really appreciate and will save me a lot of
> hour behind the computer.
>
> Thanks in advance.
>
> Pablo M.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Jens Rietdorf Visiting Scientist Fundação Oswaldo Cruz - Ministério da Saúde, Centro de Desenvolvimento Tecnológico em Saúde (CDTS), Rio de Janeiro, Brasil.