Commit 9404203f authored by Pierre Lassalle's avatar Pierre Lassalle

Remove LabelImageWriter

parent 60b9057a
...@@ -21,10 +21,6 @@ else() ...@@ -21,10 +21,6 @@ else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif() endif()
#set(GRM_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/)
#include_directories(${GRM_INCLUDE_DIR})
project(OTBGRM) project(OTBGRM)
set(OTBGRM_LIBRARIES OTBGRM) set(OTBGRM_LIBRARIES OTBGRM)
......
...@@ -34,6 +34,7 @@ namespace otb ...@@ -34,6 +34,7 @@ namespace otb
{ {
public: public:
typedef GenericRegionMerging Self; typedef GenericRegionMerging Self;
typedef Application SuperClass;
typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<Self> Pointer;
typedef FloatVectorImageType ImageType; typedef FloatVectorImageType ImageType;
...@@ -83,15 +84,11 @@ namespace otb ...@@ -83,15 +84,11 @@ namespace otb
void DoExecute() void DoExecute()
{ {
// Mandatory parameters // Mandatory parameters
// Input Image // Input Image
ImageType::Pointer image = GetParameterImage("in"); ImageType::Pointer image = GetParameterImage("in");
image->Update(); image->Update();
// Output label file name.
const std::string labelImageFileName = GetParameterString("out");
// Criterion selected // Criterion selected
const std::string selectedCriterion = GetParameterString("criterion"); const std::string selectedCriterion = GetParameterString("criterion");
...@@ -101,8 +98,6 @@ namespace otb ...@@ -101,8 +98,6 @@ namespace otb
const unsigned int niter = GetParameterInt("niter"); const unsigned int niter = GetParameterInt("niter");
const int speed = GetParameterInt("speed"); const int speed = GetParameterInt("speed");
typedef otb::ImageFileWriter<LabelImageType> LabelImageWriter;
if(selectedCriterion == "bs") if(selectedCriterion == "bs")
{ {
const float cw = GetParameterFloat("cw"); const float cw = GetParameterFloat("cw");
...@@ -125,11 +120,7 @@ namespace otb ...@@ -125,11 +120,7 @@ namespace otb
segmenter.Update(); segmenter.Update();
SetParameterOutputImage<LabelImageType>("out", segmenter.GetLabeledClusteredOutput());
LabelImageWriter::Pointer labelWriter = LabelImageWriter::New();
labelWriter->SetFileName(labelImageFileName);
labelWriter->SetInput(segmenter.GetLabeledClusteredOutput());
labelWriter->Update();
} }
else if(selectedCriterion == "ed") else if(selectedCriterion == "ed")
{ {
...@@ -144,10 +135,7 @@ namespace otb ...@@ -144,10 +135,7 @@ namespace otb
segmenter.Update(); segmenter.Update();
LabelImageWriter::Pointer labelWriter = LabelImageWriter::New(); SetParameterOutputImage<LabelImageType>("out", segmenter.GetLabeledClusteredOutput());
labelWriter->SetFileName(labelImageFileName);
labelWriter->SetInput(segmenter.GetLabeledClusteredOutput());
labelWriter->Update();
} }
else if(selectedCriterion == "fls") else if(selectedCriterion == "fls")
{ {
...@@ -162,10 +150,7 @@ namespace otb ...@@ -162,10 +150,7 @@ namespace otb
segmenter.Update(); segmenter.Update();
LabelImageWriter::Pointer labelWriter = LabelImageWriter::New(); SetParameterOutputImage<LabelImageType>("out", segmenter.GetLabeledClusteredOutput());
labelWriter->SetFileName(labelImageFileName);
labelWriter->SetInput(segmenter.GetLabeledClusteredOutput());
labelWriter->Update();
} }
} }
}; };
......
Markdown is supported
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