Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkCropOpenCVImageFilter.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 mitkCropOpenCVImageFilter_h
14 #define mitkCropOpenCVImageFilter_h
15 
17 
18 #include "opencv2/core.hpp"
19 
20 //itk headers
21 #include <itkObjectFactory.h>
22 
23 namespace mitk {
24 
25 class MITKOPENCVVIDEOSUPPORT_EXPORT CropOpenCVImageFilter : public AbstractOpenCVImageFilter
26 {
27 
28 public:
30  itkFactorylessNewMacro(Self);
31  itkCloneMacro(Self);
32 
34 
39  bool OnFilterImage( cv::Mat& image ) override;
40 
44  void SetCropRegion( cv::Rect cropRegion );
45 
49  void SetCropRegion( int topLeftX, int topLeftY, int bottomRightX, int bottomRightY );
50 
54  cv::Rect GetCropRegion( );
55 
59  bool GetIsCropRegionEmpty( );
60 
61 protected:
65  cv::Rect m_CropRegion;
66 
71 };
72 
73 } // namespace mitk
74 
75 #endif
mitk::AbstractOpenCVImageFilter
Interface for image filters on OpenCV images.
Definition: mitkAbstractOpenCVImageFilter.h:36
mitk::CropOpenCVImageFilter
Definition: mitkCropOpenCVImageFilter.h:25
mitk::CropOpenCVImageFilter::m_NewCropRegionSet
bool m_NewCropRegionSet
True if no image was filtered since last set of a crop region.
Definition: mitkCropOpenCVImageFilter.h:70
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::CropOpenCVImageFilter::m_CropRegion
cv::Rect m_CropRegion
Defines the region which will be cropped from the image.
Definition: mitkCropOpenCVImageFilter.h:65
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitkAbstractOpenCVImageFilter.h