Extracting Velocity from Color Doppler Image
조회 수: 11 (최근 30일)
이전 댓글 표시
How can I accurately extract velocities from a color Doppler image (the dicom header doesn't contain the velocity map)? I have an image with a color bar in the upper right of the image that gives the minimum and maximum velocities represented by colors in the image. I've been able to manually map the colors to velocities but am having difficulty accounting for aliasing.
댓글 수: 0
답변 (1개)
Fei Deng
2016년 9월 23일
Hi Vibhav,
I presume you have an image generated in other software and you want to read the value each/a certain point/pixel according to the color bar you have, which is part of the image and not a colorbar object.
You can do that in several steps:
1) Open the image in MATLAB; 2) Get the range of the velocity from the old color bar; 3) Add a real color bar; 4) Get the RGB value for a certain location on the figure, associate it with the real color bar, and compute value represented by this RGB value (color).
Following script is an example to give you an idea how to do that.
close all
clear all
x = linspace(0,3*pi,200);
y = cos(x) + rand(1,200);
c = linspace(1,10,length(x));
scatter(x,y,50,c,'filled')
colorbar
saveas(gcf,'test','tif')
close all
X = imread('test.tif');
imshow(X)
colorbar,
cmap = colormap;
% you have to know the min and max of you data
% get that from the original color bar you have in the upper right of the image;
mindata = 1;
maxdata = 10;
% take location [351,314] for example, here location is the pixel location
% you can also check the RGB of this point by placing mouse and single
% click it at the location on MATLAB figure (enable Data Cursor mode).
locX = 351; locY = 314;
rvalue = double(X(locY,locX,1));
gvalue = double(X(locY,locX,2));
bvalue = double(X(locY,locX,3));
rgbInBar = [rvalue,gvalue,bvalue]/255;
compare = (repmat(rgbInBar,length(cmap),1)-cmap);
comparetotal = sum(compare,2);
[valuediff,rowLoc] = min(abs(comparetotal));
currentPointValue = mindata+(maxdata-mindata)*rowLoc/length(cmap)
참고 항목
카테고리
Help Center 및 File Exchange에서 Detection, Range and Doppler Estimation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!