OTB  9.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-2022 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->GraftOutput(this->GetOutput());
56  m_MinMaxFilter->Update();
57  this->GraftOutput(m_MinMaxFilter->GetOutput());
58 
59  for (PixelType label = m_MinMaxFilter->GetMinimum() + 1; label <= m_MinMaxFilter->GetMaximum(); ++label)
60  {
61  ImageToEdgePathFilterPointerType edgeFilter = ImageToEdgePathFilterType::New();
62  edgeFilter->SetInput(m_MinMaxFilter->GetOutput());
63  edgeFilter->SetForegroundValue(label);
64  edgeFilter->Update();
65  m_PathList->PushBack(edgeFilter->GetOutput());
66  }
67 }
68 
69 template <class TInputImage, class TOutputPath>
70 void PersistentVectorizationImageFilter<TInputImage, TOutputPath>::PrintSelf(std::ostream& os, itk::Indent indent) const
71 {
72  Superclass::PrintSelf(os, indent);
73 }
74 
75 } // end namespace otb
76 #endif
otb::PersistentVectorizationImageFilter::GenerateData
void GenerateData() override
Definition: otbPersistentVectorizationImageFilter.hxx:51
otb::PersistentVectorizationImageFilter::PixelType
TInputImage::PixelType PixelType
Definition: otbPersistentVectorizationImageFilter.h:71
otb::PersistentVectorizationImageFilter::Synthetize
void Synthetize(void) override
Definition: otbPersistentVectorizationImageFilter.hxx:46
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otbPersistentVectorizationImageFilter.h
otb::PersistentVectorizationImageFilter::ImageToEdgePathFilterPointerType
ImageToEdgePathFilterType::Pointer ImageToEdgePathFilterPointerType
Definition: otbPersistentVectorizationImageFilter.h:82
otb::PersistentVectorizationImageFilter::PersistentVectorizationImageFilter
PersistentVectorizationImageFilter()
Definition: otbPersistentVectorizationImageFilter.hxx:33
otb::PersistentVectorizationImageFilter::Reset
void Reset(void) override
Definition: otbPersistentVectorizationImageFilter.hxx:40
otb::PersistentVectorizationImageFilter::PrintSelf
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Definition: otbPersistentVectorizationImageFilter.hxx:70