template <typename TImage>
void CreateImage(TImage* const image);
int main(int argc, char *argv[])
{
ImageType::Pointer image;
unsigned int iteration = 1;
if(argc < 3)
{
image = ImageType::New();
CreateImage(image.GetPointer());
}
else
{
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(argv[1]);
image = reader->GetOutput();
std::stringstream ssIteration(argv[2]);
}
BinaryPruningImageFilterType;
BinaryPruningImageFilterType::Pointer pruneFilter
= BinaryPruningImageFilterType::New();
pruneFilter->SetInput(image);
pruneFilter->SetIteration(iteration);
pruneFilter->GetOutput();
viewer.
AddImage(pruneFilter->GetOutput());
return EXIT_SUCCESS;
}
template <typename TImage>
void CreateImage(TImage* const image)
{
typename TImage::RegionType region(corner, size);
image->SetRegions(region);
image->Allocate();
for(int r = 40; r < 100; r++)
{
for(int c = 40; c < 100; c++)
{
image->SetPixel(pixelIndex, 50);
}
}
image->SetPixel(pixelIndex, 50);
}