Posted by
Daniel James White on
Feb 23, 2011; 8:24am
URL: http://imagej.273.s1.nabble.com/grayscale-distrib-whole-stack-tomograph-tp3685571p3685572.html
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 )