Medical Imaging Interaction Toolkit  2016.11.0
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,
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 BOUNDINGSHAPECROPPER_H
18 #define BOUNDINGSHAPECROPPER_H
19 
22 #include "mitkCommon.h"
23 #include "mitkGeometryData.h"
24 #include "mitkImageAccessByItk.h"
25 #include "mitkImageTimeSelector.h"
26 #include "mitkImageToImageFilter.h"
27 
28 #include "itkImage.h"
29 
30 namespace mitk
31 {
39  //## @ingroup Process
41  {
42  public:
44  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
45 
46 
49  void SetGeometry(const mitk::GeometryData *geometry);
53  // const mitk::GeometryData* GetGeometryData() const;
54 
58  itkSetMacro(OutsideValue, ScalarType);
59  itkGetMacro(OutsideValue, ScalarType);
63  itkSetMacro(UseWholeInputRegion, bool);
64  itkGetMacro(UseWholeInputRegion, bool);
65 
69  itkSetMacro(CurrentTimeStep, ScalarType);
70  itkGetMacro(CurrentTimeStep, ScalarType);
74  itkSetMacro(UseCropTimeStepOnly, bool);
75  itkGetMacro(UseCropTimeStepOnly, bool);
76 
77  protected:
79  virtual ~BoundingShapeCropper();
80 
81  virtual const PixelType GetOutputPixelType();
82 
86  virtual void GenerateInputRequestedRegion() override;
87  virtual void GenerateOutputInformation() override;
88  virtual void GenerateData() override;
89 
93  template <typename TPixel, unsigned int VImageDimension>
94  void CutImage(itk::Image<TPixel, VImageDimension> *inputItkImage, int timeStep);
95 
99  virtual void ComputeData(mitk::Image *input3D, int boTimeStep);
100 
101  // virtual void ComputeData(mitk::LabelSetImage* image, int boTimeStep);
102 
103  private:
107  mitk::GeometryData::Pointer m_Geometry;
108 
112  ScalarType m_OutsideValue;
113 
117  bool m_UseCropTimeStepOnly;
118 
122  int m_CurrentTimeStep;
126  bool m_UseWholeInputRegion;
130  mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
134  mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
138  typedef itk::ImageRegion<5> RegionType;
139 
140  mitk::SlicedData::RegionType m_InputRequestedRegion;
144  itk::TimeStamp m_TimeOfHeaderInitialization;
145  };
146 } // namespace mitk
147 
148 #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:44
Image class for storing images.
Definition: mitkImage.h:76
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:55