+2005-01-20 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+ * src/gdcmDicomDirObject.h : set the FillObject method in protected.
+ Thus, DicomDirXXX are created with a flad that indicates if the created
+ object is empty or not (when not empty, the DicomDirElement is used to
+ fill the object)
+
2005-01-20 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* src/gdcmDicomDir.cxx : simplify the NewPatient method, like made in
gdcm::DicomDirPatient, gdcm::DicomDirStudy, gdcm::DicomDirSerie
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 11:33:44 $
- Version: $Revision: 1.110 $
+ Date: $Date: 2005/01/20 16:16:41 $
+ Version: $Revision: 1.111 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if( MetaElems )
delete MetaElems;
- MetaElems = new DicomDirMeta();
if ( TagHT.begin() != TagHT.end() ) // after Document Parsing
{
+ MetaElems = new DicomDirMeta(true);
+
TagDocEntryHT::iterator lastOneButSequence = TagHT.end();
lastOneButSequence --;
// ALL the 'out of Sequence' Tags belong to Meta Elems
}
else // after root directory parsing
{
- ListDicomDirMetaElem const &elemList =
- Global::GetDicomDirElements()->GetDicomDirMetaElements();
- MetaElems->FillObject(elemList);
+ MetaElems = new DicomDirMeta(false);
}
MetaElems->SetSQItemNumber(0); // To avoid further missprinting
return MetaElems;
*/
DicomDirPatient *DicomDir::NewPatient()
{
- ListDicomDirPatientElem const & elemList =
- Global::GetDicomDirElements()->GetDicomDirPatientElements();
DicomDirPatient *p = new DicomDirPatient();
- p->FillObject(elemList);
-
AddPatientToEnd( p );
return p;
}
{
case GDCM_DICOMDIR_IMAGE:
elemList = Global::GetDicomDirElements()->GetDicomDirImageElements();
- si = new DicomDirImage();
+ si = new DicomDirImage(true);
if( !AddImageToEnd(static_cast<DicomDirImage *>(si)) )
{
delete si;
break;
case GDCM_DICOMDIR_SERIE:
elemList = Global::GetDicomDirElements()->GetDicomDirSerieElements();
- si = new DicomDirSerie();
+ si = new DicomDirSerie(true);
if( !AddSerieToEnd(static_cast<DicomDirSerie *>(si)) )
{
delete si;
break;
case GDCM_DICOMDIR_STUDY:
elemList = Global::GetDicomDirElements()->GetDicomDirStudyElements();
- si = new DicomDirStudy();
+ si = new DicomDirStudy(true);
if( !AddStudyToEnd(static_cast<DicomDirStudy *>(si)) )
{
delete si;
break;
case GDCM_DICOMDIR_PATIENT:
elemList = Global::GetDicomDirElements()->GetDicomDirPatientElements();
- si = new DicomDirPatient();
+ si = new DicomDirPatient(true);
if( !AddPatientToEnd(static_cast<DicomDirPatient *>(si)) )
{
delete si;
break;
case GDCM_DICOMDIR_META:
elemList = Global::GetDicomDirElements()->GetDicomDirMetaElements();
- si = new DicomDirMeta();
+ si = new DicomDirMeta(true);
if( MetaElems )
{
delete MetaElems;
if( v == "PATIENT " )
{
- si = new DicomDirPatient();
+ si = new DicomDirPatient(true);
if( !AddPatientToEnd( static_cast<DicomDirPatient *>(si)) )
{
delete si;
}
else if( v == "STUDY " )
{
- si = new DicomDirStudy();
+ si = new DicomDirStudy(true);
if( !AddStudyToEnd( static_cast<DicomDirStudy *>(si)) )
{
delete si;
}
else if( v == "SERIES" )
{
- si = new DicomDirSerie();
+ si = new DicomDirSerie(true);
if( !AddSerieToEnd( static_cast<DicomDirSerie *>(si)) )
{
delete si;
}
else if( v == "IMAGE " )
{
- si = new DicomDirImage();
+ si = new DicomDirImage(true);
if( !AddImageToEnd( static_cast<DicomDirImage *>(si)) )
{
delete si;
Program: gdcm
Module: $RCSfile: gdcmDicomDirImage.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 14:28:32 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2005/01/20 16:16:42 $
+ Version: $Revision: 1.19 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDicomDirImage.h"
#include "gdcmValEntry.h"
+#include "gdcmGlobal.h"
namespace gdcm
{
/**
* \brief Constructor
*/
-DicomDirImage::DicomDirImage():
+DicomDirImage::DicomDirImage(bool empty):
DicomDirObject()
{
+ if( !empty )
+ {
+ ListDicomDirImageElem const &elemList =
+ Global::GetDicomDirElements()->GetDicomDirImageElements();
+ FillObject(elemList);
+ }
}
+
/**
* \brief Canonical destructor.
*/
{
if( (*i)->GetGroup() == 0x0004 && (*i)->GetElement() == 0x1500 )
{
- os << ((ValEntry *)(*i))->GetValue(); //FIXME
+ os << (dynamic_cast<ValEntry *>(*i))->GetValue(); //FIXME
}
}
os << std::endl;
Program: gdcm
Module: $RCSfile: gdcmDicomDirImage.h,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2005/01/20 16:16:42 $
+ Version: $Revision: 1.15 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class GDCM_EXPORT DicomDirImage : public DicomDirObject
{
public:
- DicomDirImage();
+ DicomDirImage(bool empty=false);
~DicomDirImage();
void Print(std::ostream &os = std::cout, std::string const & indent = "" );
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.cxx,v $
Language: C++
- Date: $Date: 2005/01/18 14:28:32 $
- Version: $Revision: 1.23 $
+ Date: $Date: 2005/01/20 16:16:42 $
+ Version: $Revision: 1.24 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDicomDirMeta.h"
#include "gdcmDocument.h"
#include "gdcmDocEntry.h"
+#include "gdcmGlobal.h"
namespace gdcm
{
/**
* \brief Constructor
*/
-DicomDirMeta::DicomDirMeta():
+DicomDirMeta::DicomDirMeta(bool empty):
DicomDirObject()
{
+ if( !empty )
+ {
+ ListDicomDirStudyElem const &elemList =
+ Global::GetDicomDirElements()->GetDicomDirMetaElements();
+ FillObject(elemList);
+ }
}
/**
// Private
//-----------------------------------------------------------------------------
-
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.h,v $
Language: C++
- Date: $Date: 2005/01/16 04:50:41 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/01/20 16:16:42 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class GDCM_EXPORT DicomDirMeta : public DicomDirObject
{
public:
- DicomDirMeta();
+ DicomDirMeta(bool empty=false);
~DicomDirMeta();
virtual void Print(std::ostream &os = std::cout, std::string const & indent = "" );
Program: gdcm
Module: $RCSfile: gdcmDicomDirObject.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 11:09:23 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/01/20 16:16:42 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
}
-
/**
* \brief Canonical destructor.
*/
{
}
-
//-----------------------------------------------------------------------------
// Public
void DicomDirObject::FillObject(ListDicomDirMetaElem const &elemList)
{
// FillObject fills up the SQItem that will be conneected to the right place
-
ListDicomDirMetaElem::const_iterator it;
uint16_t tmpGr,tmpEl;
DictEntry *dictEntry;
AddEntry(entry);
}
}
-} // end namespace gdcm
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDicomDirObject.h,v $
Language: C++
- Date: $Date: 2005/01/20 11:09:23 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2005/01/20 16:16:42 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class GDCM_EXPORT DicomDirObject : public SQItem
{
public:
- void FillObject(ListDicomDirMetaElem const &elemList);
protected:
// Constructor and destructor are protected to avoid end user to
// NO ! DicomDir needs to instanciate it!
DicomDirObject(int depth = 1);
~DicomDirObject();
+
+ void FillObject(ListDicomDirMetaElem const &elemList);
};
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 11:09:23 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2005/01/20 16:16:42 $
+ Version: $Revision: 1.30 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/**
* \brief Constructor
*/
-DicomDirPatient::DicomDirPatient():
+DicomDirPatient::DicomDirPatient(bool empty):
DicomDirObject()
{
+ if( !empty )
+ {
+ ListDicomDirStudyElem const &elemList =
+ Global::GetDicomDirElements()->GetDicomDirPatientElements();
+ FillObject(elemList);
+ }
}
+
/**
* \brief Canonical destructor.
*/
*/
DicomDirStudy* DicomDirPatient::NewStudy()
{
- ListDicomDirStudyElem const &elemList =
- Global::GetDicomDirElements()->GetDicomDirStudyElements();
-
DicomDirStudy *st = new DicomDirStudy();
- st->FillObject(elemList);
-
Studies.push_back(st);
return st;
}
// Private
//-----------------------------------------------------------------------------
-
} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.h,v $
Language: C++
- Date: $Date: 2005/01/20 11:09:23 $
- Version: $Revision: 1.21 $
+ Date: $Date: 2005/01/20 16:16:42 $
+ Version: $Revision: 1.22 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class GDCM_EXPORT DicomDirPatient : public DicomDirObject
{
public:
- DicomDirPatient();
+ DicomDirPatient(bool empty=false);
~DicomDirPatient();
void Print(std::ostream &os = std::cout, std::string const & indent = "" );
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 11:09:23 $
- Version: $Revision: 1.31 $
+ Date: $Date: 2005/01/20 16:16:42 $
+ Version: $Revision: 1.32 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/**
* \brief Constructor
*/
-DicomDirSerie::DicomDirSerie():
+DicomDirSerie::DicomDirSerie(bool empty):
DicomDirObject()
{
+ if( !empty )
+ {
+ ListDicomDirSerieElem const &elemList =
+ Global::GetDicomDirElements()->GetDicomDirSerieElements();
+ FillObject(elemList);
+ }
}
+
/**
* \brief Canonical destructor.
*/
*/
DicomDirImage *DicomDirSerie::NewImage()
{
- ListDicomDirImageElem const &elemList =
- Global::GetDicomDirElements()->GetDicomDirImageElements();
-
DicomDirImage *st = new DicomDirImage();
- st->FillObject(elemList);
-
Images.push_back(st);
return st;
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.h,v $
Language: C++
- Date: $Date: 2005/01/20 11:09:23 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2005/01/20 16:16:42 $
+ Version: $Revision: 1.23 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class GDCM_EXPORT DicomDirSerie : public DicomDirObject
{
public:
- DicomDirSerie();
+ DicomDirSerie(bool empty=false);
~DicomDirSerie();
void Print( std::ostream &os = std::cout, std::string const & indent = "" );
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
Language: C++
- Date: $Date: 2005/01/20 11:09:23 $
- Version: $Revision: 1.28 $
+ Date: $Date: 2005/01/20 16:16:42 $
+ Version: $Revision: 1.29 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/**
* \brief Constructor
*/
-DicomDirStudy::DicomDirStudy():
+DicomDirStudy::DicomDirStudy(bool empty):
DicomDirObject()
{
+ if( !empty )
+ {
+ ListDicomDirStudyElem const &elemList =
+ Global::GetDicomDirElements()->GetDicomDirStudyElements();
+ FillObject(elemList);
+ }
}
+
/**
* \brief Canonical destructor.
*/
*/
DicomDirSerie *DicomDirStudy::NewSerie()
{
- ListDicomDirSerieElem const &elemList =
- Global::GetDicomDirElements()->GetDicomDirSerieElements();
-
DicomDirSerie* st = new DicomDirSerie();
- st->FillObject(elemList);
-
Series.push_back(st);
return st;
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.h,v $
Language: C++
- Date: $Date: 2005/01/20 11:09:23 $
- Version: $Revision: 1.20 $
+ Date: $Date: 2005/01/20 16:16:42 $
+ Version: $Revision: 1.21 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class GDCM_EXPORT DicomDirStudy : public DicomDirObject
{
public:
- DicomDirStudy();
+ DicomDirStudy(bool empty=false);
~DicomDirStudy();
void Print(std::ostream &os = std::cout, std::string const & indent = "" );