grayscale distrib. whole stack (tomograph)

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

grayscale distrib. whole stack (tomograph)

Alessandro Zivelonghi
Hello There,

I have a question as a beginner with imageJ/fiji.

Somebody knows how to :
- extract with imageJ/fiji the grayscale distribution of ALL the slices of a
stack (tomograph) and build up a xyz function, with xy assigned to the
grayscale distr. and z being the heigth of the specimen?


I know how to get the xy distrib. of a slice (adjust/threshold) but I don't
know how to export it in tabular form.
my 3D stack is 8 bit grayscale.

Many thanks,
bye!
Alex

--
=========================
Alessandro Zivelonghi

Max-Planck-Institut für Plasmaphysik
Materials Research Division

Boltzmannstr. 2, 85748 Garching b. München, Germany

http://www.ipp.mpg.de/eng/index.html

phone: +49-(0)89-3299-2201
===
Reply | Threaded
Open this post in threaded view
|

Re: grayscale distrib. whole stack (tomograph)

Daniel James White
Begin forwarded message:

>
> Date:    Tue, 22 Feb 2011 15:22:59 +0100
> From:    Alessandro Zivelonghi <[hidden email]>
> Subject: grayscale distrib. whole stack (tomograph)
>
> Hello There,
>
> I have a question as a beginner with imageJ/fiji.
>
> Somebody knows how to :
> - extract with imageJ/fiji the grayscale distribution of ALL the slices of a
> stack (tomograph) and build up a xyz function, with xy assigned to the
> grayscale distr. and z being the heigth of the specimen?
>
>
> I know how to get the xy distrib. of a slice (adjust/threshold) but I don't
> know how to export it in tabular form.
> my 3D stack is 8 bit grayscale.

try putting this jython script into the fiji script editor and running it.
(select language python / jython

# Time_Series_Histogram.py
# this script makes the histogram for each frame of a movie
# and as it goes adds (concatenates) each one into a single movie stack

# Dan White and Silke Gerwig MPI-CBG
# Aug 2009-2011

#!/usr/bin/env python

from ij import IJ, ImagePlus
# the current image
imp = IJ.getImage()
stack = imp.getStack()

# for all the frames in the movie, run  histogram
for i in range(1, imp.getNSlices() + 1):  # remember a python range (1, 10) is the numbers 1 to 9!
#getNSlices not getNFrames since input data is a 3D stack not a time series stack.
  slice = ImagePlus(str(i), stack.getProcessor(i))
  # Execute plugin exactly on this slice i
  IJ.run(slice, "Histogram", "slice")
  # concatenate the new histogram onto the end of the histogram stack we want in the end, but not if its then 1st one!

  if i == 1:
    pass
  else:
    IJ.run("Concatenate...", "stack1=[Histogram of 1] stack2=[Histogram of " + str(i) + "] title=[Histogram of 1]")

IJ.log("Done!")
>
> Many thanks,
> bye!
> Alex

Dr. Daniel James White BSc. (Hons.) PhD
Senior Microscopist / Image Visualisation, Processing and Analysis
Light Microscopy and Image Processing Facilities
Max Planck Institute of Molecular Cell Biology and Genetics
Pfotenhauerstrasse 108
01307 DRESDEN
Germany

+49 (0)15114966933 (German Mobile)
+49 (0)351 210 2627 (Work phone at MPI-CBG)
+49 (0)351 210 1078 (Fax MPI-CBG LMF)

http://www.bioimagexd.net  BioImageXD
http://pacific.mpi-cbg.de                Fiji -  is just ImageJ (Batteries Included)
http://www.chalkie.org.uk                Dan's Homepages
https://ifn.mpi-cbg.de  Dresden Imaging Facility Network
dan (at) chalkie.org.uk
( white (at) mpi-cbg.de )
Reply | Threaded
Open this post in threaded view
|

Re: grayscale distrib. whole stack (tomograph)

Alessandro Zivelonghi
thanks!

1. do you know how to export the histogram-stack in tabular form xyz?
2. how to modify the code to get histogram on a round selection of the
orginal stack?

many thanks again,
regards
Alex

On 23 February 2011 09:24, Daniel James White <[hidden email]> wrote:

>
>
> Begin forwarded message:
>
> >
> > Date:    Tue, 22 Feb 2011 15:22:59 +0100
> > From:    Alessandro Zivelonghi <[hidden email]>
> > Subject: grayscale distrib. whole stack (tomograph)
> >
> > Hello There,
> >
> > I have a question as a beginner with imageJ/fiji.
> >
> > Somebody knows how to :
> > - extract with imageJ/fiji the grayscale distribution of ALL the slices
> of a
> > stack (tomograph) and build up a xyz function, with xy assigned to the
> > grayscale distr. and z being the heigth of the specimen?
> >
> >
> > I know how to get the xy distrib. of a slice (adjust/threshold) but I
> don't
> > know how to export it in tabular form.
> > my 3D stack is 8 bit grayscale.
>
> try putting this jython script into the fiji script editor and running it.
> (select language python / jython
>
> # Time_Series_Histogram.py
> # this script makes the histogram for each frame of a movie
> # and as it goes adds (concatenates) each one into a single movie stack
>
> # Dan White and Silke Gerwig MPI-CBG
> # Aug 2009-2011
>
> #!/usr/bin/env python
>
> from ij import IJ, ImagePlus
> # the current image
> imp = IJ.getImage()
> stack = imp.getStack()
>
> # for all the frames in the movie, run  histogram
> for i in range(1, imp.getNSlices() + 1):  # remember a python range (1, 10)
> is the numbers 1 to 9!
> #getNSlices not getNFrames since input data is a 3D stack not a time series
> stack.
>  slice = ImagePlus(str(i), stack.getProcessor(i))
>  # Execute plugin exactly on this slice i
>  IJ.run(slice, "Histogram", "slice")
>  # concatenate the new histogram onto the end of the histogram stack we
> want in the end, but not if its then 1st one!
>
>  if i == 1:
>    pass
>  else:
>    IJ.run("Concatenate...", "stack1=[Histogram of 1] stack2=[Histogram of "
> + str(i) + "] title=[Histogram of 1]")
>
> IJ.log("Done!")
> >
> > Many thanks,
> > bye!
> > Alex
>
> Dr. Daniel James White BSc. (Hons.) PhD
> Senior Microscopist / Image Visualisation, Processing and Analysis
> Light Microscopy and Image Processing Facilities
> Max Planck Institute of Molecular Cell Biology and Genetics
> Pfotenhauerstrasse 108
> 01307 DRESDEN
> Germany
>
> +49 (0)15114966933 (German Mobile)
> +49 (0)351 210 2627 (Work phone at MPI-CBG)
> +49 (0)351 210 1078 (Fax MPI-CBG LMF)
>
> http://www.bioimagexd.net       BioImageXD
> http://pacific.mpi-cbg.de               Fiji -  is just ImageJ (Batteries
> Included)
> http://www.chalkie.org.uk               Dan's Homepages
> https://ifn.mpi-cbg.de                  Dresden Imaging Facility Network
> dan (at) chalkie.org.uk
> ( white (at) mpi-cbg.de )
>
>
>
>
>
>
>
>
>
>
>
>


--
=========================
Alessandro Zivelonghi

Max-Planck-Institut für Plasmaphysik
Materials Research Division

Boltzmannstr. 2, 85748 Garching b. München, Germany

http://www.ipp.mpg.de/eng/index.html

phone: +49-(0)89-3299-2201
===