#include "itkRescaleIntensityImageFilter.h"
int main(
int argc,
char* argv[])
{
if (argc < 7)
{
std::cerr << "Missing Parameters " << std::endl;
std::cerr << "Usage: " << argv[0];
std::cerr << " inputPanchromatiqueImage inputMultiSpectralImage outputImage outputImagePrinted panchroPrinted msPrinted" << std::endl;
return 1;
}
ReaderVectorType::Pointer readerXS = ReaderVectorType::New();
ReaderType::Pointer readerPAN = ReaderType::New();
readerPAN->SetFileName(argv[1]);
readerXS->SetFileName(argv[2]);
FusionFilterType::Pointer fusion = FusionFilterType::New();
fusion->SetPanInput(readerPAN->GetOutput());
fusion->SetXsInput(readerXS->GetOutput());
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(argv[3]);
writer->SetInput(fusion->GetOutput());
writer->Update();
PrintableImageType::Pointer printable = PrintableImageType::New();
PNGWriterType::Pointer pngwriter = PNGWriterType::New();
printable->SetInput(fusion->GetOutput());
printable->SetChannel(3);
printable->SetChannel(2);
printable->SetChannel(1);
pngwriter->SetFileName(argv[4]);
pngwriter->SetInput(printable->GetOutput());
pngwriter->Update();
PrintableImageType2::Pointer printable2 = PrintableImageType2::New();
printable2->SetInput(readerXS->GetOutput());
printable2->SetChannel(3);
printable2->SetChannel(2);
printable2->SetChannel(1);
pngwriter->SetFileName(argv[6]);
pngwriter->SetInput(printable2->GetOutput());
pngwriter->Update();
VectorCastFilterType::Pointer vectorCastFilter = VectorCastFilterType::New();
PNGWriterType::Pointer pngwriterPan = PNGWriterType::New();
vectorCastFilter->SetInput(readerPAN->GetOutput());
PrintableImageType2::Pointer printable3 = PrintableImageType2::New();
printable3->SetInput(vectorCastFilter->GetOutput());
printable3->SetChannel(1);
printable3->SetChannel(1);
printable3->SetChannel(1);
pngwriterPan->SetFileName(argv[5]);
pngwriterPan->SetInput(printable3->GetOutput());
pngwriterPan->Update();
return EXIT_SUCCESS;
}