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