int main( int argc, char *argv[])
{
FloatImageType::Pointer image = FloatImageType::New();
image->SetRegions(region);
image->Allocate();
for(unsigned int i = 0; i < 20; i++)
{
for(unsigned int j = 0; j < 20; j++)
{
pixel[0] = i;
pixel[1] = j;
image->SetPixel(pixel, j);
}
}
RescaleFilterType::Pointer rescaleFilter = RescaleFilterType::New();
rescaleFilter->SetInput(image);
rescaleFilter->SetOutputMinimum(0);
rescaleFilter->SetOutputMaximum(255);
rescaleFilter->Update();
{
WriterType::Pointer writer = WriterType::New();
writer->SetFileName("original.png");
writer->SetInput(rescaleFilter->GetOutput());
writer->Update();
}
RGBFilterType::Pointer rgbfilter = RGBFilterType::New();
rgbfilter->SetInput(image);
rgbfilter->SetColormap( RGBFilterType::Hot );
{
WriterType::Pointer writer = WriterType::New();
writer->SetFileName("hot.png");
writer->SetInput(rgbfilter->GetOutput());
writer->Update();
}
return EXIT_SUCCESS;
}