在Matlab中获取MRI像素点的像素位置

时间:2014-01-03 21:28:02

标签: image matlab pixel

我可以在图中显示来自MRI的数据。我使用了来源:

load mri
figure('Colormap',map)
load DCE_sec05_inp.mat
image(data2{1,1}) %i get 128*96 pixel picture
axis image

但是当我点击图中的像素时,我无法找到解决如何将像素位置设置为工作空间的问题。我找到了这段代码:

I = imread('cameraman.tif');  %read the image in I
imshow(I);                    %display I
[c,r,P] = impixel(I)

但我无法将mri数据显示为imshow模式。 谢谢你的帮助

2 个答案:

答案 0 :(得分:0)

您不一定需要imshow,请尝试:

image(data2{1,1}) %i get 128*96 pixel picture
axis image
[u v]=getpts;

您点击的点的坐标将存储在uv中。

答案 1 :(得分:0)

您正在阅读的图片或数据类型为mapmri),其格式不一定为RGBcameraman)。要使用imshow显示图像,您需要将地图数据作为第二个参数。例如,可以使用以下语法显示mri数据中的第一个图像:

load mri
imshow(D(:,:,:,1), map)  %map is provided the mri.dat

使用imshow后,您可以像您提供的示例一样使用impixel