Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkBoundingObjectCutter.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 BOUNDINGOBJECTCUTTER_H_HEADER_INCLUDED_C10B22CD
18 #define BOUNDINGOBJECTCUTTER_H_HEADER_INCLUDED_C10B22CD
19 
21 #include "itkImage.h"
22 #include "mitkBoundingObject.h"
23 #include "mitkCommon.h"
24 #include "mitkImageTimeSelector.h"
25 #include "mitkImageToImageFilter.h"
26 
27 namespace mitk
28 {
29  //##Documentation
30  //## @brief Cuts an Boundingobject out of an mitk Image
31  //##
32  //## Input Parameters are a mitk::BoundingObject and optionally an mitk::Image
33  //## if no mitk::Image is provided, the resulting image will have m_InsideValue as pixelvalue on inside pixel,
34  //## otherwise it will have the pixelvalue of the input image.
35  //## Pixel on the outside of the BoundingObject will have a pixelvalue of m_OutsideValue
36  //## \todo What Image resolution/spacing should be used, if no input image is given?
37  //## @ingroup Process
39  {
40  public:
42  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
43 
44  void SetBoundingObject(const mitk::BoundingObject *boundingObject);
45  const mitk::BoundingObject *GetBoundingObject() const;
46  //##Description
47  //## @brief Set for inside pixels, used when m_UseInsideValue is @a true
48  itkSetMacro(InsideValue, ScalarType);
49  itkGetMacro(InsideValue, ScalarType);
50  //##Description
51  //## @brief Set value for outside pixels, used when m_AutoOutsideValue is \a false
52  itkSetMacro(OutsideValue, ScalarType);
53  itkGetMacro(OutsideValue, ScalarType);
54  itkSetMacro(UseInsideValue, bool);
55  itkGetMacro(UseInsideValue, bool);
56  itkBooleanMacro(UseInsideValue);
57  //##Description
58  //## @brief If set to \a true the minimum of the ouput pixel type is
59  //## used as outside value.
60  itkSetMacro(AutoOutsideValue, bool);
61  itkGetMacro(AutoOutsideValue, bool);
62  itkBooleanMacro(AutoOutsideValue);
63 
64  itkGetMacro(InsidePixelCount, unsigned int);
65  itkGetMacro(OutsidePixelCount, unsigned int);
66 
67  itkSetMacro(UseWholeInputRegion, bool);
68  itkGetMacro(UseWholeInputRegion, bool);
69 
70  protected:
72  virtual ~BoundingObjectCutter();
73 
74  virtual const PixelType GetOutputPixelType();
75 
76  virtual void GenerateInputRequestedRegion() override;
77  virtual void GenerateOutputInformation() override;
78  virtual void GenerateData() override;
79 
80  template <typename TPixel, unsigned int VImageDimension, typename TOutputPixel>
81  friend void CutImageWithOutputTypeSelect(itk::Image<TPixel, VImageDimension> *inputItkImage,
83  int boTimeStep,
84  TOutputPixel *dummy);
85  template <typename TPixel, unsigned int VImageDimension, typename TOutputPixel>
86  friend void CutImageWithOutputTypeSelect(itk::VectorImage<TPixel, VImageDimension> *inputItkImage,
88  int boTimeStep,
89  TOutputPixel *dummy);
90  template <typename TPixel, unsigned int VImageDimension>
91  friend void CutImage(itk::Image<TPixel, VImageDimension> *itkImage,
93  int boTimeStep);
94  template <typename TPixel, unsigned int VImageDimension>
95  friend void CutImage(itk::VectorImage<TPixel, VImageDimension> *itkImage,
97  int boTimeStep);
98  virtual void ComputeData(mitk::Image *input3D, int boTimeStep);
99 
100  //##Description
101  //## @brief BoundingObject that will be cut
103  //##Description
104  //## @brief Value for inside pixels, used when m_UseInsideValue is @a true
105  //##
106  //## \sa m_UseInsideValue
108  //##Description
109  //## @brief Value for outside pixels (default: 0)
110  //##
111  //## Used only if m_AutoOutsideValue is \a false.
113  //##Description
114  //## @brief If \a true the minimum of the ouput pixel type is
115  //## used as outside value (default: \a false)
117  //##Description
118  //## @brief Use m_InsideValue for inside pixels (default: \a false)
119  //##
120  //## If @a true, pixels that are inside m_BoundingObject
121  //## will get m_InsideValue in the cutting process
122  //## If @a false, they keep their original value.
123  //## \sa m_InsideValue
125 
126  unsigned int m_OutsidePixelCount;
127  unsigned int m_InsidePixelCount;
128 
129  //##Description
130  //## @brief Region of input needed for cutting
132 
133  //##Description
134  //## @brief Time when Header was last initialized
136 
139 
141  };
142 } // namespace mitk
143 
144 #endif /* BOUNDINGOBJECTCUTTER_H_HEADER_INCLUDED_C10B22CD */
mitk::BoundingObject::Pointer m_BoundingObject
Cuts an Boundingobject out of an mitk Image.
double ScalarType
Superclass of all classes generating some kind of mitk::BaseData.
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKALGORITHMSEXT_EXPORT
superclass of all bounding objects (cylinder, cuboid,...)
itk::ImageRegion< RegionDimension > RegionType
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Image class for storing images.
Definition: mitkImage.h:76
mitk::SlicedData::RegionType m_InputRequestedRegion
mitk::ImageTimeSelector::Pointer m_InputTimeSelector
Superclass of all classes having one or more Images as input and generating Images as output...
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector
Class for defining the data type of pixels.
Definition: mitkPixelType.h:55