OTB  10.0.0
Orfeo Toolbox
otbImageFittingPolygonListFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 {
42 public:
46  typedef itk::SmartPointer<Self> Pointer;
47  typedef itk::SmartPointer<const Self> ConstPointer;
48 
50  itkNewMacro(Self);
51 
54 
56  typedef typename Superclass::PathType PathType;
61  typedef typename PathType::VertexType VertexType;
62  typedef typename PathType::VertexListType VertexListType;
63  typedef typename VertexListType::ConstIterator VertexListConstIteratorType;
64  typedef double RealType;
65 
66  typedef TImage ImageType;
67  typedef typename ImageType::Pointer ImagePointerType;
68  typedef typename ImageType::ConstPointer ImageConstPointerType;
69 
70  typedef itk::LineConstIterator<ImageType> LineConstIteratorType;
71 
76  void SetInputImage(const ImageType* image);
77 
82  const ImageType* GetInputImage(void);
83 
85  itkSetMacro(Radius, unsigned int);
86  itkGetMacro(Radius, unsigned int);
88 
90  itkSetMacro(NumberOfIterations, unsigned int);
91  itkGetMacro(NumberOfIterations, unsigned int);
93 
94 protected:
97 
100  {
101  }
102 
104  void GenerateData() override;
105 
107  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
108 
109  virtual double computeValue(ImageConstPointerType image, VertexType middlePoint, VertexType previousPoint, VertexType nextPoint) const;
110 
111  unsigned int m_Radius;
112  unsigned int m_NumberOfIterations;
113 
114 private:
116  void operator=(const Self&) = delete;
117 };
118 } // End namespace otb
119 #ifndef OTB_MANUAL_INSTANTIATION
121 #endif
122 
123 #endif
Slightly deform polygon to reach higher energy from the image.
PathListToPathListFilter< TPath > Superclass
void operator=(const Self &)=delete
ImageFittingPolygonListFilter(const Self &)=delete
itk::LineConstIterator< ImageType > LineConstIteratorType
VertexListType::ConstIterator VertexListConstIteratorType
ConstIterator of the object list.
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:41
itk::SmartPointer< Self > Pointer
Definition: otbObjectList.h:46
Base class for filter taking a PathList as input a returning a PathList.
Superclass::InputObjectType PathType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.