diff --git a/Examples/FeatureExtraction/ExtractRoadByStepsExample.cxx b/Examples/FeatureExtraction/ExtractRoadByStepsExample.cxx index ea3abe7ed61f2bb687c1f5690f3091d8cfa2c9fc..dd66a2e9bcce47f435163aa8fbf431ef4f5231dc 100644 --- a/Examples/FeatureExtraction/ExtractRoadByStepsExample.cxx +++ b/Examples/FeatureExtraction/ExtractRoadByStepsExample.cxx @@ -383,12 +383,10 @@ int main(int itkNotUsed(argc), char * argv[]) // Software Guide : BeginCodeSnippet InternalImageType::Pointer output = InternalImageType::New(); - output->SetRegions(multispectralReader->GetOutput() - ->GetLargestPossibleRegion()); + output->CopyInformation(multispectralReader->GetOutput()); + output->SetRegions(output->GetLargestPossibleRegion()); output->Allocate(); output->FillBuffer(0.0); - output->SetOrigin(multispectralReader->GetOutput()->GetOrigin()); - output->SetSpacing(multispectralReader->GetOutput()->GetSpacing()); // Software Guide : EndCodeSnippet // Software Guide : BeginLatex diff --git a/Examples/FeatureExtraction/ExtractRoadExample.cxx b/Examples/FeatureExtraction/ExtractRoadExample.cxx index 29c670809c82d95339f5667b6ecc88648b4e55e4..d35ac2a92453f05507df9af2a99adb44b575a117 100644 --- a/Examples/FeatureExtraction/ExtractRoadExample.cxx +++ b/Examples/FeatureExtraction/ExtractRoadExample.cxx @@ -286,7 +286,8 @@ int main(int argc, char * argv[]) // Software Guide : BeginCodeSnippet reader->GenerateOutputInformation(); InputImageType::Pointer blackBackground = InputImageType::New(); - blackBackground->SetRegions(reader->GetOutput()->GetLargestPossibleRegion()); + blackBackground->CopyInformation(reader->GetOutput()); + blackBackground->SetRegions(blackBackground->GetLargestPossibleRegion()); blackBackground->Allocate(); blackBackground->FillBuffer(0); // Software Guide : EndCodeSnippet diff --git a/Testing/Code/FeatureExtraction/otbRoadExtractionFilter.cxx b/Testing/Code/FeatureExtraction/otbRoadExtractionFilter.cxx index 34bde2590527c00bd9ca302ac12b32b923c2ec94..44781be9b577c80a55091a95ec1a536f1596b9aa 100644 --- a/Testing/Code/FeatureExtraction/otbRoadExtractionFilter.cxx +++ b/Testing/Code/FeatureExtraction/otbRoadExtractionFilter.cxx @@ -80,7 +80,8 @@ int otbRoadExtractionFilter(int itkNotUsed(argc), char * argv[]) reader->GenerateOutputInformation(); OutputImageType::Pointer image = OutputImageType::New(); - image->SetRegions(reader->GetOutput()->GetLargestPossibleRegion()); + image->CopyInformation(reader->GetOutput()); + image->SetRegions(image->GetLargestPossibleRegion()); image->Allocate(); image->FillBuffer(0);