X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkDicomRT_StructureSet.h;h=c26122ee1976884fe0fa8c0ce887bc370150ef69;hb=refs%2Fheads%2FGammaIndex3D;hp=3dbb8a6bbb02103c4efed5dc81933b2619aa9f6e;hpb=765020625fbc092d283e221e36c83e60a1844cb7;p=clitk.git diff --git a/common/clitkDicomRT_StructureSet.h b/common/clitkDicomRT_StructureSet.h index 3dbb8a6..c26122e 100644 --- a/common/clitkDicomRT_StructureSet.h +++ b/common/clitkDicomRT_StructureSet.h @@ -20,10 +20,28 @@ #ifndef CLITKDICOMRT_STRUCTURESET_H #define CLITKDICOMRT_STRUCTURESET_H +// clitk #include "clitkCommon.h" #include "clitkDicomRT_ROI.h" + +// vv #include "vvImage.h" +// gdcm +#include "clitkConfiguration.h" +#if CLITK_USE_SYSTEM_GDCM == 1 +#include +#include +#endif + +// gdcm +#if GDCM_MAJOR_VERSION == 2 +// This is not use if CLITK_USE_SYSTEM_GDCM==1 +#include "gdcmReader.h" +#include "gdcmWriter.h" +#include "gdcmAttribute.h" +#endif + namespace clitk { //-------------------------------------------------------------------- @@ -34,11 +52,21 @@ public: typedef itk::SmartPointer Pointer; itkNewMacro(Self); + typedef std::map ROIMapContainer; + typedef ROIMapContainer::iterator ROIIteratorType; + typedef ROIMapContainer::const_iterator ROIConstIteratorType; + void Print(std::ostream & os = std::cout) const; void Read(const std::string & filename); + bool IsDicomRTStruct(const std::string & filename); + void Write(const std::string & filename); - const std::vector & GetListOfROI() const; - clitk::DicomRT_ROI * GetROI(int n); + clitk::DicomRT_ROI * GetROIFromROINumber(int n); + clitk::DicomRT_ROI* GetROIFromROIName(const std::string& name); + //clitk::DicomRT_ROI* GetROIFromROINameRegEx(const std::string& regEx); + clitk::DicomRT_ROI* GetROIFromROINameSubstr(const std::string& s); + ROIMapContainer * GetROIsFromROINameSubstr(const std::string& s); + ROIMapContainer & GetROIs() { return mROIs; } const std::string & GetStudyID() const; const std::string & GetStudyTime() const; const std::string & GetStudyDate() const; @@ -49,6 +77,11 @@ public: int AddBinaryImageAsNewROI(vvImage * i, std::string name); +#if GDCM_MAJOR_VERSION == 2 + // Static + static int ReadROINumber(const gdcm::Item & item); +#endif + protected: std::string mStudyID; std::string mStudyTime; @@ -57,9 +90,15 @@ protected: std::string mName; std::string mDate; std::string mTime; + + std::map mROIs; std::map mMapOfROIName; - std::map mMapOfROIIndex; - std::vector mListOfROI; +#if GDCM_MAJOR_VERSION == 2 + gdcm::Reader * mReader; + gdcm::SmartPointer mROIInfoSequenceOfItems; + gdcm::SmartPointer mROIContoursSequenceOfItems; +#endif + gdcm::File * mFile; private: DicomRT_StructureSet();