Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkContourModelSet.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 #ifndef mitkContourModelSet_h
13 #define mitkContourModelSet_h
14 
15 #include <mitkCommon.h>
17 
18 #include <mitkContourModel.h>
19 
20 #include <deque>
21 
22 namespace mitk
23 {
36  {
37  public:
39 
40  itkFactorylessNewMacro(Self);
41 
42  itkCloneMacro(Self);
43 
45  typedef std::deque<mitk::ContourModel::Pointer> ContourModelListType;
47  typedef ContourModelListType::iterator ContourModelSetIterator;
48 
49  // start of inline methods
50 
54  virtual ContourModelSetIterator Begin() { return this->m_Contours.begin(); }
55 
59  virtual ContourModelSetIterator End() { return this->m_Contours.end(); }
60 
64  virtual int GetSize() const { return this->m_Contours.size(); }
65  // end of inline methods
66 
70  virtual void AddContourModel(mitk::ContourModel &contourModel);
71 
75  virtual void AddContourModel(mitk::ContourModel::Pointer contourModel);
76 
81  virtual mitk::ContourModel *GetContourModelAt(int index) const;
82 
87 
91  bool IsEmpty() const override;
92 
97  virtual bool RemoveContourModel(mitk::ContourModel *contourModel);
98 
103  virtual bool RemoveContourModelAt(int index);
104 
108  void Clear() override;
109 
111 
112  /* NO support for regions ! */
113 
115  bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return false; }
116  bool VerifyRequestedRegion() override { return true; }
117  void SetRequestedRegion(const itk::DataObject *) override {}
123  void UpdateOutputInformation() override;
124 
126 
127  protected:
129 
132  ~ContourModelSet() override;
133 
134  // inherit from BaseData. Initial state with no contours and a single timestep.
135  void InitializeEmpty() override;
136 
138 
139  // only update the bounding geometry if necessary
141  };
142 } // namespace mitk
143 
144 #endif
#define MITKCONTOURMODEL_EXPORT
Base class of all data objects.
Definition: mitkBaseData.h:60
A collection of ContourModel instances managed as a single BaseData object.
void SetRequestedRegionToLargestPossibleRegion() override
Set the RequestedRegion to the LargestPossibleRegion.
mitkClassMacro(ContourModelSet, mitk::BaseData)
virtual ContourModelSetIterator Begin()
Return an iterator to the first contour model in the set.
ContourModelListType m_Contours
virtual void AddContourModel(mitk::ContourModel &contourModel)
Add a contour model to the set by reference.
~ContourModelSet() override
bool IsEmpty() const override
Check whether the set contains no contour models.
virtual void AddContourModel(mitk::ContourModel::Pointer contourModel)
Add a contour model to the set by smart pointer.
ContourModelListType::iterator ContourModelSetIterator
Iterator type for traversing the contour model collection.
void SetRequestedRegion(const itk::DataObject *) override
Set the requested region from this data object to match the requested region of the data object passe...
ContourModelSet(const mitk::ContourModelSet &other)
virtual int GetSize() const
Return the number of contour models in the set.
bool VerifyRequestedRegion() override
Verify that the RequestedRegion is within the LargestPossibleRegion.
void Clear() override
Remove all contour models from the set.
virtual ContourModelSetIterator End()
Return an iterator past the last contour model in the set.
void UpdateOutputInformation() override
Update the OutputInformation of a ContourModel object.
virtual bool RemoveContourModelAt(int index)
Remove the contour model at the given index.
ContourModelListType * GetContourModelList()
Return a pointer to the internal contour model container.
void InitializeEmpty() override
Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least creat...
virtual mitk::ContourModel * GetContourModelAt(int index) const
Return the contour model at the given index.
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Determine whether the RequestedRegion is outside of the BufferedRegion.
std::deque< mitk::ContourModel::Pointer > ContourModelListType
Container type for storing ContourModel smart pointers.
virtual bool RemoveContourModel(mitk::ContourModel *contourModel)
Remove a specific contour model from the set.
A time-resolved contour representation consisting of linked vertices in 3D space.
Find image slices visible on a given plane.