hello sir, i tried to display images on matlab and i get succeeded in that.. but i am stuck up in to display 4 images in quadrangle format .. please help me .. Thanks in advance!!

댓글 수: 2

Could you please provide the code for displaying multiple dicom files on MATLAB?
projectdir = 'Directory/of/dicom/files/';
dinfo = dir( fullfile(projectdir, '*.dcm') );
filenames = fullfile(projectdir, {dinfo.name});
nfiles = length(filenames);
images = cell(nfiles,1);
for K = 1 : nfiles
images{K} = dicomread(filenames{K});
end
montage(images)

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2012년 1월 5일

0 개 추천

Use subplot() or see the montage() function.

댓글 수: 6

REHANA M.B
REHANA M.B 2012년 1월 5일
for example i have 4 images in one file for this
montage( filename,'size',[2,2]);
in this please tell me what i have to write in place of filename and size in my code??????
REHANA M.B
REHANA M.B 2012년 1월 5일
reply me..
Walter Roberson
Walter Roberson 2012년 1월 5일
montage() is best for the case where the images are in separate files. For example,
montage({'img1.jpg','img2.jpg','img3.jpg','img4.jpg'}, 'Size', [2 2])
If the images are in memory then you would use subplot() or you would use image() _carefully_.
If you have a single file that has all four images stored in it, then what kind of file is it?
REHANA M.B
REHANA M.B 2012년 1월 5일
those are in one folder which is on the desktop.. for that we need to give folder name or path name????
REHANA M.B
REHANA M.B 2012년 1월 5일
how to read those??
Walter Roberson
Walter Roberson 2012년 1월 5일
If you are using montage(), you could cd() to the directory the images are in and then use the basic file names like I show above. Or instead of cd()'ing to there, you could use an absolute path for each of the file names.
You cannot, however, pass montage() a pathname and a series of file names that are intended to be relative to that path: only directory-relative files names or absolute file names.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

질문:

2012년 1월 5일

댓글:

2020년 10월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by