OTB  10.0.0
Orfeo Toolbox
otbPersistentVectorizationImageFilter.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef otbPersistentVectorizationImageFilter_hxx
23 #define otbPersistentVectorizationImageFilter_hxx
24 
26 
27 #include "itkProgressReporter.h"
28 
29 namespace otb
30 {
31 
32 template <class TInputImage, class TOutputPath>
34 {
35  m_MinMaxFilter = MinMaxFilterType::New();
36  m_PathList = PathListType::New();
37 }
38 
39 template <class TInputImage, class TOutputPath>
41 {
42  m_PathList->Clear();
43 }
44 
45 template <class TInputImage, class TOutputPath>
47 {
48 }
49 
50 template <class TInputImage, class TOutputPath>
52 {
53  // Compute the min max and handle mini-pipeline
54  m_MinMaxFilter->SetInput(this->GetInput());
55  m_MinMaxFilter->Update();
56 
57  for (PixelType label = m_MinMaxFilter->GetMinimum() + 1; label <= m_MinMaxFilter->GetMaximum(); ++label)
58  {
59  ImageToEdgePathFilterPointerType edgeFilter = ImageToEdgePathFilterType::New();
60  edgeFilter->SetInput(this->GetInput());
61  edgeFilter->SetForegroundValue(label);
62  edgeFilter->Update();
63  m_PathList->PushBack(edgeFilter->GetOutput());
64  }
65 }
66 
67 template <class TInputImage, class TOutputPath>
68 void PersistentVectorizationImageFilter<TInputImage, TOutputPath>::PrintSelf(std::ostream& os, itk::Indent indent) const
69 {
70  Superclass::PrintSelf(os, indent);
71 }
72 
73 } // end namespace otb
74 #endif
void PrintSelf(std::ostream &os, itk::Indent indent) const override
ImageToEdgePathFilterType::Pointer ImageToEdgePathFilterPointerType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.