Reading from CD

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
rickf
Posts: 16
Joined: Wed, 2014-01-08, 16:20

Reading from CD

#1 Post by rickf »

I've just started working with DCMTK. I have data sets that are on read only media, some with DICOMDIR, some without. Is there a way to leverage the DicomdirInterface class to read the files on the CD that do not have a DICOMDIR and create the proper hierarchy? Also, some of the data sets have names witch .dcm. I can't rename these files so am I out of luck and have to build the patient study series hierarchy myself?

Thanks

Rick

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Reading from CD

#2 Post by J. Riesmeier »

Is there a way to leverage the DicomdirInterface class to read the files on the CD that do not have a DICOMDIR and create the proper hierarchy?
Sure, the purpose of the DicomDirInterface is to create a DICOMDIR from given DICOM files.
Also, some of the data sets have names witch .dcm. I can't rename these files so am I out of luck and have to build the patient study series hierarchy myself?
You cannot add DICOM files with file extension to a DICOMDIR, and this is also what the DCMTK implements/checks. If you really need that, you should add a new option/mode to the DicomDirInterface class (similar to the "MapFilenamesMode").

rickf
Posts: 16
Joined: Wed, 2014-01-08, 16:20

Re: Reading from CD

#3 Post by rickf »

It seems that the DICOMDIR file needs to be at the root level of the directory hierarchy? In the case of the CD, in other words a read-only medium do I have to copy the files from CD to a local storage in order to create the DICOMDIR information or can that be kept in memory and never written to disk?

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Reading from CD

#4 Post by J. Riesmeier »

It seems that the DICOMDIR file needs to be at the root level of the directory hierarchy?
Correct.
In the case of the CD, in other words a read-only medium do I have to copy the files from CD to a local storage in order to create the DICOMDIR information or can that be kept in memory and never written to disk?
The DICOMDIR cannot be created in memory since it stores internal references of the hierarchy as byte offsets (within the file).

Also please note that the references to DICOM files within the DICOMDIR (so-called "Referenced File ID") are regarded as relative paths based on the location of the DICOMDIR (which is identical to the root directory as you already noted).

rickf
Posts: 16
Joined: Wed, 2014-01-08, 16:20

Re: Reading from CD

#5 Post by rickf »

Ok, so then I think that to read a CD that does not already contain a DICOMDIR I have to loop through all the files, read tags, and build my own hierarchy patient-study-series-image etc

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest