Post by Vijay SubramaniamHi,
Can anyone tell me the easiest way to read the contents of DICOMDIR
using dcmtk. The class DicomDirInterface only talks about creating a
DICOMDIR. Specifically this is what I need to do -
I need to read the patient names and dates of a DICOM DVD
having images, using dcmtk
If anyone can help it would be great.
Thanks.
Vijay
Hi Vijay,
Well I am also trying to do the same & as u said the
DicomDirInterface class only talks about creating one... I have
already posted a query about that here, but haven't got a response
that fixed my query...
http://groups.google.com/groups?hl=en&lr=&threadm=78b6f41.0410072356.31521608%40posting.google.com&prev=/groups%3Fgroup%3Dcomp.protocols.dicom%26hl%3Den
I looked up in the code for that class & I can see the functions
createNewDicomDir() & appendToDicomDir() which take a filename as
input & the commnets says that something about "DICOMDIR file" but it
isn't clear if they read in a dicomdir file & create a root-node
structure ( say like in XML DOM structure)
But before that I am still struggling to make a sample app that
uses DCMTK & have posted a query about that too here...
http://groups.google.com/groups?hl=en&lr=&threadm=78b6f41.0410080002.26570ec1%40posting.google.com&prev=/groups%3Fgroup%3Dcomp.protocols.dicom%26hl%3Den
the code sample I am using in my sample project is this...
=== CUT ===
The following example shows how to create a general purpose DICOMDIR
from multiple files:
DicomDirInterface dicomdir;
OFCondition status = dicomdir.createNewDicomDir();
if (status.good())
{
while ( /* there are files */ )
dicomdir.addDicomFile( /* current filename */ );
status = dicomdir.writeDicomDir();
if (status.bad())
cerr << "Error: cannot write DICOMDIR (" << status.text() << ")"
<<
endl;
} else
cerr << "Error: cannot create DICOMDIR (" << status.text() << ")"
<<
endl;
=== CUT ===
I get linker errors when I try to use DCMTK as specified above &
the errors are in the link... So I made a almost perfect copy of
DCMTK's sample apps in my own MFC project & the same linker erros keep
reoccuring... I think there are some project settings that need to be
tweaked & I have no idea even after reading the INSTALL, README files
of DCMPTK... So after spending a few days trying to mimic the sample
apps that come with DCMTK, I have given up(untill I get some other
clues) & I am now trying to work with the vtkDicomImageReader class
that comes with another toolkit... But that class doesn't do the
network support present in DCMTK... if u don't want network support(
its not a priority for me too) then u could check that out...
Meanwhile if u have managed to use DCMTK in a sample app( is it in
MFC), can u reply in my thread on how u did it, cause whatever I do I
keep getting linker errors...
Cheers,
Michael