+ delete dcmdir;
+
+ // Read from disc the just written DicomDir
+ gdcm::DicomDir *newDicomDir = new gdcm::DicomDir("NewDICOMDIR");
+ if( !newDicomDir->IsReadable() )
+ {
+ std::cout<<" Written DicomDir 'NewDICOMDIR'"
+ <<" is not readable"<<std::endl
+ <<" ...Failed"<<std::endl;
+
+ delete newDicomDir;
+ return 1;
+ }
+
+ if( !newDicomDir->GetFirstPatient() )
+ {
+ std::cout<<" Written DicomDir 'NewDICOMDIR'"
+ <<" has no patient"<<std::endl
+ <<" ...Failed"<<std::endl;
+
+ delete newDicomDir;
+ return(1);
+ }
+