Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkCropTimestepsImageFilter.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 mitkCropTimestepsImageFilter_h
14 #define mitkCropTimestepsImageFilter_h
15 
17 
18 #include <mitkSubImageSelector.h>
19 
20 namespace mitk
21 {
37  {
38  public:
40  itkFactorylessNewMacro(Self);
41 
50  void SetInput(const InputImageType* image) override;
51 
59  void SetInput(unsigned int index, const InputImageType* image) override;
60 
70  itkSetMacro(UpperBoundaryTimestep, unsigned int);
71 
76  itkGetConstMacro(UpperBoundaryTimestep, unsigned int);
77 
84  itkSetMacro(LowerBoundaryTimestep, unsigned int);
85 
90  itkGetConstMacro(LowerBoundaryTimestep, unsigned int);
91 
92  private:
93  using Superclass::SetInput;
94 
95  CropTimestepsImageFilter() = default;
96  ~CropTimestepsImageFilter() override = default;
97 
98  void GenerateData() override;
99  void VerifyInputInformation() const override;
100  void VerifyInputImage(const mitk::Image* inputImage) const;
101  void GenerateOutputInformation() override;
102  mitk::SlicedData::RegionType ComputeDesiredRegion() const;
103  mitk::TimeGeometry::Pointer AdaptTimeGeometry(mitk::TimeGeometry::ConstPointer sourceGeometry, unsigned int startTimestep, unsigned int endTimestep) const;
104 
105  unsigned int m_UpperBoundaryTimestep = std::numeric_limits<unsigned int>::max();
106  unsigned int m_LowerBoundaryTimestep = 0;
107 
108  mitk::SlicedData::RegionType m_DesiredRegion;
109  };
110 }
111 
112 #endif
#define MITKALGORITHMSEXT_EXPORT
Crops timesteps from 2D+t and 3D+t images.
mitkClassMacro(CropTimestepsImageFilter, SubImageSelector)
void SetInput(unsigned int index, const InputImageType *image) override
Set the input image at the specified index (only index 0 is valid).
void SetInput(const InputImageType *image) override
Set the input image.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
itk::ImageRegion< RegionDimension > RegionType
Base class of all classes providing access to parts of an image.
Find image slices visible on a given plane.