#include "itksys/SystemTools.hxx"
typedef FloatImageType ImageType;
static void CreateImage(ImageType::Pointer);
int main(int argc, char *argv[])
{
ImageType::Pointer image = ImageType::New();
if (argc < 2)
{
CreateImage(image);
}
else
{
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName (argv[1]);
reader->Update();
image = reader->GetOutput();
}
SobelEdgeDetectionImageFilterType;
SobelEdgeDetectionImageFilterType::Pointer sobelFilter
= SobelEdgeDetectionImageFilterType::New();
sobelFilter->SetInput(image);
if (argc > 1)
{
image,
true,
itksys::SystemTools::GetFilenameName(argv[1]));
}
else
{
}
sobelFilter->GetOutput(),
true,
"SobelEdgeDetectionImageFilter");
return EXIT_SUCCESS;
}
void CreateImage(ImageType::Pointer image)
{
image->SetRegions(region);
image->Allocate();
for(unsigned int r = 20; r < 80; r++)
{
for(unsigned int c = 20; c < 80; c++)
{
pixelIndex[0] = r;
pixelIndex[1] = c;
image->SetPixel(pixelIndex, 15);
}
}
}