otbThresholdImageToPointSetFilter.h 3.22 KB
Newer Older
Patrick Imbo's avatar
Patrick Imbo committed
1
2
/*=========================================================================

Patrick Imbo's avatar
nomsg    
Patrick Imbo committed
3
4
5
6
7
8
9
10
11
12
  Program:   ORFEO Toolbox
  Language:  C++
  Date:      $Date$
  Version:   $Revision$


  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
  See OTBCopyright.txt for details.


13
14
     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
Patrick Imbo's avatar
nomsg    
Patrick Imbo committed
15
     PURPOSE.  See the above copyright notices for more information.
Patrick Imbo's avatar
Patrick Imbo committed
16
17
18
19
20
21
22
23
24
25
26

=========================================================================*/
#ifndef __otbThresholdImageToPointSetFilter_h
#define __otbThresholdImageToPointSetFilter_h

#include "otbImageToPointSetFilter.h"
#include "itkPointSet.h"

namespace otb
{

Patrick Imbo's avatar
Patrick Imbo committed
27
/** \class ThresholdImageToPointSetFilter
28
 * \brief Produce a PointSet according to filtering conditions
Patrick Imbo's avatar
Patrick Imbo committed
29
30
31
 *
 */

32
template <class TInputImage,
33
class TOutputPointSet = itk::PointSet<ITK_TYPENAME TInputImage::PixelType,2> >
34
class ITK_EXPORT ThresholdImageToPointSetFilter :
35
      public ImageToPointSetFilter< TInputImage,TOutputPointSet >
Patrick Imbo's avatar
Patrick Imbo committed
36
37
38
{
public:

39
  itkStaticConstMacro(    InputImageDimension,
40
                          unsigned int,
41
                          TInputImage::ImageDimension);
Patrick Imbo's avatar
Patrick Imbo committed
42
43
44
45

  typedef TInputImage     InputImageType;

  typedef ThresholdImageToPointSetFilter                             Self;
46
47
  typedef ImageToPointSetFilter< InputImageType, TOutputPointSet>    Superclass;
  typedef typename Superclass::OutputPointSetType                    OutputPointSetType;
Patrick Imbo's avatar
Patrick Imbo committed
48
49
50
51
52
53
  typedef itk::SmartPointer<Self>                                    Pointer;
  typedef itk::SmartPointer<const Self>                              ConstPointer;

  itkNewMacro(Self);

  itkTypeMacro(ThresholdImageToPointSetFilter, ImageToPointSetFilter);
54

Patrick Imbo's avatar
Patrick Imbo committed
55
56
  typedef typename Superclass::InputImagePixelType        InputPixelType;
  typedef typename Superclass::InputImagePointer          InputImagePointer;
57
  typedef typename Superclass::InputImageRegionType       InputImageRegionType;
Patrick Imbo's avatar
Patrick Imbo committed
58
59
60
61
  typedef typename Superclass::InputImageConstPointer     InputImageConstPointer;
  typedef typename Superclass::InputImageType::SizeType   SizeType;
  typedef typename Superclass::InputImageType::IndexType  IndexType;

62
63
64
  typedef typename Superclass::OutputPointSetPointer          OutputPointSetPointer;
  typedef typename Superclass::OutputPointSetType::PixelType  OutputPointSetPixelType;
  typedef typename Superclass::PointsContainerType            PointsContainerType;
Patrick Imbo's avatar
Patrick Imbo committed
65

66
67
68
69
  itkSetMacro(LowerThreshold,InputPixelType);
  itkGetConstReferenceMacro(LowerThreshold, InputPixelType);
  itkSetMacro(UpperThreshold,InputPixelType);
  itkGetConstReferenceMacro(UpperThreshold, InputPixelType);
Patrick Imbo's avatar
Patrick Imbo committed
70
71
72
73
74

protected:
  ThresholdImageToPointSetFilter();
  virtual ~ThresholdImageToPointSetFilter() {};

75
  virtual void ThreadedGenerateData(const InputImageRegionType &inputRegionForThread, int threadId);
76

Patrick Imbo's avatar
Patrick Imbo committed
77
78
79
80
81
82
  void PrintSelf(std::ostream& os, itk::Indent indent) const;

private:
  ThresholdImageToPointSetFilter(const Self&); //purposely not implemented
  void operator=(const Self&); //purposely not implemented

83
84
  InputPixelType m_LowerThreshold;
  InputPixelType m_UpperThreshold;
Patrick Imbo's avatar
Patrick Imbo committed
85
86
87
88
89
90
91
};
} // end namespace otb

#ifndef OTB_MANUAL_INSTANTIATION
#include "otbThresholdImageToPointSetFilter.txx"
#endif

92

Patrick Imbo's avatar
Patrick Imbo committed
93
#endif