map of files and folders

77 views
Skip to first unread message

Paul Voicu

unread,
Feb 16, 2014, 3:55:42 PM2/16/14
to fo-d...@googlegroups.com
Hello,

Is there any way to get the relative path of all dicom files parsing the dicomdir ?

Matias

unread,
Feb 26, 2014, 8:54:17 AM2/26/14
to fo-d...@googlegroups.com
I think you can use this tag:
DicomTag.ReferencedFileID
It will return the file name but not sure if it will return the full path..

Colby Dillion

unread,
Feb 26, 2014, 11:15:58 AM2/26/14
to fo-d...@googlegroups.com
I usually use code like the following:

// file name relative to DICOMDIR base path
var file = image.Get<string>(DicomTag.ReferencedFileID, -1);

// some DICOMDIR files add \ char to beginning of path
file = file.TrimStart(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);

// combine base DICOMDIR path with relative path
file = Path.Combine(path, file);

// just to make sure we have complete path
file = Path.GetFullPath(file);


Reply all
Reply to author
Forward
0 new messages