I run some code with Profiler, the code deals with DICOM files, and the dicom...
functions in Matlab.
In the main window of the Profiler, I see that dicominfo>parseSequence
takes almost all of the running time. Inside this inner function, it seems like that:
You can see here that dicominfo>parseSequence
takes total of 241.488 seconds (in the title), and inside it there is a function called dicominfo>processMetadata
, that takes 240.801 seconds, 99.7% from the time.
But, when I click it to see its contents, it says that the processMetadata
takes only 50.391 seconds! :
How can it be...? Where all my time goes...?
EDIT
I really think that this is a Profiler issue, but for @Tokkot ask, I attach the piece of code that I profiled:
cd ([Fname '\' seq(m).name]);
files=dir; % Names of all files in current sequence
for n=4:length(files)
info=dicominfo([pwd '\' files(n).name]);
info.PatientName=PatientName; % convert the field Name to initials
info.PatientID=''; % delete ID
[X,~]=dicomread([pwd '\' files(n).name]);
dicomwrite(X, sprintf('anon%s', files(n).name), info, 'createmode', 'copy');
delete([pwd '\' files(n).name]);
end