From: jpr Date: Mon, 26 Mar 2007 13:32:54 +0000 (+0000) Subject: Add class DicomDirPrivate, for dealing with SERIE/PRIVATE X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=46590a1960c6ff290e5a6404ca8a7c70cb9349bb;p=gdcm.git Add class DicomDirPrivate, for dealing with SERIE/PRIVATE (mainly used, rigth now, for SIEMENS 'CSA non image') --- diff --git a/src/gdcmDicomDirPrivate.cxx b/src/gdcmDicomDirPrivate.cxx new file mode 100755 index 00000000..ae7305da --- /dev/null +++ b/src/gdcmDicomDirPrivate.cxx @@ -0,0 +1,86 @@ +/*========================================================================= + + Program: gdcm + Module: $RCSfile: gdcmDicomDirPrivate.cxx,v $ + Language: C++ + Date: $Date: 2007/03/26 13:32:54 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#include "gdcmDicomDirPrivate.h" +#include "gdcmGlobal.h" +#include "gdcmDataEntry.h" + +namespace gdcm +{ +//----------------------------------------------------------------------------- +// Constructor / Destructor +/** + * \brief Constructor + * \note End user must use : DicomDirSerie::NewPrivate() + */ +DicomDirPrivate::DicomDirPrivate(bool empty): + DicomDirObject() +{ + if ( !empty ) + { + ListDicomDirPrivateElem const &elemList = + Global::GetDicomDirElements()->GetDicomDirPrivateElements(); + FillObject(elemList); + } +} + +/** + * \brief Canonical destructor. + */ +DicomDirPrivate::~DicomDirPrivate() +{ +} + +//----------------------------------------------------------------------------- +// Public + +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + +//----------------------------------------------------------------------------- +// Print +/** + * \brief Prints the Object + * @param os ostream to write to + * @param indent Indentation string to be prepended during printing + * @return + */ +void DicomDirPrivate::Print(std::ostream &os, std::string const & ) +{ + os << "PRIVATE : "; + for(ListDocEntry::iterator i = DocEntries.begin(); + i!= DocEntries.end(); + ++i) + { + if ( (*i)->GetGroup() == 0x0004 && (*i)->GetElement() == 0x1500 ) + { + if( dynamic_cast(*i) ) + os << (dynamic_cast(*i))->GetString(); + } + } + os << std::endl; + + DicomDirObject::Print(os); +} + +//----------------------------------------------------------------------------- +} // end namespace gdcm + diff --git a/src/gdcmDicomDirPrivate.h b/src/gdcmDicomDirPrivate.h new file mode 100755 index 00000000..11f57a45 --- /dev/null +++ b/src/gdcmDicomDirPrivate.h @@ -0,0 +1,48 @@ +/*========================================================================= + + Program: gdcm + Module: $RCSfile: gdcmDicomDirPrivate.h,v $ + Language: C++ + Date: $Date: 2007/03/26 13:32:54 $ + Version: $Revision: 1.1 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#ifndef GDCMDICOMDIRPRIVATE_H +#define GDCMDICOMDIRPRIVATE_H + +#include "gdcmDicomDirObject.h" + +namespace gdcm +{ + +/** + * \brief describes a PRIVATE within a within a SERIE + * (DicomDirSerie) of a given DICOMDIR (DicomDir) + */ +class GDCM_EXPORT DicomDirPrivate : public DicomDirObject +{ + gdcmTypeMacro(DicomDirPrivate); + +public: +/// \brief Constructs a DicomDirPrivate with a RefCounter + static DicomDirPrivate *New(bool empty=false) {return new DicomDirPrivate(empty);} + + void Print( std::ostream &os = std::cout, std::string const &indent = "" ); + // void WriteContent( std::ofstream *fp, FileType t ); + +protected: + DicomDirPrivate(bool empty=false); + ~DicomDirPrivate(); +}; +} // end namespace gdcm +//----------------------------------------------------------------------------- +#endif