Login  Register

Re: Macro recorded in image to stack

Posted by CARL Philippe (LBP) on Apr 12, 2017; 2:19pm
URL: http://imagej.273.s1.nabble.com/Macro-recorded-in-image-to-stack-tp5018521p5018523.html

Dear Adrián,
The following modification of your macro deals with slices features:

run("Organ of Corti (2.8M, 4D stack)");
run("RGB Color", "slices");
title = getTitle();
run("Split Channels");
selectWindow(title+" (blue)");
close();
selectWindow(title+" (red)");
close();
selectWindow(title+" (green)");
// process the green channel;
getDimensions(width, height, channels, slices, frames);
for(n = 1; n != slices + 1; n++)
{
        run("Make Substack...", "  slices=" + n);
        run("Gaussian Blur...", "sigma=5");
        setThreshold(40, 255);
        setOption("BlackBackground", false);
        run("Convert to Mask");
        run("Erode");
        run("Analyze Particles...", "size=400-Infinity show=[Overlay Masks] display exclude clear summarize in_situ");
        close();
}

My best regards,
Philippe

Philippe CARL
Laboratoire de Biophotonique et Pharmacologie
UMR 7213 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

-----Message d'origine-----
De : ImageJ Interest Group [mailto:[hidden email]] De la part de Adrián Villalba
Envoyé : mercredi 12 avril 2017 15:23
À : [hidden email]
Objet : Macro recorded in image to stack

Dear all,

I have recorded a macro that works fine for single images but when i do File > Impor sequence and I apply the macro to the stack it gives me different values than the recorded one used for each single image.

Do you know how can i modify the macro to use it for each image in a stack?
The main reason i want to use the macro in a stack is only to avoid running the macro individually for each image rather than run the macro one for all the different images i have.

If it helps, this is the macro:

title = getTitle();
  run("Split Channels");
  selectWindow(title+" (blue)");
  close();
  selectWindow(title+" (red)");
  close();
  selectWindow(title+" (green)");
  // process the green channel;
run("Gaussian Blur...", "sigma=5");


setThreshold(40, 255);

setOption("BlackBackground", false);


run("Convert to Mask");

run("Erode");
run("Analyze Particles...", "size=400-Infinity show=[Overlay Masks] display exclude clear summarize in_situ");



Thank you in advance,


--

   - Adrián Villalba Felipe.
   https://es.linkedin.com/in/adrianvillalba

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

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