Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/02/11 16:55:39 $
- Version: $Revision: 1.132 $
+ Date: $Date: 2005/03/09 19:29:38 $
+ Version: $Revision: 1.136 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// ----------------------------------------------------------------------------
//
// Dicom PS 3.3 describes the relationship between Directory Records, as follow
+// (see also PS 4.3, 2004, page 50 for Entity-Relationship model)
//
// Directory Record Type Directory Record Types which may be included
// in the next lower-level directory Entity
gdcmWarningMacro( "Parse directory and create the DicomDir");
ParseDirectory();
}
+ /*
else
{
// user may just call ParseDirectory() *after* constructor
}
+ */
}
// Only if user passed a DICOMDIR
// ------------------------------
return true;
}
+/**
+ * \brief Anonymize a DICOMDIR
+ * @return true
+ */
+
+bool DicomDir::AnonymizeDicomDir()
+{
+ ValEntry *v;
+ // Something clever to be found to forge the Patient names
+ std::ostringstream s;
+ int i = 1;
+ for(ListDicomDirPatient::iterator cc = Patients.begin();
+ cc!= Patients.end();
+ ++cc)
+ {
+ s << i;
+ v = (*cc)->GetValEntry(0x0010, 0x0010) ; // Patient's Name
+ if (v)
+ {
+ v->SetValue(s.str());
+ }
+
+ v = (*cc)->GetValEntry(0x0010, 0x0020) ; // Patient ID
+ if (v)
+ {
+ v->SetValue(" ");
+ }
+
+ v = (*cc)->GetValEntry(0x0010, 0x0030) ; // Patient's BirthDate
+ if (v)
+ {
+ v->SetValue(" ");
+ }
+ s << "";
+ i++;
+ }
+ return true;
+}
//-----------------------------------------------------------------------------
// Protected
/**
}
else
{
- gdcmWarningMacro( "Not a ValEntry.");
+ gdcmWarningMacro( "(0004,1430) not a ValEntry ?!?");
continue;
}
|| first )
{
SetElement(path, GDCM_DICOMDIR_SERIE, *it);
- first = true;
}
// Always Deal with 'IMAGE' Elements