Subscripted Assignment between dissimilar structures when reading DICOM

2 ビュー (過去 30 日間)
Adam
Adam 2012 年 8 月 21 日
Hi all, I'm using the dicominfo function to read the DICOM headers from a series of DICOM files. I am going through each successive file and storing the header in info(x):
for x = 1:nFiles
info(x) = dicominfo([pathname,Directory(x,1).name]);
SliceLocation(x) = info(x).SliceLocation;
TimeIndex(x) = info(x).InstanceNumber;
end
The problem I'm running into is that for whatever reason, some of the DICOM files contain an extra header. When the loop runs into the file with the extra header I get the "Subscripted assignment between dissimilar structures" error. This is troublesome, especially since I don't even need the information in the extra header. I'm only using a few of the header fields. I got around this by checking to see if that field exists and then passing it to another array, but doing this check significantly slows down the code since I have 1000+ images. Can anyone think of a way to deal with this without slowing down the code?

回答 (1 件)

Jan
Jan 2012 年 8 月 22 日
You can remove the additional field using the fast FEX: fRMField.
for x = nFiles:-1:1 % backwards for pre-allocation
data = dicominfo([pathname,Directory(x,1).name]);
data = fRMField(data, 'UnwantedField');
info(x) = data;
SliceLocation(x) = data.SliceLocation;
TimeIndex(x) = data.InstanceNumber;
end

カテゴリ

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