template<typename TImage>
static void CreateImage1(TImage* const);
template<typename TImage>
static void CreateImage2(TImage* const);
int main(int, char*[])
{
ImageType::Pointer image1 = ImageType::New();
CreateImage1(image1.GetPointer());
ImageType::Pointer image2 = ImageType::New();
CreateImage2(image2.GetPointer());
ContourMeanDistanceImageFilterType;
ContourMeanDistanceImageFilterType::Pointer contourMeanDistanceImageFilter =
ContourMeanDistanceImageFilterType::New();
contourMeanDistanceImageFilter->SetInput1(image1);
contourMeanDistanceImageFilter->SetInput2(image2);
contourMeanDistanceImageFilter->Update();
std::cout << "Mean distance: " << contourMeanDistanceImageFilter->GetMeanDistance() << std::endl;
return EXIT_SUCCESS;
}
template<typename TImage>
void CreateImage1(TImage* const image)
{
typename TImage::IndexType start = {{0,0}};
typename TImage::SizeType size = {{20,20}};
image->SetRegions(region);
image->Allocate();
image->FillBuffer(0);
{
{
if(i == j)
{
image->SetPixel(pixel, 255);
}
}
}
}
template<typename TImage>
void CreateImage2(TImage* const image)
{
typename TImage::IndexType start = {{0,0}};
typename TImage::SizeType size = {{20,20}};
image->SetRegions(region);
image->Allocate();
image->FillBuffer(0);
{
{
if(i == 10)
{
image->SetPixel(pixel, 255);
}
}
}
}