OTB  6.1.0
Orfeo Toolbox
otbImageToImageListFilter.txx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2017 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 otbImageToImageListFilter_txx
22 #define otbImageToImageListFilter_txx
23 
25 
26 namespace otb
27 {
31 template <class TInputImage, class TOutputImage>
34 {
35  this->SetNumberOfRequiredInputs(1);
36 }
37 
42 template <class TInputImage, class TOutputImage>
43 void
45 ::SetInput(const InputImageType *image)
46 {
47  // A single input image
48  this->itk::ProcessObject::SetNthInput(0, const_cast<InputImageType*>(image));
49 }
50 
55 template <class TInputImage, class TOutputImage>
56 typename ImageToImageListFilter<TInputImage, TOutputImage>::InputImageType *
58 ::GetInput(void)
59 {
60  // If there is no input
61  if (this->GetNumberOfInputs() < 1)
62  {
63  // exit
64  return ITK_NULLPTR;
65  }
66  // else return the first input
67  return static_cast<TInputImage *>
69 }
70 
DataObject * GetInput(const DataObjectIdentifierType &key)
virtual void SetInput(const InputImageType *image)
virtual void SetNthInput(DataObjectPointerArraySizeType num, DataObject *input)
InputImageType * GetInput(void)