4D figure with a colormap

조회 수: 2 (최근 30일)
Ana Gabriela Guedes
Ana Gabriela Guedes 2021년 10월 31일
댓글: Ana Gabriela Guedes 2021년 11월 1일
Hi!
I have an exercise where I have a certain dicom collection input and from there I have to get only 1 of the series (corresponding to the ones that have 'US' as a Modality in the table) and do the following:
  • read the series data with the color map
  • display in 1 figure the montage of the series with the color map
Can someone please help me in how should I do this?
The begin of the code will be something like this: (my problem is that I get an 4-D uint8 type of variable and I cannot show it as a regular image)
dir = fullfile( matlabroot, 'toolbox/images/imdata'); %Directory from where I get the dicom Collectuon
infoTable = dicomCollection(dir);
disp(infoTable)
T2 = strcmp(infoTable.Modality,'US'); %Finds the series with the Modality equal to ’US’
series = infoTable(T2,:); %Series with the modality equal to 'US'
fileName = series.Filenames; %Cell array with the file name
fName = fileName{1,1}; %String with the file name
I2 = dicomread(fName);
Thank you a lot in advance, this is the only information I have (I'm not even telled to use a specific colormap).

채택된 답변

DGM
DGM 2021년 11월 1일
Well, dicomCollection() won't run in-browser, but see if this is what you're after:
dir = fullfile( matlabroot, 'toolbox/images/imdata'); %Directory from where I get the dicom Collectuon
infoTable = dicomCollection(dir);
disp(infoTable)
T2 = strcmp(infoTable.Modality,'US'); %Finds the series with the Modality equal to ’US’
series = infoTable(T2,:); %Series with the modality equal to 'US'
fileName = series.Filenames; %Cell array with the file name
fName = fileName{1,1}; %String with the file name
[I2 map] = dicomread(fName);
montage(I2,map,'size',[5 2])
  댓글 수: 1
Ana Gabriela Guedes
Ana Gabriela Guedes 2021년 11월 1일
Yes it was precisely that!! Thank you a lot! :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 DICOM Format에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by