23 this->SetNumberOfRequiredInputs(2);
37 if (image.IsNotNull())
39 this->SetInput(1, image);
44 if (boundingObject.IsNotNull() && this->GetInput(0) !=
nullptr)
47 filter->SetBoundingObject(boundingObject);
48 filter->SetInput(this->GetInput(0));
51 this->SetInput(1, filter->GetOutput());
67 m_outputImage = this->GetOutput();
72 m_CropFilter->SetInput(maskImage);
73 m_CropFilter->SetBackgroundValue(0);
74 m_CropFilter->Update();
76 RegionType region = m_CropFilter->GetCroppingRegion();
79 m_RoiFilter->SetInput(itkImage);
80 m_RoiFilter->SetRegionOfInterest(region);
81 m_RoiFilter->Update();
85 m_MaskFilter->SetInput(0, tmpImage);
86 m_MaskFilter->SetMask(m_CropFilter->GetOutput());
88 m_MaskFilter->SetOutsideValue(-32765);
89 m_MaskFilter->Update();
90 m_MaxValue = m_MaskFilter->GetMaxValue();
91 m_MinValue = m_MaskFilter->GetMinValue();
94 m_outputImage = m_MaskFilter->GetOutput();
95 m_outputImage->DisconnectPipeline();
mitk::AutoCropImageFilter::Pointer m_CropFilter
itk::SmartPointer< Self > Pointer
~MaskAndCutRoiImageFilter()
Base of all data objects.
void SetRegionOfInterest(mitk::BaseData *roi)
superclass of all bounding objects (cylinder, cuboid,...)
MaskAndCutRoiImageFilter()
mitk::MaskImageFilter::Pointer m_MaskFilter
Image class for storing images.
void GenerateData() override
A version of GenerateData() specific for image processing filters.
mitk::Image::Pointer GetOutput()
void CastToMitkImage(const itk::SmartPointer< ItkOutputImageType > &itkimage, itk::SmartPointer< mitk::Image > &mitkoutputimage)
Cast an itk::Image (with a specific type) to an mitk::Image.
void MITKCORE_EXPORT CastToItkImage(const mitk::Image *mitkImage, itk::SmartPointer< ItkOutputImageType > &itkOutputImage)
Cast an mitk::Image to an itk::Image with a specific type.
ROIFilterType::Pointer m_RoiFilter
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.