Commit e54bbf65 authored by Antoine Regimbeau's avatar Antoine Regimbeau

MRG: Merge branch 'app_register_pipeline' into 'develop'

parents e5a7486f e66491c5
......@@ -172,9 +172,12 @@ private:
void DoExecute() override
{
// Init filters
m_ExtractRefFilter = ExtractROIMonoFilterType::New();
m_ExtractMeasFilter = ExtractROIMonoFilterType::New();
m_CompareFilter = StreamingCompareImageFilterType::New();
ExtractROIMonoFilterType::Pointer extractRefFilter =
ExtractROIMonoFilterType::New();
ExtractROIMonoFilterType::Pointer extractMeasFilter =
ExtractROIMonoFilterType::New();
StreamingCompareImageFilterType::Pointer compareFilter =
StreamingCompareImageFilterType::New();
// Get input image pointers
FloatVectorImageType::Pointer refIm = this->GetParameterImage("ref.in");
......@@ -200,41 +203,37 @@ private:
otbAppLogFATAL( << "ROI is not contained in the images regions");
}
m_ExtractRefFilter->SetInput( refIm );
m_ExtractMeasFilter->SetInput( measIm );
extractRefFilter->SetInput( refIm );
extractMeasFilter->SetInput( measIm );
m_ExtractRefFilter->SetExtractionRegion(region);
m_ExtractMeasFilter->SetExtractionRegion(region);
extractRefFilter->SetExtractionRegion(region);
extractMeasFilter->SetExtractionRegion(region);
// Set channels to extract
otbAppLogINFO( << "reference image channel "<<this->GetParameterInt("ref.channel")<<" is compared with measured image channel "<<this->GetParameterInt("meas.channel"));
m_ExtractRefFilter->SetChannel( this->GetParameterInt("ref.channel") );
m_ExtractMeasFilter->SetChannel( this->GetParameterInt("meas.channel") );
extractRefFilter->SetChannel( this->GetParameterInt("ref.channel") );
extractMeasFilter->SetChannel( this->GetParameterInt("meas.channel") );
// Compute comparison
m_CompareFilter->SetInput1(m_ExtractRefFilter->GetOutput());
m_CompareFilter->SetInput2(m_ExtractMeasFilter->GetOutput());
m_CompareFilter->SetPhysicalSpaceCheck(false);
m_CompareFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram"));
AddProcess(m_CompareFilter->GetStreamer(), "Comparing...");
m_CompareFilter->Update();
compareFilter->SetInput1(extractRefFilter->GetOutput());
compareFilter->SetInput2(extractMeasFilter->GetOutput());
compareFilter->SetPhysicalSpaceCheck(false);
compareFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram"));
AddProcess(compareFilter->GetStreamer(), "Comparing...");
compareFilter->Update();
// Show result
otbAppLogINFO( << "MSE: " << m_CompareFilter->GetMSE() );
otbAppLogINFO( << "MAE: " << m_CompareFilter->GetMAE() );
otbAppLogINFO( << "PSNR: " << m_CompareFilter->GetPSNR() );
otbAppLogINFO( << "Number of Pixel different: " << m_CompareFilter->GetDiffCount() );
SetParameterFloat( "mse",m_CompareFilter->GetMSE());
SetParameterFloat( "mae",m_CompareFilter->GetMAE());
SetParameterFloat( "psnr",m_CompareFilter->GetPSNR());
SetParameterFloat( "count",m_CompareFilter->GetDiffCount());
otbAppLogINFO( << "MSE: " << compareFilter->GetMSE() );
otbAppLogINFO( << "MAE: " << compareFilter->GetMAE() );
otbAppLogINFO( << "PSNR: " << compareFilter->GetPSNR() );
otbAppLogINFO( << "Number of Pixel different: " << compareFilter->GetDiffCount() );
SetParameterFloat( "mse",compareFilter->GetMSE());
SetParameterFloat( "mae",compareFilter->GetMAE());
SetParameterFloat( "psnr",compareFilter->GetPSNR());
SetParameterFloat( "count",compareFilter->GetDiffCount());
RegisterPipeline();
}
ExtractROIMonoFilterType::Pointer m_ExtractRefFilter;
ExtractROIMonoFilterType::Pointer m_ExtractMeasFilter;
StreamingCompareImageFilterType::Pointer m_CompareFilter;
};
}
......
......@@ -72,10 +72,6 @@ private:
AddDocTag("Concatenation");
AddDocTag("Multi-channel");
m_Concatener = ListConcatenerFilterType::New();
m_ExtractorList = ExtractROIFilterListType::New();
m_ImageList = ImageListType::New();
AddParameter(ParameterType_InputImageList, "il", "Input images list");
SetParameterDescription("il", "The list of images to concatenate, must have the same size.");
......@@ -94,15 +90,16 @@ private:
void DoUpdateParameters() override
{
// Nothing to do here for the parameters : all are independent
// Reinitialize the object
m_Concatener = ListConcatenerFilterType::New();
m_ImageList = ImageListType::New();
m_ExtractorList = ExtractROIFilterListType::New();
}
void DoExecute() override
{
ListConcatenerFilterType::Pointer m_Concatener =
ListConcatenerFilterType::New();
ExtractROIFilterListType::Pointer m_ExtractorList =
ExtractROIFilterListType::New();
ImageListType::Pointer m_ImageList =
ImageListType::New();
// Get the input image list
FloatVectorImageListType::Pointer inList = this->GetParameterImageList("il");
......@@ -140,12 +137,8 @@ private:
m_Concatener->SetInput( m_ImageList );
SetParameterOutputImage("out", m_Concatener->GetOutput());
RegisterPipeline();
}
ListConcatenerFilterType::Pointer m_Concatener;
ExtractROIFilterListType::Pointer m_ExtractorList;
ImageListType::Pointer m_ImageList;
};
}
......
......@@ -828,23 +828,21 @@ private:
this->CropRegionOfInterest();
m_ExtractROIFilter = ExtractROIFilterType::New();
m_ExtractROIFilter->SetInput(inImage);
m_ExtractROIFilter->SetStartX(GetParameterInt("startx"));
m_ExtractROIFilter->SetStartY(GetParameterInt("starty"));
m_ExtractROIFilter->SetSizeX(GetParameterInt("sizex"));
m_ExtractROIFilter->SetSizeY(GetParameterInt("sizey"));
ExtractROIFilterType::Pointer extractROIFilter = ExtractROIFilterType::New();
extractROIFilter->SetInput(inImage);
extractROIFilter->SetStartX(GetParameterInt("startx"));
extractROIFilter->SetStartY(GetParameterInt("starty"));
extractROIFilter->SetSizeX(GetParameterInt("sizex"));
extractROIFilter->SetSizeY(GetParameterInt("sizey"));
for (unsigned int idx = 0; idx < GetSelectedItems("cl").size(); ++idx)
{
m_ExtractROIFilter->SetChannel(GetSelectedItems("cl")[idx] + 1 );
extractROIFilter->SetChannel(GetSelectedItems("cl")[idx] + 1 );
}
SetParameterOutputImage("out", m_ExtractROIFilter->GetOutput());
SetParameterOutputImage("out", extractROIFilter->GetOutput());
RegisterPipeline();
}
ExtractROIFilterType::Pointer m_ExtractROIFilter;
};
}
......
......@@ -207,27 +207,29 @@ bool CropRegionOfInterest()
{
InputImageType::Pointer inImage = GetParameterImage("in");
m_ExtractROIFilter = ExtractROIFilterType::New();
m_ResamplingFilter = ShrinkImageFilterType::New();
ExtractROIFilterType::Pointer extractROIFilter =
ExtractROIFilterType::New();
ShrinkImageFilterType::Pointer resamplingFilter =
ShrinkImageFilterType::New();
// The image on which the quicklook will be generated
// Will eventually be the m_ExtractROIFilter output
// Will eventually be the extractROIFilter output
if (HasUserValue("rox") || HasUserValue("roy")
|| HasUserValue("rsx") || HasUserValue("rsy")
|| (GetSelectedItems("cl").size() > 0))
{
m_ExtractROIFilter->SetInput(inImage);
m_ExtractROIFilter->SetStartX(GetParameterInt("rox"));
m_ExtractROIFilter->SetStartY(GetParameterInt("roy"));
m_ExtractROIFilter->SetSizeX(GetParameterInt("rsx"));
m_ExtractROIFilter->SetSizeY(GetParameterInt("rsy"));
extractROIFilter->SetInput(inImage);
extractROIFilter->SetStartX(GetParameterInt("rox"));
extractROIFilter->SetStartY(GetParameterInt("roy"));
extractROIFilter->SetSizeX(GetParameterInt("rsx"));
extractROIFilter->SetSizeY(GetParameterInt("rsy"));
if ((GetSelectedItems("cl").size() > 0))
{
for (unsigned int idx = 0; idx < GetSelectedItems("cl").size(); ++idx)
{
m_ExtractROIFilter->SetChannel(GetSelectedItems("cl")[idx] + 1 );
extractROIFilter->SetChannel(GetSelectedItems("cl")[idx] + 1 );
}
}
else
......@@ -235,14 +237,14 @@ bool CropRegionOfInterest()
unsigned int nbComponents = inImage->GetNumberOfComponentsPerPixel();
for (unsigned int idx = 0; idx < nbComponents; ++idx)
{
m_ExtractROIFilter->SetChannel(idx + 1);
extractROIFilter->SetChannel(idx + 1);
}
}
m_ResamplingFilter->SetInput( m_ExtractROIFilter->GetOutput() );
resamplingFilter->SetInput( extractROIFilter->GetOutput() );
}
else
{
m_ResamplingFilter->SetInput(inImage);
resamplingFilter->SetInput(inImage);
}
unsigned int Ratio = static_cast<unsigned int>(GetParameterInt("sr"));
......@@ -278,15 +280,13 @@ bool CropRegionOfInterest()
}
otbAppLogINFO( << "Ratio used: "<<Ratio << ".");
m_ResamplingFilter->SetShrinkFactor( Ratio );
m_ResamplingFilter->Update();
resamplingFilter->SetShrinkFactor( Ratio );
resamplingFilter->Update();
SetParameterOutputImage("out", m_ResamplingFilter->GetOutput());
SetParameterOutputImage("out", resamplingFilter->GetOutput());
RegisterPipeline();
}
ExtractROIFilterType::Pointer m_ExtractROIFilter;
ShrinkImageFilterType::Pointer m_ResamplingFilter;
};
}
......
......@@ -100,24 +100,25 @@ private:
FloatVectorImageType::Pointer inImage = GetParameterImage("in");
otbAppLogDEBUG( << "Starting Min/Max computation" )
MinMaxFilterType::Pointer minMaxFilter = MinMaxFilterType::New();
minMaxFilter->SetInput( inImage );
minMaxFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram"));
m_MinMaxFilter = MinMaxFilterType::New();
m_MinMaxFilter->SetInput( inImage );
m_MinMaxFilter->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram"));
AddProcess(minMaxFilter->GetStreamer(), "Min/Max computing");
minMaxFilter->Update();
AddProcess(m_MinMaxFilter->GetStreamer(), "Min/Max computing");
m_MinMaxFilter->Update();
otbAppLogDEBUG( << "Min/Max computation done : min=" << m_MinMaxFilter->GetMinimum()
<< " max=" << m_MinMaxFilter->GetMaximum() )
otbAppLogDEBUG( << "Min/Max computation done : min=" << minMaxFilter->GetMinimum()
<< " max=" << minMaxFilter->GetMaximum() )
FloatVectorImageType::PixelType inMin, inMax;
m_RescaleFilter = RescaleImageFilterType::New();
m_RescaleFilter->SetInput( inImage );
m_RescaleFilter->SetAutomaticInputMinMaxComputation(false);
m_RescaleFilter->SetInputMinimum( m_MinMaxFilter->GetMinimum() );
m_RescaleFilter->SetInputMaximum( m_MinMaxFilter->GetMaximum() );
RescaleImageFilterType::Pointer rescaleFilter =
RescaleImageFilterType::New();
rescaleFilter->SetInput( inImage );
rescaleFilter->SetAutomaticInputMinMaxComputation(false);
rescaleFilter->SetInputMinimum( minMaxFilter->GetMinimum() );
rescaleFilter->SetInputMaximum( minMaxFilter->GetMaximum() );
FloatVectorImageType::PixelType outMin, outMax;
outMin.SetSize( inImage->GetNumberOfComponentsPerPixel() );
......@@ -125,15 +126,13 @@ private:
outMin.Fill( GetParameterFloat("outmin") );
outMax.Fill( GetParameterFloat("outmax") );
m_RescaleFilter->SetOutputMinimum( outMin );
m_RescaleFilter->SetOutputMaximum( outMax );
m_RescaleFilter->UpdateOutputInformation();
rescaleFilter->SetOutputMinimum( outMin );
rescaleFilter->SetOutputMaximum( outMax );
rescaleFilter->UpdateOutputInformation();
SetParameterOutputImage("out", m_RescaleFilter->GetOutput());
SetParameterOutputImage("out", rescaleFilter->GetOutput());
RegisterPipeline();
}
RescaleImageFilterType::Pointer m_RescaleFilter;
MinMaxFilterType::Pointer m_MinMaxFilter;
};
}
......
......@@ -103,13 +103,13 @@ private:
ext = itksys::SystemTools::GetFilenameExtension(ofname);
// Set the extract filter input image
m_Filter = FilterType::New();
m_Filter->SetInput(inImage);
FilterType::Pointer filter = FilterType::New();
filter->SetInput(inImage);
for (unsigned int i = 0; i < inImage->GetNumberOfComponentsPerPixel(); ++i)
{
// Set the channel to extract
m_Filter->SetChannel(i+1);
filter->SetChannel(i+1);
// build the current output filename
std::ostringstream oss;
......@@ -129,7 +129,7 @@ private:
// Set the filename of the current output image
paramOut->SetFileName(oss.str());
otbAppLogINFO(<< "File: "<<paramOut->GetFileName() << " will be written.");
paramOut->SetValue(m_Filter->GetOutput());
paramOut->SetValue(filter->GetOutput());
paramOut->SetPixelType(this->GetParameterOutputImagePixelType("out"));
// Add the current level to be written
paramOut->InitializeWriters();
......@@ -140,9 +140,8 @@ private:
// Disable the output Image parameter to avoid writing
// the last image (Application::ExecuteAndWriteOutput method)
DisableParameter("out");
RegisterPipeline();
}
FilterType::Pointer m_Filter;
};
}
}
......
......@@ -95,23 +95,22 @@ private:
itkExceptionMacro("No input Image set...");
}
m_FusionFilter = TileFilterType::New();
TileFilterType::Pointer fusionFilter = TileFilterType::New();
TileFilterType::SizeType layout;
layout[0] = this->GetParameterInt("cols");
layout[1] = this->GetParameterInt("rows");
m_FusionFilter->SetLayout(layout);
fusionFilter->SetLayout(layout);
for (unsigned int i=0; i<(layout[0]*layout[1]); i++)
{
m_FusionFilter->SetInput(i,tileList->GetNthElement(i));
fusionFilter->SetInput(i,tileList->GetNthElement(i));
}
SetParameterOutputImage("out", m_FusionFilter->GetOutput());
SetParameterOutputImage("out", fusionFilter->GetOutput());
RegisterPipeline();
}
TileFilterType::Pointer m_FusionFilter;
};
}
......
......@@ -88,13 +88,14 @@ public:
LabelImageType,
AffineFunctorType> LabelShiftFilterType;
LSMSSegmentation(): m_FinalReader(),m_ImportGeoInformationFilter(),m_FilesToRemoveAfterExecute(),m_TmpDirCleanup(false){}
LSMSSegmentation(): //m_FinalReader(),m_ImportGeoInformationFilter(),
m_FilesToRemoveAfterExecute(),m_TmpDirCleanup(false){}
~LSMSSegmentation() override{}
private:
LabelImageReaderType::Pointer m_FinalReader;
ImportGeoInformationImageFilterType::Pointer m_ImportGeoInformationFilter;
// LabelImageReaderType::Pointer m_FinalReader;
// ImportGeoInformationImageFilterType::Pointer m_ImportGeoInformationFilter;
std::vector<std::string> m_FilesToRemoveAfterExecute;
bool m_TmpDirCleanup;
......@@ -708,20 +709,23 @@ private:
otbAppLogINFO(<<"Elapsed time: "<<(double)(toc - tic) / CLOCKS_PER_SEC<<" seconds");
// Final writing
m_FinalReader = LabelImageReaderType::New();
m_FinalReader->SetFileName(vrtfile);
LabelImageReaderType::Pointer finalReader = LabelImageReaderType::New();
finalReader->SetFileName(vrtfile);
m_ImportGeoInformationFilter = ImportGeoInformationImageFilterType::New();
m_ImportGeoInformationFilter->SetInput(m_FinalReader->GetOutput());
m_ImportGeoInformationFilter->SetSource(imageIn);
ImportGeoInformationImageFilterType::Pointer
importGeoInformationFilter =
ImportGeoInformationImageFilterType::New();
importGeoInformationFilter->SetInput(finalReader->GetOutput());
importGeoInformationFilter->SetSource(imageIn);
SetParameterOutputImage("out",m_ImportGeoInformationFilter->GetOutput());
SetParameterOutputImage("out",importGeoInformationFilter->GetOutput());
RegisterPipeline();
}
void AfterExecuteAndWriteOutputs() override
{
// Release input files
m_FinalReader = ITK_NULLPTR;
// finalReader = ITK_NULLPTR;
if(GetParameterInt("cleanup"))
{
......
......@@ -181,21 +181,21 @@ private:
{
FloatVectorImageType* input = GetParameterImage("in");
m_Filter = MSFilterType::New();
MSFilterType::Pointer filter = MSFilterType::New();
m_Filter->SetInput(input);
filter->SetInput(input);
m_Filter->SetSpatialBandwidth(GetParameterInt("spatialr"));
m_Filter->SetRangeBandwidth(GetParameterFloat("ranger"));
m_Filter->SetThreshold(GetParameterFloat("thres"));
m_Filter->SetMaxIterationNumber(GetParameterInt("maxiter"));
m_Filter->SetRangeBandwidthRamp(GetParameterFloat("rangeramp"));
m_Filter->SetModeSearch(GetParameterInt("modesearch"));
filter->SetSpatialBandwidth(GetParameterInt("spatialr"));
filter->SetRangeBandwidth(GetParameterFloat("ranger"));
filter->SetThreshold(GetParameterFloat("thres"));
filter->SetMaxIterationNumber(GetParameterInt("maxiter"));
filter->SetRangeBandwidthRamp(GetParameterFloat("rangeramp"));
filter->SetModeSearch(GetParameterInt("modesearch"));
//Compute the margin used to ensure exact results (tile wise smoothing)
//This margin is valid for the default uniform kernel used by the
//MeanShiftSmoothing filter (bandwidth equal to radius in this case)
const unsigned int margin = (m_Filter->GetMaxIterationNumber() * m_Filter->GetSpatialBandwidth()) + 1;
const unsigned int margin = (filter->GetMaxIterationNumber() * filter->GetSpatialBandwidth()) + 1;
otbAppLogINFO(<<"Margin of " << margin << " pixels applied to each tile to stabilized mean shift filtering." << std::endl);
......@@ -204,19 +204,18 @@ private:
otbAppLogWARNING(<<"Margin value exceed the input image size." << std::endl);
}
SetParameterOutputImage("fout", m_Filter->GetOutput());
SetParameterOutputImage("fout", filter->GetOutput());
if (IsParameterEnabled("foutpos") && HasValue("foutpos"))
{
SetParameterOutputImage("foutpos", m_Filter->GetSpatialOutput());
SetParameterOutputImage("foutpos", filter->GetSpatialOutput());
}
if(!GetParameterInt("modesearch"))
{
otbAppLogINFO(<<"Mode Search is disabled." << std::endl);
}
RegisterPipeline();
}
MSFilterType::Pointer m_Filter;
};
......
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbDataObjectListInterface_h
#define otbDataObjectListInterface_h
#include "itkDataObject.h"
#include <boost/noncopyable.hpp>
namespace otb
{
class DataObjectListInterface : private boost::noncopyable
{
/** \class DataObjectListInterface
* \brief This non template class is an interface that wrapp ObjectList
*
* New method that do not need the template parameter of ObjectList
* should be declare here.
*
* \ingroup OTBObjectList
*/
public:
/**
Get the nth element of the list as a DataObject *.
*/
virtual itk::DataObject * GetNthDataObject(unsigned int index) const = 0;
virtual std::size_t Size(void) const = 0;
protected:
DataObjectListInterface() = default ;
virtual ~DataObjectListInterface() = default ;
};
} // end of otb namespace
#endif
......@@ -23,6 +23,7 @@
#include <vector>
#include "itkDataObject.h"
#include "otbDataObjectListInterface.h"
#include "itkObjectFactory.h"
namespace otb
......@@ -36,7 +37,7 @@ namespace otb
* \ingroup OTBObjectList
*/
template <class TObject>
class ITK_EXPORT ObjectList : public itk::DataObject
class ITK_EXPORT ObjectList : public itk::DataObject , public DataObjectListInterface
{
public:
/** Standard typedefs */
......@@ -99,6 +100,11 @@ public:
* \return The pointer to the nth element of the list.
*/
ObjectPointerType GetNthElement(unsigned int index) const;
/**
* Get the nth element of the list as a DataObject *.
* \param index The index of the object to get.
*/
Superclass * GetNthDataObject(unsigned int index) const;
/**
* Return the first element of the list.
* \return The first element of the list.
......
......@@ -162,6 +162,16 @@ ObjectList<TObject>
}
return m_InternalContainer[index];
}
template <class TObject>
typename ObjectList<TObject>::Superclass *
ObjectList<TObject>
::GetNthDataObject(unsigned int index) const
{
return dynamic_cast<itk::DataObject *> ( GetNthElement(index).GetPointer() );
}
/**
* Return the first element of the list.
* \return The first element of the list.
......
......@@ -22,6 +22,7 @@
#define otbWrapperApplication_h
#include <string>
#include <set>
#include "otbWrapperTypes.h"
#include "otbWrapperTags.h"
#include "otbWrapperParameterGroup.h"
......@@ -914,6 +915,27 @@ public:
*/
void SetParameterImageBase(const std::string & key, ImageBaseType* img, unsigned int idx = 0);
/**
Register all ProcessObject that are linked to parameters :
\li ParameterType_OutputImage
\li ParameterType_OutputVectorData
Those ProcessObjects are stored in the m_Filters set and are deleted at the
end of ExecuteAndWriteOutput (if there are only held by the set)
This method can be called just before the end of a DoExecute in a derived
class of Application.
*/
void RegisterPipeline();
/**
Register all DataObject that are reachable from :
\li ParameterType_OutputImage
\li ParameterType_OutputVectorData
Once registered, the methode ReleaseData is called on each one of them.
*/
void FreeRessources();
protected:
/** Constructor */
Application();
......@@ -1048,6 +1070,8 @@ private:
* implementation does nothing */
virtual void AfterExecuteAndWriteOutputs();
virtual void DoFreeRessources(){};
Application(const Application &); //purposely not implemented
void operator =(const Application&); //purposely not implemented
......@@ -1059,6 +1083,8 @@ private:
itk::ProcessObject::Pointer m_ProgressSource;
std::string m_ProgressSourceDescription;
std::set<itk::ProcessObject::Pointer> m_Filters;
/** Long name of the application (that can be displayed...) */
std::string m_DocName;
/** Long and precise application description . */
......
......@@ -109,7 +109,6 @@ public:
void ClearValue() override;
protected:
/** Constructor */
InputImageParameter();
......
......@@ -45,6 +45,8 @@
#include "otbWrapperTypes.h"
#include <exception>
#include "itkMacro.h"
#include <stack>
#include <set>
namespace otb
{
......@@ -380,6 +382,213 @@ void Application::UpdateParameters()
void Application::AfterExecuteAndWriteOutputs()
{}
void
Application::RegisterPipeline()
{
std::stack< itk::DataObject * > dataStack;
std::set< itk::DataObject * > inputData;
std::vector<std::string> paramList = GetParametersKeys(true);
// Get both end of the pipeline
for ( auto const & key : paramList )
{
if ( GetParameterType(key) == ParameterType_OutputImage )
{
Parameter* param = GetParameterByKey(key);
OutputImageParameter * outP =
dynamic_cast< OutputImageParameter * >( param );
itk::ImageBase< 2 > * outData = outP->GetValue();
if ( outData )
dataStack.push(outData);
}
else if ( GetParameterType(key) == ParameterType_OutputVectorData )
{
Parameter* param = GetParameterByKey(key);
OutputVectorDataParameter * outP =
dynamic_cast< OutputVectorDataParameter * >( param );
VectorDataType * outData = outP->GetValue();
if ( outData )
dataStack.push(outData);
}
else if ( GetParameterType(key) == ParameterType_InputImage )
{
Parameter* param = GetParameterByKey(key);
InputImageParameter * inP =
dynamic_cast< InputImageParameter * >( param );
if ( !inP->HasValue() )
continue;
ImageBaseType * inData = inP->GetImage< ImageBaseType >();
if ( inData && !inputData.count(inData) )