Medical Imaging Interaction Toolkit  2018.4.99-6aa36ba9
Medical Imaging Interaction Toolkit
mitkBoundingShapeCropper.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 
13 #ifndef BOUNDINGSHAPECROPPER_H
14 #define BOUNDINGSHAPECROPPER_H
15 
18 #include "mitkCommon.h"
19 #include "mitkGeometryData.h"
20 #include "mitkImageAccessByItk.h"
21 #include "mitkImageTimeSelector.h"
22 #include "mitkImageToImageFilter.h"
23 
24 #include "itkImage.h"
25 
26 namespace mitk
27 {
35  //## @ingroup Process
37  {
38  public:
40  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
41 
42 
45  void SetGeometry(const mitk::GeometryData *geometry);
49  // const mitk::GeometryData* GetGeometryData() const;
50 
54  itkSetMacro(OutsideValue, ScalarType);
55  itkGetMacro(OutsideValue, ScalarType);
59  itkSetMacro(UseWholeInputRegion, bool);
60  itkGetMacro(UseWholeInputRegion, bool);
61 
65  itkSetMacro(CurrentTimeStep, ScalarType);
66  itkGetMacro(CurrentTimeStep, ScalarType);
70  itkSetMacro(UseCropTimeStepOnly, bool);
71  itkGetMacro(UseCropTimeStepOnly, bool);
72 
73  protected:
75  ~BoundingShapeCropper() override;
76 
77  virtual const PixelType GetOutputPixelType();
78 
82  void GenerateInputRequestedRegion() override;
83  void GenerateOutputInformation() override;
84  void GenerateData() override;
85 
89  template <typename TPixel, unsigned int VImageDimension>
90  void CutImage(itk::Image<TPixel, VImageDimension> *inputItkImage, int timeStep);
91 
95  virtual void ComputeData(mitk::Image *input3D, int boTimeStep);
96 
97  // virtual void ComputeData(mitk::LabelSetImage* image, int boTimeStep);
98 
99  private:
103  mitk::GeometryData::Pointer m_Geometry;
104 
108  ScalarType m_OutsideValue;
109 
113  bool m_UseCropTimeStepOnly;
114 
118  int m_CurrentTimeStep;
122  bool m_UseWholeInputRegion;
126  mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
130  mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
134  typedef itk::ImageRegion<5> RegionType;
135 
136  mitk::SlicedData::RegionType m_InputRequestedRegion;
140  itk::TimeStamp m_TimeOfHeaderInitialization;
141  };
142 } // namespace mitk
143 
144 #endif /* BOUNDINGSHAPECROPPER_H */
#define MITKBOUNDINGSHAPE_EXPORT
Crops or masks an Boundingbox defined by GeometryData 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.
itk::ImageRegion< RegionDimension > RegionType
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Image class for storing images.
Definition: mitkImage.h:72
Superclass of all classes having one or more Images as input and generating Images as output...
Data class only having a BaseGeometry but not containing any specific data.
Class for defining the data type of pixels.
Definition: mitkPixelType.h:51