MeVisLab Toolbox Reference
mlMLToROIContourSequence.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
27 
32 //----------------------------------------------------------------------------------
33 #ifndef __mlMLToROIContourSequence_H
34 #define __mlMLToROIContourSequence_H
35 
37 #include "mlProgress.h"
38 
39 #include <mlTypeDefs.h>
40 #include <DCMTree_Lib.h>
41 #include <map>
42 #include <utility>
43 #include <string>
44 #include <boost/function.hpp>
45 #include <mlPagedImage.h>
46 #include <CSOBase/CSOList.h>
47 
48 ML_START_NAMESPACE
49 
50 typedef std::map<std::string, std::string> TStrStrMap;
51 typedef std::pair<std::string, std::string> TStrStrPair;
52 
53 class PagedImage;
54 class CSOList;
55 class CSOGroup;
56 class CSO;
57 class DcmDRTROIContourSequenceInterface;
58 class DcmDRTContourSequenceInterface;
59 class DcmDRTContourImageSequenceInterface;
60 
62 {
63 public:
67  MLToROIContourSequence(boost::function<void(float)> *setProgress);
68 
71  void setTreatCollinearAsPlanar(bool collinearIsPlanar);
72 
78  DCMTree::TreePtr convert(PagedImage* image, CSOList* csoList, int precision);
79 
83  ReferenceImageIfOneSlice
84  };
85 
88  void setImageReferenceMode(ImageReferenceMode mode) { _imageReferenceMode = mode; }
89  ImageReferenceMode imageReferenceMode() const { return _imageReferenceMode; }
90 
91 private:
92  void populateROIContourSequence(DcmDRTROIContourSequenceInterface *seq);
93  void addROIContour(DcmDRTROIContourSequenceInterface *seq, const unsigned int roiNumber,
94  const CSOGroup &csoGroup);
95  void addContour(DcmDRTContourSequenceInterface *contourSequence, const unsigned int contourNumber,
96  const CSO &cso);
97  // void addContourImage(DcmDRTContourImageSequenceInterface *contourImageSequence, const CSO& cso);
98  void addContourImage(DcmDRTContourImageSequenceInterface *contourImageSequence, int sliceIndex);
99  std::string getContourGeometricType(const CSO &cso);
100  std::string getContourData(const CSO &cso, size_t& numPoints);
101  std::string getROIDisplayColor(const CSOGroup &csoGroup);
103  bool isCollinear(const CSO& cso) const;
104 
105  PagedImage *_image;
106  CSOList *_csoList;
107  Progress _progress;
108  int _precision;
109  bool _treatCollinearAsPlanar;
110  ImageReferenceMode _imageReferenceMode;
111 };
112 
113 ML_END_NAMESPACE
114 
115 #endif
Project global and OS specific declarations.
#define MLDCMTKMLCONVERTERS_EXPORT
A CSOGroup comprises a number of CSOs, which themselves can be in a number of different CSOGroups.
Definition: CSOGroup.h:38
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
Definition: CSOList.h:61
The CSO represents a contour segmentation object.
Definition: CSO.h:44
Class to provide access to DRTContourImageSequence.
Class to provide access to DRTContourSequence.
Class to provide access to DRTROIContourSequence.
DCMTree::TreePtr convert(PagedImage *image, CSOList *csoList, int precision)
Converter function.
ImageReferenceMode imageReferenceMode() const
MLToROIContourSequence(boost::function< void(float)> *setProgress)
Constructor.
void setTreatCollinearAsPlanar(bool collinearIsPlanar)
Set treatCollinearAsPlanar option.
@ RequireExactlyOneSlice
always reference one image slice, print an error if the CSO does not lie in exactly one existing slic...
@ DoNotReferenceImage
never reference image
void setImageReferenceMode(ImageReferenceMode mode)
Set image reference mode, which tells the MLToROIContourSequence when to create a reference to an ima...
Class which represents an image, which manages properties of an image and image data which is located...
Definition: mlPagedImage.h:70
std::map< std::string, std::string > TStrStrMap
std::pair< std::string, std::string > TStrStrPair
Class for setting progress.
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree
Definition: DCMTree_Lib.h:70