applying dicomrename to multiple files

I have been attempting to use dicomrename source: http://www.mathworks.com/matlabcentral/fileexchange/22818-dicomrename/content/dicomrename.m to rename dicom files with various header tags. It works for multiple files, if I list them each independently. But I need to apply this renaming process to every file in a directory, with the .dcm suffix. There are just too many to list in an array.
I think I need to modify the source, its written as "FILES should be a cell array of filenames."
help?

 Accepted Answer

Why not just use:
mydcmfiles = dir('*.dcm');
To create a structur containing the names of all of the files?

1 Comment

shaleen
shaleen on 10 Aug 2012
Edited: shaleen on 13 Aug 2012
thank you for the clue, i successfully created the structure and then used the structure to create the cell
fpath = 'c:\test\'; %identify path;
fstruct = dir('c:\test\*.dcm'); % acquire selected file data;
fnames = {fstruct.name}; % Create a cell array of file names;
dicomrename(fpath, fnames); %execute dicomerename;
thank you

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!