X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkDicomRT_StructureSet.h;h=dff4d75276aa3196dca59941661007f7da497733;hb=bffde3a7ae834139793d8c00f73986879146b0e0;hp=541a91c5d0a6a362e5dcec8df9aba8fc7acb44fc;hpb=24fb0576a860ea843722b1d84561186542b62fd5;p=clitk.git diff --git a/common/clitkDicomRT_StructureSet.h b/common/clitkDicomRT_StructureSet.h index 541a91c..dff4d75 100644 --- a/common/clitkDicomRT_StructureSet.h +++ b/common/clitkDicomRT_StructureSet.h @@ -4,7 +4,7 @@ Authors belongs to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -20,48 +20,96 @@ #ifndef CLITKDICOMRT_STRUCTURESET_H #define CLITKDICOMRT_STRUCTURESET_H +// clitk #include "clitkCommon.h" #include "clitkDicomRT_ROI.h" + +//vtk +#include "vtkMatrix4x4.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 { - //-------------------------------------------------------------------- - class DicomRT_StructureSet { - - public: - DicomRT_StructureSet(); - ~DicomRT_StructureSet(); - - void Print(std::ostream & os = std::cout) const; - void Read(const std::string & filename); - - const std::vector & GetListOfROI() const; - clitk::DicomRT_ROI * GetROI(int n); - const std::string & GetStudyID() const; - const std::string & GetStudyTime() const; - const std::string & GetStudyDate() const; - const std::string & GetLabel() const; - const std::string & GetName() const; - const std::string & GetDate() const; - const std::string & GetTime() const; - - int AddBinaryImageAsNewROI(vvImage * i, std::string name); - - protected: - std::string mStudyID; - std::string mStudyTime; - std::string mStudyDate; - std::string mLabel; - std::string mName; - std::string mDate; - std::string mTime; - std::map mMapOfROIName; - std::map mMapOfROIIndex; - std::vector mListOfROI; - - }; - //-------------------------------------------------------------------- +//-------------------------------------------------------------------- +class DicomRT_StructureSet : public itk::LightObject{ + +public: + typedef DicomRT_StructureSet Self; + 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); + void SetTransformMatrix(vtkMatrix4x4* matrix); + bool IsDicomRTStruct(const std::string & filename); + void Write(const std::string & filename); + + 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; + const std::string & GetLabel() const; + const std::string & GetName() const; + const std::string & GetDate() const; + const std::string & GetTime() const; + + 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; + std::string mStudyDate; + std::string mLabel; + std::string mName; + std::string mDate; + std::string mTime; + vtkSmartPointer mTransformMatrix; + + std::map mROIs; + std::map mMapOfROIName; +#if GDCM_MAJOR_VERSION >= 2 + gdcm::Reader * mReader; + gdcm::SmartPointer mROIInfoSequenceOfItems; + gdcm::SmartPointer mROIContoursSequenceOfItems; +#endif + gdcm::File * mFile; + +private: + DicomRT_StructureSet(); + ~DicomRT_StructureSet(); +}; +//-------------------------------------------------------------------- } // end namespace clitk #endif // CLITKDICOMRT_STRUCTURESET_H