gdcmDicomDir.cxx
gdcmDicomDirElement.cxx
gdcmDicomDirImage.cxx
+ gdcmDicomDirPrivate.cxx
gdcmDicomDirMeta.cxx
gdcmDicomDirObject.cxx
gdcmDicomDirPatient.cxx
Program: gdcm
Module: $RCSfile: gdcmCommandManager.h,v $
Language: C++
- Date: $Date: 2006/01/18 15:25:07 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2007/03/23 15:30:15 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
//-----------------------------------------------------------------------------
class Command;
-typedef std::pair<const Base *,unsigned int> CommandKey;
+typedef std::pair<const Base *, unsigned int> CommandKey;
typedef std::map<CommandKey,Command *> CommandHT;
//-----------------------------------------------------------------------------
public:
void Print(std::ostream &os = std::cout, std::string const &indent = "" );
- static void SetCommand(const Base *object,unsigned int type,Command *command);
- static Command *GetCommand(const Base *object,unsigned int type);
+ static void SetCommand(const Base *object, unsigned int type, Command *command);
+ static Command *GetCommand(const Base *object, unsigned int type);
- static bool ExecuteCommand(Base *object,unsigned int type,std::string text = "");
- static bool ExecuteCommandConst(const Base *object,unsigned int type,std::string text = "");
+ static bool ExecuteCommand(Base *object, unsigned int type, std::string text = "");
+ static bool ExecuteCommandConst(const Base *object, unsigned int type, std::string text = "");
static const CommandManager *GetInstance();
CommandManager();
void InClearCommand(void);
- void InSetCommand(const Base *object,unsigned int type,Command *command);
- Command *InGetCommand(const Base *object,unsigned int type);
+ void InSetCommand(const Base *object, unsigned int type, Command *command);
+ Command *InGetCommand(const Base *object, unsigned int type);
- bool InExecuteCommand(Base *object,unsigned int type,std::string text = "");
- bool InExecuteCommandConst(const Base *object,unsigned int type,std::string text = "");
+ bool InExecuteCommand(Base *object, unsigned int type, std::string text = "");
+ bool InExecuteCommandConst(const Base *object, unsigned int type, std::string text = "");
private:
static CommandManager Instance;
Program: gdcm
Module: $RCSfile: gdcmCommon.h,v $
Language: C++
- Date: $Date: 2006/07/06 15:08:10 $
- Version: $Revision: 1.113 $
+ Date: $Date: 2007/03/23 15:30:15 $
+ Version: $Revision: 1.114 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
# define PUB_DICT_PATH "../Dicts/"
#endif
#define PUB_DICT_NAME "dicomV3Dict"
+
// dicomV3.dic replaced by the generated gdcm.dic/
// if gdcm.dic not found, method FillDefaultDataDict() is invoked
//#define PUB_DICT_FILENAME "dicomV3.dic"
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2006/05/30 08:10:19 $
- Version: $Revision: 1.189 $
+ Date: $Date: 2007/03/23 15:30:15 $
+ Version: $Revision: 1.190 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDicomDirSerie.h"
#include "gdcmDicomDirVisit.h"
#include "gdcmDicomDirImage.h"
+#include "gdcmDicomDirPrivate.h"
#include "gdcmDicomDirPatient.h"
#include "gdcmDicomDirMeta.h"
#include "gdcmDicomDirElement.h"
gdcmErrorMacro( "Add PatientToEnd failed");
}
}
+ /// \to do : deal with PRIVATE (not so easy, since PRIVATE appears
+ /// at defferent levels ?!? )
+
+ else if ( v == "PRIVATE " ) // for SIEMENS 'CSA Non Image'
+ {
+
+ gdcmWarningMacro( " -------------------------------------------"
+ << "a PRIVATE SQItem was found : " << v);
+ si = DicomDirPrivate::New(true);
+ if ( !AddPrivateToEnd( static_cast<DicomDirPrivate *>(si)) )
+ {
+ si->Delete();
+ si = NULL;
+ gdcmErrorMacro( "Add PrivateToEnd failed");
+ }
+ }
else
{
// It was neither a 'PATIENT', nor a 'STUDY', nor a 'SERIE',
// nor an 'IMAGE' SQItem. Skip to next item.
- gdcmDebugMacro( " -------------------------------------------"
+ gdcmWarningMacro( " -------------------------------------------"
<< "a non PATIENT/STUDY/SERIE/IMAGE SQItem was found : "
<< v);
return false;
}
+/**
+ * \brief AddPrivateToEnd
+ * @param dd SQ Item to enqueue to the DicomDirPrivate chained List
+ * (checked for SIEMENS 'CSA non image')
+ */
+bool DicomDir::AddPrivateToEnd(DicomDirPrivate *dd)
+{
+ if ( Patients.size() > 0 )
+ {
+ ListDicomDirPatient::iterator itp = Patients.end();
+ itp--;
+
+ DicomDirStudy *study = (*itp)->GetLastStudy();
+ if ( study )
+ {
+ DicomDirSerie *serie = study->GetLastSerie();
+ if ( serie )
+ {
+ serie->AddPrivate(dd);
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
/**
* \brief for each Header of the chained list,
* add/update the Patient/Study/Serie/Image info
Program: gdcm
Module: $RCSfile: gdcmDicomDir.h,v $
Language: C++
- Date: $Date: 2006/05/30 08:10:19 $
- Version: $Revision: 1.77 $
+ Date: $Date: 2007/03/23 15:30:15 $
+ Version: $Revision: 1.78 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class DicomDirSerie;
class DicomDirVisit;
class DicomDirImage;
+class DicomDirPrivate;
class SQItem;
typedef std::list<DicomDirPatient *> ListDicomDirPatient;
void Initialize();
void CreateDicomDir();
bool DoTheLoadingJob();
- bool AddPatientToEnd(DicomDirPatient *dd);
+ bool AddPatientToEnd(DicomDirPatient *dd);
bool AddStudyToEnd (DicomDirStudy *dd);
bool AddSerieToEnd (DicomDirSerie *dd);
bool AddVisitToEnd (DicomDirVisit *dd);
bool AddImageToEnd (DicomDirImage *dd);
-
+ bool AddPrivateToEnd(DicomDirPrivate *dd);
+
void SetElements(std::string const &path, VectDocument const &list);
void SetElement (std::string const &path, DicomDirType type,
Document *header);
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.cxx,v $
Language: C++
- Date: $Date: 2006/04/11 16:03:26 $
- Version: $Revision: 1.43 $
+ Date: $Date: 2007/03/23 15:30:15 $
+ Version: $Revision: 1.44 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
from.getline(buff2, 1024, '"');
elem.VR[0] = buff2[0];
elem.VR[1] = buff2[1];
-
+ // std::cout << "VR : [" << elem.VR[0] << elem.VR[1] << "]" << std::endl; // JPR
from >> std::ws;
from.getline(buff, 1024, '"');
from >> std::ws;
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.h,v $
Language: C++
- Date: $Date: 2006/04/11 16:03:26 $
- Version: $Revision: 1.38 $
+ Date: $Date: 2007/03/23 15:30:15 $
+ Version: $Revision: 1.39 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
typedef std::list<DicomElement> ListDicomDirVisitElem;
typedef std::list<DicomElement> ListDicomDirSerieElem;
typedef std::list<DicomElement> ListDicomDirImageElem;
+typedef std::list<DicomElement> ListDicomDirPrivateElem; // For "CSA Non Image"
// For future use (Full DICOMDIR)
ListDicomDirImageElem const &GetDicomDirImageElements() const
{ return DicomDirImageList; }
+ /**
+ * \brief returns a reference to the chained List
+ * related to the PRIVATE Elements of a DICOMDIR.
+ */
+ ListDicomDirPrivateElem const &GetDicomDirPrivateElements() const
+ { return DicomDirPrivateList; }
+
+
// Public method to add an element
bool AddEntry(DicomDirType type, DicomElement const &elem);
ListDicomDirSerieElem DicomDirSerieList;
/// Elements chained list, related to the ImageElements of DICOMDIR
ListDicomDirImageElem DicomDirImageList;
+ /// Elements chained list, related to the PrivateElements of DICOMDIR
+ ListDicomDirPrivateElem DicomDirPrivateList;
};
} // end namespace gdcm
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.cxx,v $
Language: C++
- Date: $Date: 2006/02/16 20:06:13 $
- Version: $Revision: 1.35 $
+ Date: $Date: 2007/03/23 15:30:15 $
+ Version: $Revision: 1.36 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmGlobal.h"
#include "gdcmUtil.h"
#include "gdcmDataEntry.h"
+
namespace gdcm
{
//-----------------------------------------------------------------------------
/**
* \brief Writes the Meta Elements
* @param fp ofstream to write to
- * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
+ * @param filetype type of the file (ImplicitVR, ExplicitVR, ...)
* @return
*/
void DicomDirMeta::WriteContent(std::ofstream *fp, FileType filetype)
e0000->SetString(sLen.str());
for (ListDocEntry::iterator i = DocEntries.begin();
- i != DocEntries.end();
- ++i)
- {
+ i!= DocEntries.end();
+ ++i)
+ {
(*i)->WriteContent(fp, filetype);
}
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
Language: C++
- Date: $Date: 2005/11/29 12:48:46 $
- Version: $Revision: 1.40 $
+ Date: $Date: 2007/03/23 15:30:15 $
+ Version: $Revision: 1.41 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDicomDirSerie.h"
#include "gdcmDicomDirElement.h"
#include "gdcmDicomDirImage.h"
+#include "gdcmDicomDirPrivate.h"
#include "gdcmGlobal.h"
#include "gdcmDebug.h"
DicomDirSerie::~DicomDirSerie()
{
ClearImage();
+ ClearPrivate(); // For SIEMENS 'CSA non image'
}
//-----------------------------------------------------------------------------
++cc )
{
(*cc)->WriteContent( fp, t );
- }
+ }
+ for(ListDicomDirPrivate::iterator cc2 = Privates.begin();
+ cc2!= Privates.end();
+ ++cc2 )
+ {
+ (*cc2)->WriteContent( fp, t );
+ }
}
/**
}
/**
- * \brief Remove all images in the serie
+ * \brief Remove all 'Images' in the serie
+ */
+void DicomDirSerie::ClearPrivate()
+{
+ for(ListDicomDirPrivate::iterator cc = Privates.begin();
+ cc!= Privates.end();
+ ++cc)
+ {
+ (*cc)->Delete();
+ }
+ Privates.clear();
+}
+
+
+/**
+ * \brief Remove all 'Privates' in the serie
*/
void DicomDirSerie::ClearImage()
{
for(ListDicomDirImage::iterator cc = Images.begin();
- cc != Images.end();
- ++cc)
+ cc!= Images.end();
+ ++cc)
{
(*cc)->Delete();
}
Images.clear();
}
-
/**
* \brief Get the first entry while visiting the DicomDirImage
* \return The first DicomDirImage if DicomDirserie not empty, otherwhise NULL
/**
* \brief Get the next entry while visiting the DicomDirImages
- * \note : meaningfull only if GetFirstEntry already called
+ * \note : meaningfull only if GetFirstImage already called
* \return The next DicomDirImages if found, otherwhise NULL
*/
DicomDirImage *DicomDirSerie::GetNextImage()
return NULL;
}
+/**
+ * \brief Get the first entry while visiting the DicomDirPrivate
+ * \return The first DicomDirPrivate if DicomDirserie not empty, otherwhise NULL
+ */
+DicomDirPrivate *DicomDirSerie::GetFirstPrivate()
+{
+ ItPrivate = Privates.begin();
+ if (ItPrivate != Privates.end())
+ return *ItPrivate;
+ return NULL;
+}
+
+/**
+ * \brief Get the next entry while visiting the DicomDirPrivates
+ * \note : meaningfull only if GetFirstPrivate already called
+ * \return The next DicomDirPrivates if found, otherwhise NULL
+ */
+DicomDirPrivate *DicomDirSerie::GetNextPrivate()
+{
+ gdcmAssertMacro (ItPrivate != Privates.end());
+
+ ++ItPrivate;
+ if (ItPrivate != Privates.end())
+ return *ItPrivate;
+ return NULL;
+}
+
/**
* \brief Copies all the attributes from an other DocEntrySet
* @param set entry to copy from
{
// Remove all previous childs
ClearImage();
-
+ ClearPrivate();
+
DicomDirObject::Copy(set);
DicomDirSerie *ddEntry = dynamic_cast<DicomDirSerie *>(set);
Images = ddEntry->Images;
for(ItImage = Images.begin();ItImage != Images.end();++ItImage)
(*ItImage)->Register();
- }
+
+ Privates = ddEntry->Privates;
+ for(ItPrivate = Privates.begin();ItPrivate != Privates.end();++ItPrivate)
+ (*ItPrivate)->Register();
+ }
}
//-----------------------------------------------------------------------------
(*cc)->SetPrintLevel(PrintLevel);
(*cc)->Print(os);
}
+
+ for(ListDicomDirPrivate::iterator cc2 = Privates.begin();
+ cc2 != Privates.end();
+ ++cc2)
+ {
+ (*cc2)->SetPrintLevel(PrintLevel);
+ (*cc2)->Print(os);
+ }
+
}
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.h,v $
Language: C++
- Date: $Date: 2005/11/29 12:48:46 $
- Version: $Revision: 1.32 $
+ Date: $Date: 2007/03/23 15:30:15 $
+ Version: $Revision: 1.33 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
namespace gdcm
{
class DicomDirImage;
+class DicomDirPrivate;
+
//-----------------------------------------------------------------------------
typedef std::list<DicomDirImage *> ListDicomDirImage;
-
+typedef std::list<DicomDirPrivate *> ListDicomDirPrivate;
//-----------------------------------------------------------------------------
/**
* \brief describes a SERIE within a within a STUDY
void Print( std::ostream &os = std::cout, std::string const &indent = "" );
void WriteContent( std::ofstream *fp, FileType t );
- // Image methods
+ // 'Image' methods
DicomDirImage *NewImage();
/// Add a new gdcm::DicomDirImage to the Serie
void AddImage(DicomDirImage *obj) { Images.push_back(obj); }
DicomDirImage *GetFirstImage();
DicomDirImage *GetNextImage();
+ // 'Private' methods (For SIEMENS 'CSA non image')
+ DicomDirPrivate *NewPrivate();
+ /// Add a new gdcm::DicomDirPrivate to the Serie
+ void AddPrivate(DicomDirPrivate *obj) { Privates.push_back(obj); }
+ void ClearPrivate();
+
+ DicomDirPrivate *GetFirstPrivate();
+ DicomDirPrivate *GetNextPrivate();
+
+
virtual void Copy(DocEntrySet *set);
protected:
/// iterator on the DicomDirImages of the current DicomDirSerie
ListDicomDirImage::iterator ItImage;
+ ///chained list of DicomDirPrivates (to be exploited recursively)
+ ListDicomDirPrivate Privates;
+ /// iterator on the DicomDirPrivates of the current DicomDirSerie
+ ListDicomDirPrivate::iterator ItPrivate;
/*
-// for future use :
+// for future use (Full DICOMDIR):
/// chained list of DicomDirOverlays(single level)
ListDicomDirOverlay Overlays;
/// iterator on the DicomDirOverlays of the current DicomDirSerie
ListDicomDirOverlay::iterator ItOverlay;
- /// chained list of DicomDirModalityLuts(single level)
- ListDicomDirModalityLut ModalityLuts;
- /// iterator on the DicomDirModalityLuts of the current DicomDirSerie
- ListDicomDirModalityLut::iterator ItModalityLut;
-
/// chained list of DicomDirModalityLuts(single level)
ListDicomDirModalityLut ModalityLuts;
/// iterator on the DicomDirModalityLuts of the current DicomDirSerie