Commit ada56381 authored by Julien Michel's avatar Julien Michel
Browse files

STY: Remove commented code refering to removed class

No related merge requests found
Showing with 1 addition and 228 deletions
+1 -228
...@@ -98,12 +98,10 @@ int otbMulti3DMapToDEMFilterEPSG(int argc, char* argv[]) ...@@ -98,12 +98,10 @@ int otbMulti3DMapToDEMFilterEPSG(int argc, char* argv[])
for(unsigned int i=0; i<mapSize; i++) for(unsigned int i=0; i<mapSize; i++)
{ {
multiFilter->Set3DMapInput(i,mapReaderList->GetNthElement(i)->GetOutput()); multiFilter->Set3DMapInput(i,mapReaderList->GetNthElement(i)->GetOutput());
// multiFilter->SetMapKeywordList(i,mapReaderList->GetNthElement(i)->GetOutput()->GetImageKeywordlist());
multiFilter->SetMaskInput(i,maskReaderList->GetNthElement(i)->GetOutput()); multiFilter->SetMaskInput(i,maskReaderList->GetNthElement(i)->GetOutput());
} }
//set output parameters //set output parameters
// multiFilter->SetOutputParametersFrom3DMap();
VectorImageType::IndexType start; VectorImageType::IndexType start;
start[0] = atoi(argv[argc-9]); start[0] = atoi(argv[argc-9]);
start[1] = atoi(argv[argc-8]); start[1] = atoi(argv[argc-8]);
...@@ -132,7 +130,6 @@ int otbMulti3DMapToDEMFilterEPSG(int argc, char* argv[]) ...@@ -132,7 +130,6 @@ int otbMulti3DMapToDEMFilterEPSG(int argc, char* argv[])
WriterType::Pointer writer = WriterType::New(); WriterType::Pointer writer = WriterType::New();
multiFilter->SetNumberOfThreads(atoi(argv[argc-11])); multiFilter->SetNumberOfThreads(atoi(argv[argc-11]));
//multiFilter->Update();
writer->SetInput(multiFilter->GetOutput()); writer->SetInput(multiFilter->GetOutput());
...@@ -141,153 +138,6 @@ int otbMulti3DMapToDEMFilterEPSG(int argc, char* argv[]) ...@@ -141,153 +138,6 @@ int otbMulti3DMapToDEMFilterEPSG(int argc, char* argv[])
writer->Update(); writer->Update();
return EXIT_SUCCESS; return EXIT_SUCCESS;
/*
if (argc != 12)
{
std::cout << argv[0] <<
" <input filename> <output filename> <origin easting> <origin northing> <x size> <y size> <x spacing> <y spacing> <UTM zone> <UTM hemisphere>"
<< std::endl;
return EXIT_FAILURE;
}
typedef otb::VectorImage<double, 2> VectorImageType;
typedef otb::ImageFileReader<VectorImageType> ReaderType;
typedef otb::ImageFileWriter<VectorImageType> WriterType;
typedef otb::UtmInverseProjection UtmMapProjectionType;
typedef otb::OrthoRectificationFilter<VectorImageType, VectorImageType, UtmMapProjectionType> OrthoRectifFilterType;
//Allocate pointer
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
OrthoRectifFilterType::Pointer orthoRectifFilter = OrthoRectifFilterType::New();
UtmMapProjectionType::Pointer utmMapProjection = UtmMapProjectionType::New();
// Set parameters ...
reader->SetFileName(argv[1]);
writer->SetFileName(argv[2]);
reader->GenerateOutputInformation();
std::cout << reader->GetOutput() << std::endl;
orthoRectifFilter->SetInput(reader->GetOutput());
VectorImageType::IndexType start;
start[0] = 0;
start[1] = 0;
orthoRectifFilter->SetOutputStartIndex(start);
VectorImageType::SizeType size;
size[0] = atoi(argv[5]); // X size
size[1] = atoi(argv[6]); //Y size
orthoRectifFilter->SetOutputSize(size);
VectorImageType::SpacingType spacing;
spacing[0] = atof(argv[7]);
spacing[1] = atof(argv[8]);
orthoRectifFilter->SetOutputSpacing(spacing);
VectorImageType::PointType origin;
origin[0] = strtod(argv[3], NULL); //Origin easting
origin[1] = strtod(argv[4], NULL); //Origin northing
orthoRectifFilter->SetOutputOrigin(origin);
utmMapProjection->SetZone(atoi(argv[9]));
utmMapProjection->SetHemisphere(argv[10][0]);
orthoRectifFilter->SetMapProjection(utmMapProjection);
// Deformation Field spacing
VectorImageType::SpacingType gridSpacing;
gridSpacing[0] = atof(argv[11]);
gridSpacing[1] = -atof(argv[11]);
orthoRectifFilter->SetDeformationFieldSpacing(gridSpacing);
VectorImageType::PixelType no_data(reader->GetOutput()->GetNumberOfComponentsPerPixel());
no_data.Fill(0);
orthoRectifFilter->SetEdgePaddingValue(no_data);
writer->SetInput(orthoRectifFilter->GetOutput());
writer->SetNumberOfDivisionsTiledStreaming(4);
writer->Update();
return EXIT_SUCCESS; */
/*
if (argc != 12)
{
std::cout << argv[0] <<
" <input filename> <output filename> <origin easting> <origin northing> <x size> <y size> <x spacing> <y spacing> <UTM zone> <UTM hemisphere>"
<< std::endl;
return EXIT_FAILURE;
}
typedef otb::VectorImage<double, 2> VectorImageType;
typedef otb::ImageFileReader<VectorImageType> ReaderType;
typedef otb::ImageFileWriter<VectorImageType> WriterType;
typedef otb::UtmInverseProjection UtmMapProjectionType;
typedef otb::OrthoRectificationFilter<VectorImageType, VectorImageType, UtmMapProjectionType> OrthoRectifFilterType;
//Allocate pointer
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
OrthoRectifFilterType::Pointer orthoRectifFilter = OrthoRectifFilterType::New();
UtmMapProjectionType::Pointer utmMapProjection = UtmMapProjectionType::New();
// Set parameters ...
reader->SetFileName(argv[1]);
writer->SetFileName(argv[2]);
reader->GenerateOutputInformation();
std::cout << reader->GetOutput() << std::endl;
orthoRectifFilter->SetInput(reader->GetOutput());
VectorImageType::IndexType start;
start[0] = 0;
start[1] = 0;
orthoRectifFilter->SetOutputStartIndex(start);
VectorImageType::SizeType size;
size[0] = atoi(argv[5]); // X size
size[1] = atoi(argv[6]); //Y size
orthoRectifFilter->SetOutputSize(size);
VectorImageType::SpacingType spacing;
spacing[0] = atof(argv[7]);
spacing[1] = atof(argv[8]);
orthoRectifFilter->SetOutputSpacing(spacing);
VectorImageType::PointType origin;
origin[0] = strtod(argv[3], NULL); //Origin easting
origin[1] = strtod(argv[4], NULL); //Origin northing
orthoRectifFilter->SetOutputOrigin(origin);
utmMapProjection->SetZone(atoi(argv[9]));
utmMapProjection->SetHemisphere(argv[10][0]);
orthoRectifFilter->SetMapProjection(utmMapProjection);
// Deformation Field spacing
VectorImageType::SpacingType gridSpacing;
gridSpacing[0] = atof(argv[11]);
gridSpacing[1] = -atof(argv[11]);
orthoRectifFilter->SetDeformationFieldSpacing(gridSpacing);
VectorImageType::PixelType no_data(reader->GetOutput()->GetNumberOfComponentsPerPixel());
no_data.Fill(0);
orthoRectifFilter->SetEdgePaddingValue(no_data);
writer->SetInput(orthoRectifFilter->GetOutput());
writer->SetNumberOfDivisionsTiledStreaming(4);
writer->Update();
return EXIT_SUCCESS; */
} }
int otbMulti3DMapToDEMFilterManual(int argc, char* argv[]) int otbMulti3DMapToDEMFilterManual(int argc, char* argv[])
...@@ -354,12 +204,10 @@ multiFilter->SetCellFusionMode(fusionMode); ...@@ -354,12 +204,10 @@ multiFilter->SetCellFusionMode(fusionMode);
for(unsigned int i=0; i<mapSize; i++) for(unsigned int i=0; i<mapSize; i++)
{ {
multiFilter->Set3DMapInput(i,mapReaderList->GetNthElement(i)->GetOutput()); multiFilter->Set3DMapInput(i,mapReaderList->GetNthElement(i)->GetOutput());
// multiFilter->SetMapKeywordList(i,mapReaderList->GetNthElement(i)->GetOutput()->GetImageKeywordlist());
multiFilter->SetMaskInput(i,maskReaderList->GetNthElement(i)->GetOutput()); multiFilter->SetMaskInput(i,maskReaderList->GetNthElement(i)->GetOutput());
} }
//set output parameters //set output parameters
//multiFilter->SetOutputParametersFrom3DMap();
VectorImageType::IndexType start; VectorImageType::IndexType start;
start[0] = atoi(argv[argc-7]); start[0] = atoi(argv[argc-7]);
start[1] = atoi(argv[argc-8]); start[1] = atoi(argv[argc-8]);
...@@ -385,7 +233,6 @@ multiFilter->SetOutputOrigin(origin); ...@@ -385,7 +233,6 @@ multiFilter->SetOutputOrigin(origin);
WriterType::Pointer writer = WriterType::New(); WriterType::Pointer writer = WriterType::New();
multiFilter->SetNumberOfThreads(atoi(argv[argc-10])); multiFilter->SetNumberOfThreads(atoi(argv[argc-10]));
//multiFilter->Update();
writer->SetInput(multiFilter->GetOutput()); writer->SetInput(multiFilter->GetOutput());
...@@ -395,79 +242,6 @@ writer->Update(); ...@@ -395,79 +242,6 @@ writer->Update();
return EXIT_SUCCESS; return EXIT_SUCCESS;
/*
if (argc != 12)
{
std::cout << argv[0] <<
" <input filename> <output filename> <origin easting> <origin northing> <x size> <y size> <x spacing> <y spacing> <UTM zone> <UTM hemisphere>"
<< std::endl;
return EXIT_FAILURE;
}
typedef otb::VectorImage<double, 2> VectorImageType;
typedef otb::ImageFileReader<VectorImageType> ReaderType;
typedef otb::ImageFileWriter<VectorImageType> WriterType;
typedef otb::UtmInverseProjection UtmMapProjectionType;
typedef otb::OrthoRectificationFilter<VectorImageType, VectorImageType, UtmMapProjectionType> OrthoRectifFilterType;
//Allocate pointer
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
OrthoRectifFilterType::Pointer orthoRectifFilter = OrthoRectifFilterType::New();
UtmMapProjectionType::Pointer utmMapProjection = UtmMapProjectionType::New();
// Set parameters ...
reader->SetFileName(argv[1]);
writer->SetFileName(argv[2]);
reader->GenerateOutputInformation();
std::cout << reader->GetOutput() << std::endl;
orthoRectifFilter->SetInput(reader->GetOutput());
VectorImageType::IndexType start;
start[0] = 0;
start[1] = 0;
orthoRectifFilter->SetOutputStartIndex(start);
VectorImageType::SizeType size;
size[0] = atoi(argv[5]); // X size
size[1] = atoi(argv[6]); //Y size
orthoRectifFilter->SetOutputSize(size);
VectorImageType::SpacingType spacing;
spacing[0] = atof(argv[7]);
spacing[1] = atof(argv[8]);
orthoRectifFilter->SetOutputSpacing(spacing);
VectorImageType::PointType origin;
origin[0] = strtod(argv[3], NULL); //Origin easting
origin[1] = strtod(argv[4], NULL); //Origin northing
orthoRectifFilter->SetOutputOrigin(origin);
utmMapProjection->SetZone(atoi(argv[9]));
utmMapProjection->SetHemisphere(argv[10][0]);
orthoRectifFilter->SetMapProjection(utmMapProjection);
// Deformation Field spacing
VectorImageType::SpacingType gridSpacing;
gridSpacing[0] = atof(argv[11]);
gridSpacing[1] = -atof(argv[11]);
orthoRectifFilter->SetDeformationFieldSpacing(gridSpacing);
VectorImageType::PixelType no_data(reader->GetOutput()->GetNumberOfComponentsPerPixel());
no_data.Fill(0);
orthoRectifFilter->SetEdgePaddingValue(no_data);
writer->SetInput(orthoRectifFilter->GetOutput());
writer->SetNumberOfDivisionsTiledStreaming(4);
writer->Update();
return EXIT_SUCCESS; */
} }
...@@ -529,7 +303,7 @@ int otbMulti3DMapToDEMFilter(int argc, char* argv[]) ...@@ -529,7 +303,7 @@ int otbMulti3DMapToDEMFilter(int argc, char* argv[])
for(unsigned int i=0; i<mapSize; i++) for(unsigned int i=0; i<mapSize; i++)
{ {
multiFilter->Set3DMapInput(i,mapReaderList->GetNthElement(i)->GetOutput()); multiFilter->Set3DMapInput(i,mapReaderList->GetNthElement(i)->GetOutput());
// multiFilter->SetMapKeywordList(i,mapReaderList->GetNthElement(i)->GetOutput()->GetImageKeywordlist());
multiFilter->SetMaskInput(i,maskReaderList->GetNthElement(i)->GetOutput()); multiFilter->SetMaskInput(i,maskReaderList->GetNthElement(i)->GetOutput());
} }
multiFilter->SetOutputParametersFrom3DMap(); multiFilter->SetOutputParametersFrom3DMap();
...@@ -537,7 +311,6 @@ int otbMulti3DMapToDEMFilter(int argc, char* argv[]) ...@@ -537,7 +311,6 @@ int otbMulti3DMapToDEMFilter(int argc, char* argv[])
WriterType::Pointer writer = WriterType::New(); WriterType::Pointer writer = WriterType::New();
multiFilter->SetNumberOfThreads(atoi(argv[argc-2])); multiFilter->SetNumberOfThreads(atoi(argv[argc-2]));
//multiFilter->Update();
writer->SetInput(multiFilter->GetOutput()); writer->SetInput(multiFilter->GetOutput());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment