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

Remove LabelImageWriter

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