|
Note to dicom function users (and authors?)
I recommend the following modification to dicominfo code
go to the function getItemNames on line 554 of dicominfo,
and replace it with the following code:
%%%%%%%%% start snipping:
function itemNames = getItemNames(numberOfItems)
% Create a cell array of item names, which can be quickly used.
persistent namesCell maxItemsPreStored
if (isempty(namesCell))
maxItemsPreStored = 300;
namesCell = cell(1, maxItemsPreStored);
for idx = 1:maxItemsPreStored
namesCell{idx} = sprintf('Item_%d', idx);
end
end
% Return the first n item names.
if numberOfItems <= maxItemsPreStored
itemNames = namesCell(1:numberOfItems);
else % slow but necessary fallback
itemNames = cell(1, numberOfItems);
for idx = 1:numberOfItems
itemNames{idx} = sprintf('Item_%d', idx);
end
end
%%%%%%%%% snip end
the original code lacks a fallback for the case of more than 300
items - which is not too rare, e.g. in DICOMDIR files.
Ofek
|