Program: gdcm
Module: $RCSfile: TestMakeDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/04/14 14:27:57 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2005/08/31 09:29:11 $
+ Version: $Revision: 1.9 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
dirName = GDCM_DATA_ROOT;
}
-
- gdcm::DicomDir *dcmdir;
- // we ask for Directory parsing
- // Old style (still available) :
- // dcmdir = new gdcm::DicomDir(dirName, true);
+ gdcm::DicomDir *dcmdir;
// new style (user is allowed no to load Sequences an/or Shadow Groups)
dcmdir = new gdcm::DicomDir( );
- dcmdir->SetParseDir(true);
- dcmdir->SetLoadMode(NO_SEQ | NO_SHADOW);
- dcmdir->Load(dirName);
+
+ // dcmdir->SetLoadMode(gdcm::LD_NOSEQ | gdcm::LD_NOSHADOW);
+ // some images have a wrong length for element 0x0000 of private groups
+ dcmdir->SetLoadMode(gdcm::LD_NOSEQ);
+ dcmdir->SetDirectoryName(dirName);
+ dcmdir->Load( );
- dcmdir->SetStartMethod(StartMethod, (void *) NULL);
+ dcmdir->SetStartMethod(StartMethod);
dcmdir->SetEndMethod(EndMethod);
if ( !dcmdir->GetFirstPatient() )
}
// Create the corresponding DicomDir
- dcmdir->WriteDicomDir("NewDICOMDIR");
+ dcmdir->Write("NewDICOMDIR");
delete dcmdir;
// Read from disc the just written DicomDir
- gdcm::DicomDir *newDicomDir = new gdcm::DicomDir("NewDICOMDIR");
+ gdcm::DicomDir *newDicomDir = new gdcm::DicomDir();
+ newDicomDir->SetFileName("NewDICOMDIR");
+ newDicomDir->Load();
+
if( !newDicomDir->IsReadable() )
{
std::cout<<" Written DicomDir 'NewDICOMDIR'"
}
std::cout<<std::flush;
-
delete newDicomDir;
return 0;
}