Medical Imaging Interaction Toolkit  2018.4.99-eed36131
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);
41  itkCloneMacro(Self);
42 
46  void SetGeometry(const mitk::GeometryData *geometry);
50  // const mitk::GeometryData* GetGeometryData() const;
51 
55  itkSetMacro(OutsideValue, ScalarType);
56  itkGetMacro(OutsideValue, ScalarType);
60  itkSetMacro(UseWholeInputRegion, bool);
61  itkGetMacro(UseWholeInputRegion, bool);
62 
66  itkSetMacro(CurrentTimeStep, ScalarType);
67  itkGetMacro(CurrentTimeStep, ScalarType);
71  itkSetMacro(UseCropTimeStepOnly, bool);
72  itkGetMacro(UseCropTimeStepOnly, bool);
73 
74  protected:
76  ~BoundingShapeCropper() override;
77 
78  virtual const PixelType GetOutputPixelType();
79 
83  void GenerateInputRequestedRegion() override;
84  void GenerateOutputInformation() override;
85  void GenerateData() override;
86 
90  template <typename TPixel, unsigned int VImageDimension>
91  void CutImage(itk::Image<TPixel, VImageDimension> *inputItkImage, int timeStep);
92 
96  virtual void ComputeData(mitk::Image *input3D, int boTimeStep);
97 
98  // virtual void ComputeData(mitk::LabelSetImage* image, int boTimeStep);
99 
100  private:
104  mitk::GeometryData::Pointer m_Geometry;
105 
109  ScalarType m_OutsideValue;
110 
114  bool m_UseCropTimeStepOnly;
115 
119  int m_CurrentTimeStep;
123  bool m_UseWholeInputRegion;
127  mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
131  mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
135  typedef itk::ImageRegion<5> RegionType;
136 
137  mitk::SlicedData::RegionType m_InputRequestedRegion;
141  itk::TimeStamp m_TimeOfHeaderInitialization;
142  };
143 } // namespace mitk
144 
145 #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