OTB  6.7.0
Orfeo Toolbox
otbImageFittingPolygonListFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbImageFittingPolygonListFilter_h
22 #define otbImageFittingPolygonListFilter_h
23 
25 #include "otbMacro.h"
26 #include "itkLineConstIterator.h"
27 
28 namespace otb
29 {
39 template <class TPath, class TImage>
41  : public PathListToPathListFilter<TPath>
42 {
43 public:
49 
51  itkNewMacro(Self);
52 
55 
57  typedef typename Superclass::PathType PathType;
58  typedef typename Superclass::PathListType PathListType;
59  typedef typename Superclass::PathPointerType PathPointerType;
60  typedef typename PathListType::Pointer PathListPointerType;
61  typedef typename PathListType::ConstIterator IteratorType;
62  typedef typename PathType::VertexType VertexType;
63  typedef typename PathType::VertexListType VertexListType;
64  typedef typename VertexListType::ConstIterator VertexListConstIteratorType;
65  typedef double RealType;
66 
67  typedef TImage ImageType;
68  typedef typename ImageType::Pointer ImagePointerType;
69  typedef typename ImageType::ConstPointer ImageConstPointerType;
70 
72 
77  void SetInputImage(const ImageType * image);
78 
83  const ImageType * GetInputImage(void);
84 
86  itkSetMacro(Radius, unsigned int);
87  itkGetMacro(Radius, unsigned int);
89 
91  itkSetMacro(NumberOfIterations, unsigned int);
92  itkGetMacro(NumberOfIterations, unsigned int);
94 
95 protected:
98 
101 
103  void GenerateData() override;
104 
106  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
107 
108  virtual double computeValue(ImageConstPointerType image,
109  VertexType middlePoint,
110  VertexType previousPoint,
111  VertexType nextPoint) const;
112 
113  unsigned int m_Radius;
114  unsigned int m_NumberOfIterations;
115 
116 private:
117  ImageFittingPolygonListFilter(const Self &) = delete;
118  void operator =(const Self&) = delete;
119 
120 };
121 } // End namespace otb
122 #ifndef OTB_MANUAL_INSTANTIATION
124 #endif
125 
126 #endif
Slightly deform polygon to reach higher enery from the image.
VertexListType::ConstIterator VertexListConstIteratorType
PathListToPathListFilter< TPath > Superclass
Base class for filter taking a PathList as input a returning a PathList.
itk::LineConstIterator< ImageType > LineConstIteratorType