How to plot the histogram of a volume using imhist?

4 views (last 30 days)
I have array of TIFF images. I have stacked them to make a volume. How can I plot the histogram of the volume in MATLAB? The function "imhist" expects its input to be two-dimensional.
I have also tried to plot the histogram of individual TIFFs and consolidate, but in vain.
Here is the code I tried to consolidate the histograms:
counter = 0;
for i = 1:numel(image_files)
[count, x] = imhist(vol(:,:,i));
counter = count + counter
end;
Is/are there any other ways I could plot the histogram of a volume in MATLAB?

Accepted Answer

Sean de Wolski
Sean de Wolski on 12 Jul 2011
So you want to see the histogram as a surface plot? There are a couple of tools for this on the fex. Or do you want a 2-d histogram?
If 2d:
hist(V(:)); %convert V to column vector
if 3d: call histc on each slice and record values in each row of a new matrix. surf it.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!