Skip to content
Snippets Groups Projects
Commit ce51ec69 authored by Julien Michel's avatar Julien Michel
Browse files

COMP: Fixing a compilation error appearing on ITK 3.10.1

parent 28c5b95c
Branches
Tags
No related merge requests found
...@@ -36,17 +36,13 @@ int otbPolygonCompacityFunctor( int argc, char * argv[] ) ...@@ -36,17 +36,13 @@ int otbPolygonCompacityFunctor( int argc, char * argv[] )
{ {
if(argc !=3 ) if(argc !=3 )
{ {
std::cout << "Usage: " << argv[0] ; std::cout << "Usage: " << argv[0] ;
std::cout << " inputImage outputFile" << std::endl; std::cout << " inputImage outputFile" << std::endl;
return 1; return 1;
} }
// In the 3.10.1 ITK version, the itk::ConnectedComponentImageFilter filter has changed.
// TODO: change reference output
// typedef itk::RGBPixel<unsigned char> InputPixelType;
typedef unsigned char InputPixelType; typedef unsigned char InputPixelType;
typedef unsigned short LabelPixelType;//FIXME doesn't seem to work with long int (64 bits problem ?) typedef unsigned short LabelPixelType;//FIXME doesn't seem to work with long int (64 bits problem ?)
typedef otb::Image<InputPixelType,2> InputImageType; typedef otb::Image<InputPixelType,2> InputImageType;
...@@ -72,7 +68,7 @@ int otbPolygonCompacityFunctor( int argc, char * argv[] ) ...@@ -72,7 +68,7 @@ int otbPolygonCompacityFunctor( int argc, char * argv[] )
PolygonListType::Pointer polygonList = PolygonListType::New(); PolygonListType::Pointer polygonList = PolygonListType::New();
for(LabelPixelType label = 1; label<=connectedComponentsFilter->GetObjectCount();++label) for(LabelPixelType label = 1; label<=connectedComponentsFilter->GetObjectCount();++label)
{ {
std::cerr << "."; std::cerr << ".";
PolygonFilterType::Pointer polygonFilter = PolygonFilterType::New(); PolygonFilterType::Pointer polygonFilter = PolygonFilterType::New();
polygonFilter->SetInput(connectedComponentsFilter->GetOutput()); polygonFilter->SetInput(connectedComponentsFilter->GetOutput());
...@@ -80,7 +76,7 @@ int otbPolygonCompacityFunctor( int argc, char * argv[] ) ...@@ -80,7 +76,7 @@ int otbPolygonCompacityFunctor( int argc, char * argv[] )
polygonFilter->Update(); polygonFilter->Update();
polygonList->PushBack(polygonFilter->GetOutput()); polygonList->PushBack(polygonFilter->GetOutput());
} }
typedef otb::PolygonCompacityFunctor<PolygonType::Pointer> CompatityFunctorType; typedef otb::PolygonCompacityFunctor<PolygonType::Pointer> CompatityFunctorType;
typedef otb::UnaryFunctorObjectListBooleanFilter<PolygonListType,PolygonListType,CompatityFunctorType> CompatityFilterType; typedef otb::UnaryFunctorObjectListBooleanFilter<PolygonListType,PolygonListType,CompatityFunctorType> CompatityFilterType;
...@@ -100,16 +96,16 @@ int otbPolygonCompacityFunctor( int argc, char * argv[] ) ...@@ -100,16 +96,16 @@ int otbPolygonCompacityFunctor( int argc, char * argv[] )
for(PolygonListIteratorType pIt = compacityFilter->GetOutput()->Begin(); for(PolygonListIteratorType pIt = compacityFilter->GetOutput()->Begin();
pIt!=compacityFilter->GetOutput()->End(); pIt!=compacityFilter->GetOutput()->End();
++pIt) ++pIt)
{ {
file<< "--- New Polygon ---" << std::endl; file<< "--- New Polygon ---" << std::endl;
PolygonType::Pointer polygon=pIt.Get(); PolygonType::Pointer polygon=pIt.Get();
IteratorType it; IteratorType it;
for(it=polygon->GetVertexList()->Begin();it!=polygon->GetVertexList()->End();++it) for(it=polygon->GetVertexList()->Begin();it!=polygon->GetVertexList()->End();++it)
{ {
file<<it.Value()<<std::endl; file<<it.Value()<<std::endl;
}
} }
}
file.close(); file.close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment