OTB  5.0.0
Orfeo Toolbox
otbImageToImageListFilter.txx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbImageToImageListFilter_txx
19 #define __otbImageToImageListFilter_txx
20 
22 
23 namespace otb
24 {
28 template <class TInputImage, class TOutputImage>
31 {
32  this->SetNumberOfRequiredInputs(1);
33 }
34 
39 template <class TInputImage, class TOutputImage>
40 void
42 ::SetInput(const InputImageType *image)
43 {
44  // A single input image
45  this->itk::ProcessObject::SetNthInput(0, const_cast<InputImageType*>(image));
46 }
47 
52 template <class TInputImage, class TOutputImage>
53 typename ImageToImageListFilter<TInputImage, TOutputImage>::InputImageType *
55 ::GetInput(void)
56 {
57  // If there is no input
58  if (this->GetNumberOfInputs() < 1)
59  {
60  // exit
61  return 0;
62  }
63  // else return the first input
64  return static_cast<TInputImage *>
66 }
67 
DataObject * GetInput(const DataObjectIdentifierType &key)
virtual void SetInput(const InputImageType *image)
virtual void SetNthInput(DataObjectPointerArraySizeType num, DataObject *input)
InputImageType * GetInput(void)