21 #include <itkTestingComparisonImageFilter.h> 25 this->SetNumberOfRequiredInputs(2);
62 mcComparator->SetTestImage(input1);
63 mcComparator->SetValidImage(input2);
66 mcComparator->Update();
87 template <
typename TPixel,
unsigned int VImageDimension>
98 typedef itk::Testing::ComparisonImageFilter<InputImageType, OutputImageType> CompareFilterType;
99 typename CompareFilterType::Pointer compare_filter = CompareFilterType::New();
100 compare_filter->SetTestInput(itkImage1);
101 compare_filter->SetValidInput(itk_reference);
102 compare_filter->SetDifferenceThreshold(
m_Tolerance);
106 compare_filter->Update();
108 catch (
const itk::ExceptionObject &e)
130 this->SetOutput(MakeNameFromOutputIndex(0), output.GetPointer());
double m_MaximumDifference
void GenerateData() override
bool GetResult(vcl_size_t threshold=0)
Get the result of the comparison.
CompareFilterResults m_CompareDetails
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
vcl_size_t GetNumberOfComponents() const
Get the number of components of which each element consists.
void EstimateValueDifference(const itk::Image< TPixel, VImageDimension > *itkImage1, const mitk::Image *referenceImage)
#define AccessByItk_1(mitkImage, itkImageTypeFunction, arg1)
Image::Pointer GrabItkImageMemory(itk::SmartPointer< ItkOutputImageType > &itkimage, mitk::Image *mitkImage=nullptr, const BaseGeometry *geometry=nullptr, bool update=true)
Grabs the memory of an itk::Image (with a specific type) and puts it into an mitk::Image.The memory is managed by the mitk::Image after calling this function. The itk::Image remains valid until the mitk::Image decides to free the memory.
mitk::Image InputImageType
Image class for storing images.
mitk::Image OutputImageType
Some convenient typedefs.
vcl_size_t m_PixelsWithDifference
InputImageType * GetInput(void)
double m_MinimumDifference
void MITKCORE_EXPORT CastToItkImage(const mitk::Image *mitkImage, itk::SmartPointer< ItkOutputImageType > &itkOutputImage)
Cast an mitk::Image to an itk::Image with a specific type.
void ResetCompareResultsToInitial()
Method resets the compare detail memeber struct to its initial state.
std::string m_ExceptionMessage