4D figure with a colormap

5 ビュー (過去 30 日間)
Ana Gabriela Guedes
Ana Gabriela Guedes 2021 年 10 月 31 日
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 Center および File ExchangeDICOM Format についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by