using InputPixelType = unsigned char;
{
watershed->SetThreshold(0.05);
watershed->SetLevel(0.3);
watershed->SetInput(inImage);
watershed->Update();
image->DisconnectPipeline();
outImage->CopyInformation(image);
outImage->SetRegions(image->GetBufferedRegion());
outImage->Allocate(true);
image->GetBufferedRegion(),
for (; !iIt.
IsAtEnd(); ++iIt, ++oIt)
{
OutputPixelType p;
static_assert(
Dimension <= 3,
"Dimension has to be 2 or 3");
{
p.SetElement(d, ind[d]);
}
}
},
nullptr);
return outImage;
}
int
main(int argc, char * argv[])
{
if (argc != 3)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0];
std::cerr << " <InputFileName>";
std::cerr << " <OutputFileName>" << std::endl;
return EXIT_FAILURE;
}
const auto input = itk::ReadImage<InputImageType>(argv[1]);
try
{
}
catch (const itk::ExceptionObject & error)
{
std::cerr << "Error: " << error << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}