4D figure with a colormap

5 Ansichten (letzte 30 Tage)
Ana Gabriela Guedes
Ana Gabriela Guedes am 31 Okt. 2021
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).

Akzeptierte Antwort

DGM
DGM am 1 Nov. 2021
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 Kommentar
Ana Gabriela Guedes
Ana Gabriela Guedes am 1 Nov. 2021
Yes it was precisely that!! Thank you a lot! :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu DICOM Format finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by