フィルターのクリア

Dicom open from multiple folders

3 ビュー (過去 30 日間)
ash fairy
ash fairy 2019 年 7 月 28 日
コメント済み: Walter Roberson 2019 年 7 月 28 日
can u help me with a code to open a folder with a subject name and its n number of subfolders to search for DICOM images? after it finds first subjects dicom file, then it has to go back to the next subject name and go to the subfolders and get dicominfo and go to all the subject list
this below code is'int workig
%%Define a starting folder.
rootdir = '\C:\Users\user\Desktop\dicom';
filelist = dir(fullfile(rootdir)); %get list of files and folders in any subfolder
%filelist = dir(fullfile(rootdir, '**\*.*'));
filelist = filelist(~[filelist.isdir]); %remove folders from list
  3 件のコメント
ash fairy
ash fairy 2019 年 7 月 28 日
this will read the dicom info and get me all files of dicom
% reading the dicom
info = dicominfo(filenames);
dicom = dicomread(filenames);
%%
% % Get all of the files
files = dir(fullfile(file, '*'));
filenames1 = cellfun(@(x)fullfile(file, x), {files.name}, 'uni', 0);
Walter Roberson
Walter Roberson 2019 年 7 月 28 日
No. dicominfo() can only produce information for one file at a time.
info_cell = cellfun(@dicominfo, filenames, 'uniform', 0);
data_cell = cellfun(@dicomread, filenames, 'uniform', 0);
I do not assume here that all of the images are the same size. If they are, then you can
data_array = cat(ndims(data_cell{1})+1, data_cell{:});

サインインしてコメントする。

回答 (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