Determining x at ymax in the z-plot of an image stack

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

Determining x at ymax in the z-plot of an image stack

Bertram Becher
Hi group,

I've got a problem with extracting the slice number from that picture within a stack (256 images) at which the maximum intensity (in the Z-profile) is reached; or in other words:

a macro that gets the slice# n of that image where Y is at its maximum (max intensity of the Z-profile) and assign the slice# to a new gray tone (8-bit) of a resulting image.

Any suggestions?

Thank you in advance!

Bertram Becher



**********************************************************************************
Dr. rer. nat. Bertram Becher
Institut für Physiologie
Medizinische Fakultät der Ernst-Moritz-Arndt Universität Greifswald
Greifswalder Str. 11c
D-17495 Karlsburg (Germany)
Tel: 0049 (0)3834 / 8619335
E-mail: [hidden email],  [hidden email]
**********************************************************************************
______________________________________________________________________
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130
Reply | Threaded
Open this post in threaded view
|

Re: Determining x at ymax in the z-plot of an image stack

Geoff Nelson
I will be out of the office until 23 January 2006.
For Tech services related queries please contact Laurelly Millar.
For Biotechnology  related queries please contact Mark Conyngham

Kind Regards
Geoff
Reply | Threaded
Open this post in threaded view
|

Re: Determining x at ymax in the z-plot of an image stack

Wayne Rasband
In reply to this post by Bertram Becher
> I've got a problem with extracting the slice number from that  
> picture within a stack (256 images) at which the maximum intensity  
> (in the Z-profile) is reached; or in other words:
>
> a macro that gets the slice# n of that image where Y is at its  
> maximum (max intensity of the Z-profile) and assign the slice# to a  
> new gray tone (8-bit) of a resulting image.
>
> Any suggestions?

Here is macro that finds the slice in a stack that has the maximum  
mean intensity, and then it creates a new image filled with that  
intensity value. If there is a selection, the means are calculated  
only from the selection.

-wayne

   max = 0;
   slice = 0;
   if (nSlices==1)
       exit("Stack required");
   for (i=1; i<=nSlices; i++) {
       setSlice(i);
       getRawStatistics(nPixels, mean);
       if (mean>max) {
           max = mean;
           slice = i;
       }
   }
   print("slice=", slice, ", mean=", max);
   run("Select None");
   run("Duplicate...", "title=MaxMean");
   setColor(max);
   fill();