#include "itksys/SystemTools.hxx"
#include <sstream>
static void CreateImage(UnsignedCharImageType::Pointer image);
int main(int argc, char * argv[])
{
UnsignedCharImageType::Pointer image = UnsignedCharImageType::New();
if (argc < 2)
{
CreateImage(image);
}
else
{
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(argv[1]);
reader->Update();
image = reader->GetOutput();
}
SignedMaurerDistanceMapImageFilterType::Pointer distanceMapImageFilter =
SignedMaurerDistanceMapImageFilterType::New();
distanceMapImageFilter->SetInput(image);
image.GetPointer(),true,
argc > 1 ? itksys::SystemTools::GetFilenameName(argv[1]) : "Generated image");
std::stringstream desc;
desc << "Signed Maurer Distance";
distanceMapImageFilter->GetOutput(),
true,
desc.str());
return EXIT_SUCCESS;
}
void CreateImage(UnsignedCharImageType::Pointer image)
{
image->SetRegions(region);
image->Allocate();
image->FillBuffer(0);
for(unsigned int i = 40; i < 60; ++i)
{
image->SetPixel(pixel, 255);
}
}