#ifdef ENABLE_QUICKVIEW
#endif
static void
static void
int
main()
{
CreateImage(image);
relabelFilter->SetInput(image);
CreateRandomColormap(255, largeColormap);
colormapFilter1->SetInput(image);
colormapFilter1->SetColormap(largeColormap);
colormapFilter2->SetInput(relabelFilter->GetOutput());
colormapFilter2->SetColormap(largeColormap);
#ifdef ENABLE_QUICKVIEW
viewer.
AddRGBImage(colormapFilter1->GetOutput(),
true,
"Original");
viewer.
AddRGBImage(colormapFilter2->GetOutput(),
true,
"Relabeled");
#endif
return EXIT_SUCCESS;
}
void
{
start[0] = 0;
start[1] = 0;
size[0] = 200;
size[1] = 300;
region.SetIndex(start);
image->SetRegions(region);
image->Allocate();
while (!imageIterator.IsAtEnd())
{
if (imageIterator.GetIndex()[0] > 100 && imageIterator.GetIndex()[0] < 150 && imageIterator.GetIndex()[1] > 100 &&
imageIterator.GetIndex()[1] < 150)
{
imageIterator.Set(200);
}
else if (imageIterator.GetIndex()[0] > 50 && imageIterator.GetIndex()[0] < 70 && imageIterator.GetIndex()[1] > 50 &&
imageIterator.GetIndex()[1] < 70)
{
imageIterator.Set(100);
}
else
{
imageIterator.Set(0);
}
++imageIterator;
}
}
void
{
ColormapType::ChannelType redChannel;
ColormapType::ChannelType greenChannel;
ColormapType::ChannelType blueChannel;
random->SetSeed(8775070);
for (unsigned int i = 0; i < size; ++i)
{
redChannel.push_back(static_cast<ColormapType::RealType>(random->GetUniformVariate(.3, 1.0)));
greenChannel.push_back(static_cast<ColormapType::RealType>(random->GetUniformVariate(.3, 1.0)));
blueChannel.push_back(static_cast<ColormapType::RealType>(random->GetUniformVariate(.3, 1.0)));
}
colormap->SetRedChannel(redChannel);
colormap->SetGreenChannel(greenChannel);
colormap->SetBlueChannel(blueChannel);
}