getting the number of slices and divide it by a constant

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

getting the number of slices and divide it by a constant

dbrito10
I created a macro to process z-stacks of 3 fluorescence channels into RGB images. It includes using the GroupedZ Projector plugin, where you have to write the number of images per group. Because all my z-tacks have a different number of images, I would like for this macro to calculate this value automatically. I've tried using nSlices and variants to get the number of slices, but without luck. Check below:


run("Grouped ZProjector", "group=41 projection=[Max Intensity]");


In this line, instead of group=41 (this was the case where the z-stack had 123 slices, so each channel had 123:3=41) I would like for the macro to get the number of slices and divide it by 3, so that I don't have to write it everytime.

Any ideas?

Thank you in advance
Reply | Threaded
Open this post in threaded view
|

Re: getting the number of slices and divide it by a constant

Michael Weber-4
This should work:

slicenumber = nSlices/3;
run("Grouped ZProjector", "group="+slicenumber+" projection=[Max
Intensity]");

Michael


> I created a macro to process z-stacks of 3 fluorescence channels into RGB
> images. It includes using the GroupedZ Projector plugin, where you have to
> write the number of images per group. Because all my z-tacks have a
> different number of images, I would like for this macro to calculate this
> value automatically. I've tried using nSlices and variants to get the
> number
> of slices, but without luck. Check below:
>
>
> run("Grouped ZProjector", "group=41 projection=[Max Intensity]");
>
>
> In this line, instead of group=41 (this was the case where the z-stack had
> 123 slices, so each channel had 123:3=41) I would like for the macro to
> get
> the number of slices and divide it by 3, so that I don't have to write it
> everytime.
>
> Any ideas?
>
> Thank you in advance
>
> --
> View this message in context:
> http://imagej.588099.n2.nabble.com/getting-the-number-of-slices-and-divide-it-by-a-constant-tp5070362p5070362.html
> Sent from the ImageJ mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: getting the number of slices and divide it by a constant

dbrito10
Thank you, it did work :)

Daniela