Skip to content
Snippets Groups Projects
Commit 96234fe5 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

ENH: Preparation of the NCC example for software guide output

parent f319f5da
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,10 @@
#include "itkWarpImageFilter.h"
// Software Guide : EndCodeSnippet
#include "otbImageOfVectorsToMonoChannelExtractROI.h"
#include "itkRescaleIntensityImageFilter.h"
#include "itkCastImageFilter.h"
#include <iostream>
......@@ -73,6 +77,8 @@ int main(int argc, char** argv )
typedef double CoordinateRepresentationType;
typedef unsigned char OutputPixelType;
typedef otb::Image<OutputPixelType,ImageDimension> OutputImageType;
// Software Guide : BeginLatex
//
......@@ -187,11 +193,24 @@ int main(int argc, char** argv )
// Software Guide : EndCodeSnippet
typedef otb::ImageFileWriter< DeformationFieldType > DFWriterType;
typedef otb::ImageOfVectorsToMonoChannelExtractROI<DeformationFieldType, MovingImageType> ChannelExtractionFilterType;
ChannelExtractionFilterType::Pointer channelExtractor = ChannelExtractionFilterType::New();
channelExtractor->SetInput(registrator->GetOutput());
channelExtractor->SetChannel(1);
typedef itk::RescaleIntensityImageFilter<MovingImageType, OutputImageType> RescalerType;
RescalerType::Pointer fieldRescaler = RescalerType::New();
fieldRescaler->SetInput(channelExtractor->GetOutput());
fieldRescaler->SetOutputMaximum(255);
fieldRescaler->SetOutputMinimum(0);
typedef otb::ImageFileWriter< OutputImageType > DFWriterType;
DFWriterType::Pointer dfWriter = DFWriterType::New();
dfWriter->SetFileName(argv[3]);
dfWriter->SetInput( registrator->GetOutput() );
dfWriter->SetInput( fieldRescaler->GetOutput() );
dfWriter->Update();
......@@ -204,11 +223,17 @@ int main(int argc, char** argv )
warper->SetDeformationField( registrator->GetOutput() );
warper->SetEdgePaddingValue( padValue );
typedef otb::ImageFileWriter< MovingImageType > WriterType;
typedef itk::CastImageFilter< MovingImageType, OutputImageType > CastFilterType;
CastFilterType::Pointer caster = CastFilterType::New();
caster->SetInput( warper->GetOutput() );
typedef otb::ImageFileWriter< OutputImageType > WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(argv[4]);
writer->SetInput( warper->GetOutput() );
writer->SetInput( caster->GetOutput() );
writer->Update();
// Software Guide : BeginLatex
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment