int
main(int argc, char * argv[])
{
if (argc != 3)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << " <InputFileName> <OutputFileName>" << std::endl;
return EXIT_FAILURE;
}
using PixelType = unsigned char;
const auto input = itk::ReadImage<ImageType>(argv[1]);
ColormapType::ChannelType redChannel;
ColormapType::ChannelType greenChannel;
ColormapType::ChannelType blueChannel;
random->SetSeed(0);
for (unsigned int i = 0; i < 255; ++i)
{
redChannel.push_back(static_cast<ColormapType::RealType>(random->GetUniformVariate(0., 1.0)));
greenChannel.push_back(static_cast<ColormapType::RealType>(random->GetUniformVariate(0., 1.0)));
blueChannel.push_back(static_cast<ColormapType::RealType>(random->GetUniformVariate(0., 1.0)));
}
colormap->SetRedChannel(redChannel);
colormap->SetGreenChannel(greenChannel);
colormap->SetBlueChannel(blueChannel);
colormapFilter1->SetInput(input);
colormapFilter1->SetColormap(colormap);
try
{
}
{
std::cerr << "Error: " << error << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}