KWStyle - itkImageAndPathToImageFilter.txx
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkImageAndPathToImageFilter.txx.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:36 $
7   Version:   $Revision: 1.4 $
8
9   Copyright (c) Insight Software Consortium. All rights reserved.
10   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notices for more information.
15
16 =========================================================================*/
17
18 #ifndef __itkImageAndPathToImageFilter_txx
19 #define __itkImageAndPathToImageFilter_txx
20
21 #include "itkImageAndPathToImageFilter.h"
22
23
24 namespace itk
25 {
26
27 /**
28  *
29  */
30 template <class TInputImage, class TInputPath, class TOutputImage>
31 ImageAndPathToImageFilter<TInputImage,TInputPath,TOutputImage>
32 ::ImageAndPathToImageFilter()
33 {
34   // Modify superclass default values, can be overridden by subclasses
35   this->SetNumberOfRequiredInputs(2);
36 }
37
38 /**
39  *
40  */
41 template <class TInputImage, class TInputPath, class TOutputImage>
42 void
43 ImageAndPathToImageFilter<TInputImage,TInputPath,TOutputImage>
44 ::SetImageInput(const InputImageType *image)
45 {
46   // We have 2 inputs:  a path and an image
47
48   // Process object is not const-correct so the const_cast is required here
49   this->ProcessObject::SetNthInput(0, 
50                                    const_cast< InputImageType * >( image ) );
51 }
52
53 template <class TInputImage, class TInputPath, class TOutputImage>
54 LEN const typename ImageAndPathToImageFilter<TInputImage,TInputPath,TOutputImage>::InputImageType *
55 ImageAndPathToImageFilter<TInputImage,TInputPath,TOutputImage>
56 ::GetImageInput(void) 
57 {
58   if (this->GetNumberOfInputs() < 1)
59     {
60     return 0;
61     }
62   
63   return static_cast<const TInputImage * >
64 IND ****(this->ProcessObject::GetInput(0) );
65 }
66   
67 template <class TInputImage, class TInputPath, class TOutputImage>
68 void
69 ImageAndPathToImageFilter<TInputImage,TInputPath,TOutputImage>
70 ::SetPathInput(const InputPathType *path)
71 {
72   // We have 2 inputs:  a path and an image
73
74   // Process object is not const-correct so the const_cast is required here
75   this->ProcessObject::SetNthInput(1, 
76                                    const_cast< InputPathType * >( path ) );
77 }
78
79 template <class TInputImage, class TInputPath, class TOutputImage>
80 LEN const typename ImageAndPathToImageFilter<TInputImage,TInputPath,TOutputImage>::InputPathType *
81 ImageAndPathToImageFilter<TInputImage,TInputPath,TOutputImage>
82 ::GetPathInput(void) 
83 {
84   if (this->GetNumberOfInputs() < 2)
85     {
86     return 0;
87     }
88   
89   return static_cast<const TInputPath * >
90 IND ****(this->ProcessObject::GetInput(1) );
91 }
92   
93 /**
94  *
95  */
96 template <class TInputImage, class TInputPath, class TOutputImage>
97 void
98 ImageAndPathToImageFilter<TInputImage,TInputPath,TOutputImage>
99 ::PrintSelf(std::ostream& os, Indent indent) const
100 {
101   Superclass::PrintSelf(os, indent);
102 }
103
104
105 // end namespace itk
106
107 #endif
108

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:13PM
© Kitware Inc.