Medical Imaging Interaction Toolkit  2025.12.02
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 {
27  {
28  public:
30 
31  itkFactorylessNewMacro(Self);
32 
33  itkCloneMacro(Self);
34 
35  typedef std::deque<mitk::ContourModel::Pointer> ContourModelListType;
36  typedef ContourModelListType::iterator ContourModelSetIterator;
37 
38  // start of inline methods
39 
42  virtual ContourModelSetIterator Begin() { return this->m_Contours.begin(); }
45  virtual ContourModelSetIterator End() { return this->m_Contours.end(); }
48  virtual int GetSize() const { return this->m_Contours.size(); }
49  // end of inline methods
50 
53  virtual void AddContourModel(mitk::ContourModel &contourModel);
54 
57  virtual void AddContourModel(mitk::ContourModel::Pointer contourModel);
58 
62  virtual mitk::ContourModel *GetContourModelAt(int index) const;
63 
67 
70  bool IsEmpty() const override;
71 
75  virtual bool RemoveContourModel(mitk::ContourModel *contourModel);
76 
80  virtual bool RemoveContourModelAt(int index);
81 
84  void Clear() override;
85 
87 
88  /* NO support for regions ! */
89 
91  bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return false; }
92  bool VerifyRequestedRegion() override { return true; }
93  void SetRequestedRegion(const itk::DataObject *) override {}
99  void UpdateOutputInformation() override;
100 
102 
103  protected:
105 
108  ~ContourModelSet() override;
109 
110  // inherit from BaseData. Initial state with no contours and a single timestep.
111  void InitializeEmpty() override;
112 
114 
115  // only update the bounding geometry if necessary
117  };
118 } // namespace mitk
119 
120 #endif
#define MITKCONTOURMODEL_EXPORT
Base of all data objects.
Definition: mitkBaseData.h:44
void SetRequestedRegionToLargestPossibleRegion() override
Set the RequestedRegion to the LargestPossibleRegion.
mitkClassMacro(ContourModelSet, mitk::BaseData)
virtual ContourModelSetIterator Begin()
Return an iterator a the front.
ContourModelListType m_Contours
virtual void AddContourModel(mitk::ContourModel &contourModel)
Add a ContourModel to the container.
~ContourModelSet() override
bool IsEmpty() const override
Returns a bool whether the container is empty or not.
virtual void AddContourModel(mitk::ContourModel::Pointer contourModel)
Add a ContourModel to the container.
ContourModelListType::iterator ContourModelSetIterator
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
Returns the number of contained contours.
bool VerifyRequestedRegion() override
Verify that the RequestedRegion is within the LargestPossibleRegion.
void Clear() override
Clear the storage container.
virtual ContourModelSetIterator End()
Return an iterator a the front.
void UpdateOutputInformation() override
Update the OutputInformation of a ContourModel object.
virtual bool RemoveContourModelAt(int index)
Remove a ContourModel at given index within the container if exists.
ContourModelListType * GetContourModelList()
Returns the container of the contours.
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
Returns the ContourModel a given index.
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Determine whether the RequestedRegion is outside of the BufferedRegion.
std::deque< mitk::ContourModel::Pointer > ContourModelListType
virtual bool RemoveContourModel(mitk::ContourModel *contourModel)
Remove the given ContourModel from the container if exists.
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
Find image slices visible on a given plane.