OTB  9.0.0
Orfeo Toolbox
otbImageToModulusAndDirectionImageFilter.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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 otbImageToModulusAndDirectionImageFilter_hxx
22 #define otbImageToModulusAndDirectionImageFilter_hxx
23 
25 #include "itkProcessObject.h"
26 
27 namespace otb
28 {
29 
33 template <class TInputImage, class TOutputImage, class TOutputImageDirection>
35 {
36  this->SetNumberOfRequiredInputs(1);
37  this->SetNumberOfRequiredInputs(1);
38  this->SetNumberOfRequiredOutputs(2);
39  this->SetNumberOfRequiredOutputs(2);
41 
42  this->SetNthOutput(0, OutputImageType::New());
43  this->SetNthOutput(1, OutputImageDirectionType::New());
44 }
45 
47 template <class TInputImage, class TOutputImage, class TOutputImageDirection>
50 {
51  if (this->GetNumberOfOutputs() < 1)
52  {
53  return 0;
54  }
55  return static_cast<const OutputImageType*>(this->itk::ProcessObject::GetOutput(0));
56 }
57 
59 template <class TInputImage, class TOutputImage, class TOutputImageDirection>
62 {
63  if (this->GetNumberOfOutputs() < 1)
64  {
65  return nullptr;
66  }
67  return static_cast<OutputImageType*>(this->itk::ProcessObject::GetOutput(0));
68 }
70 
72 template <class TInputImage, class TOutputImage, class TOutputImageDirection>
75 {
76  if (this->GetNumberOfOutputs() < 2)
77  {
78  return 0;
79  }
80  return static_cast<const OutputImageDirectionType*>(this->itk::ProcessObject::GetOutput(1));
81 }
83 
85 template <class TInputImage, class TOutputImage, class TOutputImageDirection>
88 {
89  if (this->GetNumberOfOutputs() < 2)
90  {
91  return nullptr;
92  }
93  return static_cast<OutputImageDirectionType*>(this->itk::ProcessObject::GetOutput(1));
94 }
96 
100 template <class TInputImage, class TOutputImage, class TOutputImageDirection>
102 {
103  Superclass::GenerateInputRequestedRegion();
104 }
105 
109 template <class TInputImage, class TOutputImage, class TOutputImageDirection>
111 {
112  Superclass::PrintSelf(os, indent);
113 }
114 
115 } // end namespace otb
116 
117 #endif
otb::ImageToModulusAndDirectionImageFilter::ImageToModulusAndDirectionImageFilter
ImageToModulusAndDirectionImageFilter()
Definition: otbImageToModulusAndDirectionImageFilter.hxx:34
otb::ImageToModulusAndDirectionImageFilter::GenerateInputRequestedRegion
void GenerateInputRequestedRegion() override
Definition: otbImageToModulusAndDirectionImageFilter.hxx:101
otb::ImageToModulusAndDirectionImageFilter::GetOutputDirection
const OutputImageDirectionType * GetOutputDirection() const
Definition: otbImageToModulusAndDirectionImageFilter.hxx:74
otbImageToModulusAndDirectionImageFilter.h
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ImageToModulusAndDirectionImageFilter::OutputImageType
Superclass::OutputImageType OutputImageType
Definition: otbImageToModulusAndDirectionImageFilter.h:63
otb::ImageToModulusAndDirectionImageFilter::PrintSelf
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Definition: otbImageToModulusAndDirectionImageFilter.hxx:110
otb::ImageToModulusAndDirectionImageFilter::OutputImageDirectionType
TOutputImageDirection OutputImageDirectionType
Definition: otbImageToModulusAndDirectionImageFilter.h:64
otb::ImageToModulusAndDirectionImageFilter::GetOutput
const OutputImageType * GetOutput() const
Definition: otbImageToModulusAndDirectionImageFilter.hxx:49