4D figure with a colormap

4 visualizzazioni (ultimi 30 giorni)
Ana Gabriela Guedes
Ana Gabriela Guedes il 31 Ott 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).

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su DICOM Format in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by