Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkBooleanOperation.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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkBooleanOperation_h
18 #define mitkBooleanOperation_h
19 
21 #include <mitkLabelSetImage.h>
22 
23 namespace mitk
24 {
31  {
32  public:
33  enum Type
34  {
38  Union
39  };
40 
41  /* \brief Construct a boolean operation.
42  *
43  * Throws an mitk::Exception when segmentations are somehow invalid.
44  *
45  * \param[in] type The type of the boolean operation.
46  * \param[in] segmentationA The first operand of the boolean operation.
47  * \param[in] segmentationB The second operand of the boolean operation.
48  * \param[in] The time step at which the operation will be executed.
49  */
50  BooleanOperation(Type type, Image::Pointer segmentationA, Image::Pointer segmentationB, unsigned int time = 0);
52 
53  /* \brief Execute boolean operation and return resulting segmentation.
54  *
55  * \return The resulting segmentation.
56  */
57  LabelSetImage::Pointer GetResult() const;
58 
59  private:
61  BooleanOperation &operator=(const BooleanOperation &);
62 
63  LabelSetImage::Pointer GetDifference() const;
64  LabelSetImage::Pointer GetIntersection() const;
65  LabelSetImage::Pointer GetUnion() const;
66 
67  void ValidateSegmentation(Image::Pointer segmentation) const;
68  void ValidateSegmentations() const;
69 
70  Type m_Type;
71  Image::Pointer m_SegmentationA;
72  Image::Pointer m_SegmentationB;
73  unsigned int m_Time;
74  };
75 }
76 
77 #endif
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Executes a boolean operation on two different segmentations.