Commit fc4bcc4e authored by Emmanuel Christophe's avatar Emmanuel Christophe

MRG

parents 5a5dfd9f 0e0ccbac
......@@ -954,17 +954,35 @@ ENDIF(OTB_USE_VISU_GUI)
OPTION(BUILD_EXAMPLES "Build the Examples directory." OFF)
#-----------------------------------------------------------------------------
# The entire OTB tree should use the same include path
# Create the list of include directories needed for OTB header files.
INCLUDE(${OTB_SOURCE_DIR}/otbIncludeDirectories.cmake)
# This should be the only INCLUDE_DIRECTORIES command in the entire
# tree, except for the Utilities and Wrapping directories. We need to
# do this in one place to make sure the order is correct.
INCLUDE_DIRECTORIES(
${OTB_INCLUDE_DIRS_BUILD_TREE}
${OTB_INCLUDE_DIRS_BUILD_TREE_CXX}
${OTB_INCLUDE_DIRS_SYSTEM}
)
#-----------------------------------------------------------------------------
# Dispatch the build into the proper subdirectories.
SUBDIRS(Utilities Code)
#Note: SUBDIRS is deprecated and is replaced by ADD_SUBDIRECTORY
#SUBDIRS(Utilities Code)
ADD_SUBDIRECTORY(Utilities)
ADD_SUBDIRECTORY(Code)
IF (BUILD_EXAMPLES)
SUBDIRS(Examples)
ADD_SUBDIRECTORY(Examples)
ENDIF (BUILD_EXAMPLES)
IF (BUILD_TESTING)
SUBDIRS(Testing)
ADD_SUBDIRECTORY(Testing)
ENDIF (BUILD_TESTING)
#-----------------------------------------------------------------------------
......@@ -1027,16 +1045,16 @@ CONFIGURE_FILE(${OTB_SOURCE_DIR}/otbConfigure.h.in
# The entire OTB tree should use the same include path
# Create the list of include directories needed for OTB header files.
INCLUDE(${OTB_SOURCE_DIR}/otbIncludeDirectories.cmake)
#INCLUDE(${OTB_SOURCE_DIR}/otbIncludeDirectories.cmake)
# This should be the only INCLUDE_DIRECTORIES command in the entire
# tree, except for the Utilities and Wrapping directories. We need to
# do this in one place to make sure the order is correct.
INCLUDE_DIRECTORIES(
${OTB_INCLUDE_DIRS_BUILD_TREE}
${OTB_INCLUDE_DIRS_BUILD_TREE_CXX}
${OTB_INCLUDE_DIRS_SYSTEM}
)
#INCLUDE_DIRECTORIES(
# ${OTB_INCLUDE_DIRS_BUILD_TREE}
# ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX}
# ${OTB_INCLUDE_DIRS_SYSTEM}
#)
#-----------------------------------------------------------------------------
# Uninstall cmake use to uninstall OTB.
......@@ -1108,50 +1126,50 @@ MARK_AS_ADVANCED(OTB_USE_CPACK)
IF(OTB_USE_CPACK)
INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_NAME "OTB" CACHE STRING "Package name")
MARK_AS_ADVANCED(CPACK_PACKAGE_NAME)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Orfeo Toolbox")
MARK_AS_ADVANCED(CPACK_PACKAGE_DESCRIPTION_SUMMARY)
SET(CPACK_PACKAGE_VERSION "${OTB_VERSION_STRING}")
SET(CPACK_PACKAGE_VERSION_MAJOR "${OTB_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${OTB_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${OTB_VERSION_PATCH}")
SET(CPACK_PACKAGE_CONTACT "contact@orfeo-toolbox.org" CACHE STRING "Orfeo toolbox contact email")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Description.txt")
#Debian specific
SET(DEBIAN_PACKAGE_MAINTAINER "debian@orfeo-toolbox.org" CACHE STRING "Debian package maintainer email")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libgdal1-1.5.0 (>= 1.5.1-0), libfltk1.1 (>= 1.1.7-3), libcurl3 (>=7.15.5-1etch1), libfftw3-3 (>=3.1.2-3.1)" CACHE STRING "Debian package dependance" )
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64" CACHE STRING "arch")
MARK_AS_ADVANCED(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
SET(CPACK_DEBIAN_PACKAGE_NAME "libotb" CACHE STRING "Debian package name")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "OrfeoToolbox-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright/OTBCopyright.txt")
FILE(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
FILE(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_DEBIAN_PACKAGE_DESCRIPTION)
IF(WIN32 AND NOT UNIX AND NOT CYGWIN)
#Find gdal dll files, localized in the GDAL_LIBRARY directory
GET_FILENAME_COMPONENT(GDAL_LIB_DIR "${GDAL_LIBRARY}" PATH )
SET(GDAL_LIB_DIR "${GDAL_LIB_DIR}/" )
INSTALL(DIRECTORY ${GDAL_LIB_DIR}
DESTINATION bin
FILES_MATCHING PATTERN "*.dll" )
INSTALL(DIRECTORY ${GDAL_LIB_DIR}
DESTINATION lib
FILES_MATCHING PATTERN "*.lib" )
ENDIF(WIN32 AND NOT UNIX AND NOT CYGWIN)
INCLUDE(CPack)
INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_NAME "OTB" CACHE STRING "Package name")
MARK_AS_ADVANCED(CPACK_PACKAGE_NAME)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Orfeo Toolbox")
MARK_AS_ADVANCED(CPACK_PACKAGE_DESCRIPTION_SUMMARY)
SET(CPACK_PACKAGE_VERSION "${OTB_VERSION_STRING}")
SET(CPACK_PACKAGE_VERSION_MAJOR "${OTB_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${OTB_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${OTB_VERSION_PATCH}")
SET(CPACK_PACKAGE_CONTACT "contact@orfeo-toolbox.org" CACHE STRING "Orfeo toolbox contact email")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Description.txt")
#Debian specific
SET(DEBIAN_PACKAGE_MAINTAINER "debian@orfeo-toolbox.org" CACHE STRING "Debian package maintainer email")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libgdal1-1.5.0 (>= 1.5.1-0), libfltk1.1 (>= 1.1.7-3), libcurl3 (>=7.15.5-1etch1), libfftw3-3 (>=3.1.2-3.1)" CACHE STRING "Debian package dependance" )
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64" CACHE STRING "arch")
MARK_AS_ADVANCED(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
SET(CPACK_DEBIAN_PACKAGE_NAME "libotb" CACHE STRING "Debian package name")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "OrfeoToolbox-${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright/OTBCopyright.txt")
FILE(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
FILE(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_DEBIAN_PACKAGE_DESCRIPTION)
IF(WIN32 AND NOT UNIX AND NOT CYGWIN)
#Find gdal dll files, localized in the GDAL_LIBRARY directory
GET_FILENAME_COMPONENT(GDAL_LIB_DIR "${GDAL_LIBRARY}" PATH )
SET(GDAL_LIB_DIR "${GDAL_LIB_DIR}/" )
INSTALL(DIRECTORY ${GDAL_LIB_DIR}
DESTINATION bin
FILES_MATCHING PATTERN "*.dll" )
INSTALL(DIRECTORY ${GDAL_LIB_DIR}
DESTINATION lib
FILES_MATCHING PATTERN "*.lib" )
ENDIF(WIN32 AND NOT UNIX AND NOT CYGWIN)
INCLUDE(CPack)
ENDIF(OTB_USE_CPACK)
......@@ -1165,4 +1183,4 @@ ADD_CUSTOM_COMMAND(
POST_BUILD
COMMAND GenerateConfigProperties
ARGS "${otbconfigfile_DEFAULT}" "${OTB_STREAM_IMAGE_SIZE_TO_ACTIVATE_STREAMING}" "${OTB_STREAM_MAX_SIZE_BUFFER_FOR_STREAMING}"
COMMENT "Generating ${otbconfigfile_DEFAULT}" )
\ No newline at end of file
COMMENT "Generating ${otbconfigfile_DEFAULT}" )
......@@ -55,8 +55,8 @@ public:
/** Some PointSet related typedefs. */
typedef typename Superclass::OutputPointSetType OutputPointSetType;
typedef typename Superclass::OutputPointSetPointer OutputPointSetPointer;
typedef itk::ProcessObject ProcessObjectType;
typedef typename Superclass::PointsContainerType PointsContainerType;
typedef itk::ProcessObject ProcessObjectType;
/** Set the input image of this process object. */
void SetInput(unsigned int idx, const InputImageType *input);
......@@ -71,9 +71,38 @@ public:
protected:
ImageToPointSetFilter();
~ImageToPointSetFilter();
virtual ~ImageToPointSetFilter() {};
void PrintSelf(std::ostream& os, itk::Indent indent) const;
virtual void GenerateData(void);
/** Multi-threading implementation */
typedef std::vector<typename OutputPointSetType::PointsContainer::Pointer> OutputPointsContainerForThreadType;
virtual void BeforeThreadedGenerateData();
virtual void AfterThreadedGenerateData();
virtual int SplitRequestedRegion(int i, int num, InputImageRegionType& splitRegion);
virtual void ThreadedGenerateData(const InputImageRegionType &inputRegionForThread, int threadId);
/** Static function used as a "callback" by the MultiThreader. The threading
* library will call this routine for each thread, which will delegate the
* control to ThreadedGenerateData(). */
static ITK_THREAD_RETURN_TYPE ThreaderCallback( void *arg );
/** Internal structure used for passing image data into the threading library */
struct ThreadStruct
{
Pointer Filter;
};
OutputPointsContainerForThreadType m_PointsContainerPerThread;
/** End Multi-threading implementation */
private:
ImageToPointSetFilter(const ImageToPointSetFilter&); //purposely not implemented
void operator=(const ImageToPointSetFilter&); //purposely not implemented
......
......@@ -41,15 +41,6 @@ ImageToPointSetFilter<TInputImage,TOutputPointSet>
}
/**
*
*/
template <class TInputImage, class TOutputPointSet>
ImageToPointSetFilter<TInputImage,TOutputPointSet>
::~ImageToPointSetFilter()
{
}
/**
*
*/
......@@ -63,6 +54,7 @@ ImageToPointSetFilter<TInputImage,TOutputPointSet>
this->ProcessObjectType::SetNthInput(idx,
const_cast< InputImageType * >(input) );
}
/**
*
*/
......@@ -77,8 +69,6 @@ ImageToPointSetFilter<TInputImage,TOutputPointSet>
const_cast< InputImageType * >(input) );
}
/**
*
*/
......@@ -118,8 +108,6 @@ ImageToPointSetFilter<TInputImage,TOutputPointSet>
Superclass::PrintSelf(os,indent);
}
/**
* copy information from first input to all outputs
* This is a void implementation to prevent the
......@@ -132,6 +120,180 @@ ImageToPointSetFilter<TInputImage,TOutputPointSet>
{
}
/**
* GenerateData
*/
template <class TInputImage, class TOutputPointSet>
void
ImageToPointSetFilter<TInputImage,TOutputPointSet>
::GenerateData(void)
{
// Call a method that can be overridden by a subclass to perform
// some calculations prior to splitting the main computations into
// separate threads
this->BeforeThreadedGenerateData();
// Set up the multithreaded processing
ThreadStruct str;
str.Filter = this;
// Initializing object per thread
typename PointsContainerType::Pointer defaultPointsContainer = PointsContainerType::New();
this->m_PointsContainerPerThread
= OutputPointsContainerForThreadType(this->GetNumberOfThreads(),defaultPointsContainer);
// Setting up multithreader
this->GetMultiThreader()->SetNumberOfThreads(this->GetNumberOfThreads());
this->GetMultiThreader()->SetSingleMethod(this->ThreaderCallback, &str);
// multithread the execution
this->GetMultiThreader()->SingleMethodExecute();
// Call a method that can be overridden by a subclass to perform
// some calculations after all the threads have completed
this->AfterThreadedGenerateData();
}
template <class TInputImage, class TOutputPointSet>
void
ImageToPointSetFilter<TInputImage,TOutputPointSet>
::BeforeThreadedGenerateData(void)
{
// this->AllocateOutputs();
}
template <class TInputImage, class TOutputPointSet>
void
ImageToPointSetFilter<TInputImage,TOutputPointSet>
::AfterThreadedGenerateData(void)
{
// copy the lists to the output
PointsContainerType * outputPointsContainer = this->GetOutput()->GetPoints();
outputPointsContainer->Initialize();
typedef typename PointsContainerType::ConstIterator OutputPointsContainerIterator;
for (unsigned int i=0; i< this->m_PointsContainerPerThread.size(); ++i)
{
if (this->m_PointsContainerPerThread[i].IsNotNull())
{
for (OutputPointsContainerIterator it = this->m_PointsContainerPerThread[i]->Begin();
it != this->m_PointsContainerPerThread[i]->End();
++it)
{
outputPointsContainer->push_back(it.Value());
}
}
}
}
template <class TInputImage, class TOutputPointSet>
void
ImageToPointSetFilter<TInputImage,TOutputPointSet>
::ThreadedGenerateData(const InputImageRegionType&, int)
{
// The following code is equivalent to:
// itkExceptionMacro("subclass should override this method!!!");
// The ExceptionMacro is not used because gcc warns that a
// 'noreturn' function does return
itk::OStringStream message;
message << "itk::ERROR: " << this->GetNameOfClass()
<< "(" << this << "): " << "Subclass should override this method!!!";
itk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str(),ITK_LOCATION);
throw e_;
}
template <class TInputImage, class TOutputPointSet>
ITK_THREAD_RETURN_TYPE
ImageToPointSetFilter<TInputImage,TOutputPointSet>
::ThreaderCallback( void *arg )
{
ThreadStruct *str;
int total, threadId, threadCount;
threadId = ((itk::MultiThreader::ThreadInfoStruct *)(arg))->ThreadID;
threadCount = ((itk::MultiThreader::ThreadInfoStruct *)(arg))->NumberOfThreads;
str = (ThreadStruct *)(((itk::MultiThreader::ThreadInfoStruct *)(arg))->UserData);
// execute the actual method with appropriate output region
// first find out how many pieces extent can be split into.
typename TInputImage::RegionType splitRegion;
total = str->Filter->SplitRequestedRegion(threadId, threadCount,
splitRegion);
if (threadId < total)
{
str->Filter->ThreadedGenerateData(splitRegion, threadId);
}
// else
// {
// otherwise don't use this thread. Sometimes the threads dont
// break up very well and it is just as efficient to leave a
// few threads idle.
// }
return ITK_THREAD_RETURN_VALUE;
}
template <class TInputImage, class TOutputPointSet>
int
ImageToPointSetFilter<TInputImage,TOutputPointSet>
::SplitRequestedRegion(int i, int num, InputImageRegionType& splitRegion)
{
// Get the output pointer
typename InputImageType::ConstPointer inputPtr = this->GetInput();
const typename TInputImage::SizeType& requestedRegionSize
= inputPtr->GetLargestPossibleRegion().GetSize();
int splitAxis;
typename TInputImage::IndexType splitIndex;
typename TInputImage::SizeType splitSize;
// Initialize the splitRegion to the output requested region
splitRegion = inputPtr->GetLargestPossibleRegion();
splitIndex = splitRegion.GetIndex();
splitSize = splitRegion.GetSize();
// split on the outermost dimension available
splitAxis = inputPtr->GetImageDimension() - 1;
while (requestedRegionSize[splitAxis] == 1)
{
--splitAxis;
if (splitAxis < 0)
{ // cannot split
itkDebugMacro(" Cannot Split");
return 1;
}
}
// determine the actual number of pieces that will be generated
typename TInputImage::SizeType::SizeValueType range = requestedRegionSize[splitAxis];
int valuesPerThread = (int)::vcl_ceil(range/(double)num);
int maxThreadIdUsed = (int)::vcl_ceil(range/(double)valuesPerThread) - 1;
// Split the region
if (i < maxThreadIdUsed)
{
splitIndex[splitAxis] += i*valuesPerThread;
splitSize[splitAxis] = valuesPerThread;
}
if (i == maxThreadIdUsed)
{
splitIndex[splitAxis] += i*valuesPerThread;
// last thread needs to process the "rest" dimension being split
splitSize[splitAxis] = splitSize[splitAxis] - i*valuesPerThread;
}
// set the split region ivars
splitRegion.SetIndex( splitIndex );
splitRegion.SetSize( splitSize );
itkDebugMacro(" Split Piece: " << splitRegion );
return maxThreadIdUsed + 1;
}
} // end namespace otb
......
......@@ -38,10 +38,10 @@ class ITK_EXPORT UnaryFunctorObjectListFilter :
{
public:
/** Standard class typedefs. */
typedef UnaryFunctorObjectListFilter Self;
typedef UnaryFunctorObjectListFilter Self;
typedef otb::ObjectListToObjectListFilter<TInputList,TOutputList> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
......@@ -50,12 +50,12 @@ public:
itkTypeMacro(UnaryFunctorObjectListFilter, ObjectListToObjectListFilter);
/** Some typedefs. */
typedef TFunction FunctorType;
typedef TInputList InputListType;
typedef TOutputList OutputListType;
typedef typename TInputList::ConstPointer InputListPointer;
typedef typename TOutputList::Pointer OutputListPointer;
typedef typename TInputList::ConstIterator InputListIterator;
typedef TFunction FunctorType;
typedef TInputList InputListType;
typedef TOutputList OutputListType;
typedef typename TInputList::ConstPointer InputListPointer;
typedef typename TOutputList::Pointer OutputListPointer;
typedef typename TInputList::ConstIterator InputListIterator;
typedef typename TOutputList::ConstIterator OutputListIterator;
......@@ -66,11 +66,12 @@ public:
FunctorType& GetFunctor()
{
return m_Functor;
};
}
const FunctorType& GetFunctor() const
{
return m_Functor;
};
}
/** Set the functor object. This replaces the current Functor with a
* copy of the specified Functor. This allows the user to specify a
......@@ -102,12 +103,6 @@ protected:
virtual void ThreadedGenerateData(unsigned int startIndex, unsigned int stopIndex, int threadId);
/** Internal structure used for passing image data into the threading library */
struct ThreadStruct
{
Pointer Filter;
};
/** End Multi-threading implementation */
private:
......
SUBDIRS(
Common
BasicFilters
IO
ChangeDetection
FeatureExtraction
Learning
MultiScale
DisparityMap
SpatialReasoning
Projections
Radiometry
Fusion
Markov
SARPolarimetry
Testing
)
ADD_SUBDIRECTORY(Common)
ADD_SUBDIRECTORY(BasicFilters)
ADD_SUBDIRECTORY(IO)
ADD_SUBDIRECTORY(ChangeDetection)
ADD_SUBDIRECTORY(FeatureExtraction)
ADD_SUBDIRECTORY(Learning)
ADD_SUBDIRECTORY(MultiScale)
ADD_SUBDIRECTORY(DisparityMap)
ADD_SUBDIRECTORY(SpatialReasoning)
ADD_SUBDIRECTORY(Projections)
ADD_SUBDIRECTORY(Radiometry)
ADD_SUBDIRECTORY(Fusion)
ADD_SUBDIRECTORY(Markov)
ADD_SUBDIRECTORY(SARPolarimetry)
ADD_SUBDIRECTORY(Testing)
IF(OTB_USE_VISU_GUI)
SUBDIRS(Visu Gui Visualization)
ADD_SUBDIRECTORY(Visu)
ADD_SUBDIRECTORY(Gui)
ADD_SUBDIRECTORY(Visualization)
ENDIF(OTB_USE_VISU_GUI)
IF(OTB_USE_PQXX)
SUBDIRS(GeospatialAnalysis)
ADD_SUBDIRECTORY(GeospatialAnalysis)
ENDIF(OTB_USE_PQXX)
IF(OTB_COMPILE_WITH_FULL_WARNING)
......
......@@ -103,9 +103,10 @@ protected:
Pointer Filter;
};
OutputListForThreadType m_ObjectListPerThread;
/** End Multi-threading implementation */
OutputListForThreadType m_ObjectListPerThread;
private:
ObjectListToObjectListFilter(const Self&); //purposely not implemented
......
......@@ -55,9 +55,10 @@ public:
itkTypeMacro(PointSetSource,itk::ProcessObject);
/** Some convenient typedefs. */
typedef itk::DataObject::Pointer DataObjectPointer;
typedef TOutputPointSet OutputPointSetType;
typedef typename OutputPointSetType::Pointer OutputPointSetPointer;
typedef itk::DataObject::Pointer DataObjectPointer;
typedef TOutputPointSet OutputPointSetType;
typedef typename OutputPointSetType::Pointer OutputPointSetPointer;
typedef typename OutputPointSetType::PointsContainer PointsContainerType;
/** Get the point set output of this process object. */
OutputPointSetType * GetOutput(void);
......
......@@ -25,11 +25,11 @@ namespace otb
{
/** \class ThresholdImageToPointSetFilter
* \brief Produce a PointSet according to filtering conditions
*
*/
template <class TInputImage,
// class TOutputPointSet>
class TOutputPointSet = itk::PointSet<ITK_TYPENAME TInputImage::PixelType,2> >
class ITK_EXPORT ThresholdImageToPointSetFilter :
public ImageToPointSetFilter< TInputImage,TOutputPointSet >
......@@ -43,8 +43,8 @@ public:
typedef TInputImage InputImageType;
typedef ThresholdImageToPointSetFilter Self;
typedef ImageToPointSetFilter< InputImageType, TOutputPointSet> Superclass;
typedef typename Superclass::OutputPointSetType OutputPointSetType;
typedef ImageToPointSetFilter< InputImageType, TOutputPointSet> Superclass;
typedef typename Superclass::OutputPointSetType OutputPointSetType;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
......@@ -54,13 +54,14 @@ public:
typedef typename Superclass::InputImagePixelType InputPixelType;
typedef typename Superclass::InputImagePointer InputImagePointer;
typedef typename Superclass::InputImageRegionType InputImageRegionType;
typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
typedef typename Superclass::InputImageType::SizeType SizeType;
typedef typename Superclass::InputImageType::IndexType IndexType;
//typedef typename Superclass::OutputPointSetType OutputPointSetType;
typedef typename Superclass::OutputPointSetPointer OutputPointSetPointer;
typedef typename Superclass::OutputPointSetType::PixelType OutputPointSetPixelType;
typedef typename Superclass::OutputPointSetPointer OutputPointSetPointer;
typedef typename Superclass::OutputPointSetType::PixelType OutputPointSetPixelType;
typedef typename Superclass::PointsContainerType PointsContainerType;
itkSetMacro(LowerThreshold,InputPixelType);
itkGetConstReferenceMacro(LowerThreshold, InputPixelType);
......@@ -71,7 +72,7 @@ protected:
ThresholdImageToPointSetFilter();
virtual ~ThresholdImageToPointSetFilter() {};
virtual void GenerateData();
virtual void ThreadedGenerateData(const InputImageRegionType &inputRegionForThread, int threadId);
void PrintSelf(std::ostream& os, itk::Indent indent) const;
......
......@@ -21,6 +21,8 @@
#include "otbThresholdImageToPointSetFilter.h"
#include "itkImageRegionConstIterator.h"
#include "itkProgressReporter.h"
#include "otbMacro.h"
namespace otb
{
......@@ -33,41 +35,38 @@ ThresholdImageToPointSetFilter<TInputImage, TOutputPointSet>
m_UpperThreshold = itk::NumericTraits<InputPixelType>::max();
}
template <class TInputImage, class TOutputPointSet>
void
ThresholdImageToPointSetFilter<TInputImage, TOutputPointSet>
::GenerateData()
::ThreadedGenerateData(const InputImageRegionType &inputRegionForThread, int threadId)
{
InputImageConstPointer inputPtr = this->GetInput(0);
OutputPointSetPointer outputPtr = this->GetOutput();
unsigned int pointId = 0;
typename OutputPointSetType::PointType position;
otbMsgDevMacro(<< "Processing thread: " << threadId);
this->m_PointsContainerPerThread[threadId] = PointsContainerType::New();
InputImageConstPointer inputPtr = this->GetInput();