histogram of 3D intensity image and normalize the intensity by linearly fitting the histogram to the ICBM-152

11 次查看(过去 30 天)
Hi,everyone
I have a 3D (256*124*256) intensity medical image(*.hdr/*.img)(I will call it image A later),and the standarded 3D intensity image named ICBM-152(197*233*189)(image B). first,I want to obtain histigram of these two 3D image.imhist doesn't work on 3D image. second,like the function histeq(f,hspec),I want to match the histogram of image A with that of image B. Wish you can help me,it is important for me. THANKS!

回答(4 个)

Image Analyst
Image Analyst 2013-6-2
There is a imhistmatch() function in newer versions of MATLAB:
imhistmatch
Adjust histogram of image to match N-bin histogram ofreference image
Syntax
B = imhistmatch(A,Ref) example
B = imhistmatch(A,Ref,N) example
[B,hgram]= imhistmatch(___) example
Description
example
B = imhistmatch(A,Ref) image A istransformed so that the histogram of the returned image B approximatelymatches the histogram of reference image Ref builtwith 64 (default value) equally spaced histogram bins. The returnedimage B will have no more than 64 discrete levels.
Images A and Ref canbe any of the permissible data types.
If both A and Ref aretruecolor RGB images, then each color channel of A ismatched independently to the corresponding color channel of Ref.
If A is a truecolor RGB imageand Ref is a grayscale image, then each channelof A is matched against the single histogramderived from Ref.
If A is a grayscale image, then Ref mustalso be a grayscale image.
Images A and Ref neednot be equal in size.
If you want a more accurate version, then you'll have to use the histogram shaping application in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/28972-custom-shaped-histogram

Shaode Yu
Shaode Yu 2019-5-7
Please check this function. It performs well on 3D images.

Iman Ansari
Iman Ansari 2013-6-2
A=uint8(randi(256,256,124,256)-1);
H1=imhist(A(:));
% Or
%H2=histc(A(:),0:255);
B=imread('cameraman.tif');
B=repmat(B(:,1:124),[1 1 256]);
C=imhistmatch(A,B,256);
subplot(131)
imhist(A(:))
subplot(132)
imhist(B(:))
subplot(133)
imhist(C(:))
  1 个评论
Iman Ansari
Iman Ansari 2013-6-2
A=uint8(randi(256,256,124,256)-1);
H1=imhist(A(:));
% Or
%H1=histc(A(:),0:255);
B=imread('cameraman.tif');
B=repmat(B(1:197,1:233),[1 1 189]);
H2=imhist(B(:));
C=histeq(A(:),H2);
C=reshape(C,size(A));
subplot(131)
imhist(A(:))
subplot(132)
imhist(B(:))
subplot(133)
imhist(C(:))

请先登录,再进行评论。


Makrim
Makrim 2015-5-14
How about running trough the cubic image A and B, slice by slice. I mean why don't your first register one image (dimension 2) from A to an image from the atlas B, and then compute the histogram of both with no trouble.

类别

Help CenterFile Exchange 中查找有关 Histograms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by