I tried to display a X-Ray image .. and it successfully working. the code is below..
Y = dicomread('C:\Users\Rehana\Desktop\dicom\test.DCM');
imshow(Y);
imcontrast;
but getting error in the below code, here i am trynig to display multiple images on a single frame .. please help me..
load dicom
[X2,map2] = imread('C:\Program Files\MATLAB\images\'test'*.DCM');
subplot(1,2,1), subimage(X,map)
subplot(1,2,2), subimage(X2,map2)
in this case 'images' is one folder where i stored test1.DCM, test2.DCM,test3.DCM,test4.DCM ( samples of x-ray images )files.

1 件のコメント

Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 10 日
What is the error message?

サインインしてコメントする。

 採用された回答

Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 10 日

0 投票

Hi,
It seem you tried to display multiple dicom files in a folder but you use wrong syntax.
And please don't use imread to read dicom file. Use dicomread instead.
Assume that I have 4 dicom files in folder named 'New Folder'.
files = dir(fullfile(pwd,'New Folder\*.dcm'));
for i = 1 : numel(files)
[X map] = dicomread(fullfile(pwd,'New Folder',files(i).name));
if ~isempty(map)
subplot(2,2,i);
subimage(X,map);
else
subplot(2,2,i);
imshow(X,[]);
end
end

13 件のコメント

REHANA M.B
REHANA M.B 2012 年 1 月 11 日
Thanks Mr.Chandra.. I have seen your Youtube videos on Matlab, Helped a lot thank you.
I tried your code my code is like this
files = fullfile('C:', 'Program Files','MATLAB','images\*.DCM');
for i = 1 : numel(files)
[X, map] = dicomread(fullfile('C:','images',files(i).DCM));
if ~isempty(map)
subplot(2,2,i);
subimage(X,map);
else
subplot(2,2,i);
imshow(X, map);
end
end
In this code The function dicomread() is giving the error.. help this thanks for advance
REHANA M.B
REHANA M.B 2012 年 1 月 11 日
The error is
??? Improper index matrix reference.
Error in ==> Untitled3 at 3
[X, map] = dicomread(fullfile('C:','images',files(i).DCM));
Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 11 日
Please try my code below :
files = dir(fullfile('C:','Program Files','MATLAB','images\*.dcm'));
for i = 1 : numel(files)
[X, map] = dicomread(fullfile('C:','Program Files','MATLAB','images',files(i).name));
if ~isempty(map)
subplot(2,2,i);
subimage(X,map);
else
subplot(2,2,i);
imshow(X, map);
end
end
Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 11 日
If your file extention was DCM then you can change them yourself.
REHANA M.B
REHANA M.B 2012 年 1 月 11 日
Actually it didnt have extension after downloading.. so i renamed it.
Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 11 日
I recommend you to use a DCM file in good condition.
Renaming the file does not guarantee and too risky.
REHANA M.B
REHANA M.B 2012 年 1 月 11 日
its working .. Thanks Mr.Chandra..
Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 11 日
glad to help you :)
REHANA M.B
REHANA M.B 2012 年 1 月 11 日
See i have some plan to display it in other way..
like ..on a single frame, assume we have already displayed ( left side of the frame ) some sets 2 or 3 sets of image files which contains 4 images each. and right side of the image selected image sets should be display by clicking on left side image sets..
can it possible?????
Chandra Kurniawan
Chandra Kurniawan 2012 年 1 月 11 日
So, by using mouse click?
I think it's hard to do.
I do not know if anyone else can probably do this with some trick.
REHANA M.B
REHANA M.B 2012 年 1 月 11 日
ya mouse click..
with building GUI we can do know??
REHANA M.B
REHANA M.B 2012 年 1 月 11 日
Mr.Chandra do you know any text books or any references, sites for learning displaying images in different ways on matlab?? (image processing on matlab).
let me know please..
i hit google for that but unable to get a good one.
REHANA M.B
REHANA M.B 2012 年 1 月 16 日
Hey please tell me how do i display it on GUI with pushbutton??

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 1 月 10 日

0 投票

Instead of posting another copy of your question, answer the query put to you in your existing copy.
Your duplicate copy has been deleted.

カテゴリ

ヘルプ センター および File Exchange で DICOM Format についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by