Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 mitkBoundingShapeCropper_h
14 #define mitkBoundingShapeCropper_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
MITKBOUNDINGSHAPE_EXPORT
#define MITKBOUNDINGSHAPE_EXPORT
Definition: MitkBoundingShapeExports.h:15
mitk::GeometryData
Data class only having a BaseGeometry but not containing any specific data.
Definition: mitkGeometryData.h:26
mitkImageToImageFilter.h
mitkImageAccessByItk.h
mitkBoundingShapeCropper.h
mitkImageTimeSelector.h
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
itk::SmartPointer< Self >
MitkBoundingShapeExports.h
mitk::SlicedData::RegionType
itk::ImageRegion< RegionDimension > RegionType
Definition: mitkSlicedData.h:45
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::BaseDataSource
Superclass of all classes generating some kind of mitk::BaseData.
Definition: mitkBaseDataSource.h:71
mitk::BoundingShapeCropper
Crops or masks an Boundingbox defined by GeometryData out of an mitk Image.
Definition: mitkBoundingShapeCropper.h:36
mitk::PixelType
Class for defining the data type of pixels.
Definition: mitkPixelType.h:51
mitkCommon.h
mitkGeometryData.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::ImageToImageFilter
Superclass of all classes having one or more Images as input and generating Images as output.
Definition: mitkImageToImageFilter.h:25
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20