reading series of DICOM images on MATLAB

3 views (last 30 days)
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 Comments
saarthak agarwal
saarthak agarwal on 9 Oct 2020
Could you please provide the code for displaying multiple dicom files on MATLAB?
Walter Roberson
Walter Roberson on 10 Oct 2020
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)

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 5 Jan 2012
Use subplot() or see the montage() function.
  6 Comments
Walter Roberson
Walter Roberson on 5 Jan 2012
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.

Sign in to comment.

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!