18 #include "itkOtsuMultipleThresholdsImageFilter.h"
24 paramContainer(
unsigned int numThresholds,
bool useValley,
unsigned int numBins,
mitk::Image::Pointer image)
25 : m_NumberOfThresholds(numThresholds), m_ValleyEmphasis(useValley), m_NumberOfBins(numBins), m_Image(image)
29 unsigned int m_NumberOfThresholds;
30 bool m_ValleyEmphasis;
31 unsigned int m_NumberOfBins;
35 template <
typename TPixel,
unsigned int VImageDimension>
38 typedef itk::Image<TPixel, VImageDimension> itkInputImageType;
39 typedef itk::Image<mitk::OtsuSegmentationFilter::OutputPixelType, VImageDimension> itkOutputImageType;
40 typedef itk::OtsuMultipleThresholdsImageFilter<itkInputImageType, itkOutputImageType> OtsuFilterType;
43 filter->SetNumberOfThresholds(params.m_NumberOfThresholds);
44 filter->SetInput(itkImage);
45 filter->SetValleyEmphasis(params.m_ValleyEmphasis);
46 filter->SetNumberOfHistogramBins(params.m_NumberOfBins);
57 mitk::CastToMitkImage<itkOutputImageType>(filter->GetOutput(), params.m_Image);
64 : m_NumberOfThresholds(2), m_ValleyEmphasis(false), m_NumberOfBins(128)
74 (paramContainer(m_NumberOfThresholds, m_ValleyEmphasis, m_NumberOfBins, this->
GetOutput())));
itk::SmartPointer< Self > Pointer
virtual ~OtsuSegmentationFilter()
DataCollection - Class to facilitate loading/accessing structured data.
#define AccessByItk_n(mitkImage, itkImageTypeFunction, va_tuple)
Access a MITK image by an ITK image with one or more parameters.
void AccessItkOtsuFilter(const itk::Image< TPixel, VImageDimension > *itkImage, paramContainer params)
virtual void GenerateData() override
A version of GenerateData() specific for image processing filters.
InputImageType * GetInput(void)
OutputType * GetOutput()
Get the output data of this image source object.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.