Orfeo Toolbox  3.16
itkPathSource.txx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkPathSource.txx,v $
5  Language: C++
6  Date: $Date: 2006-02-06 22:01:57 $
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 #ifndef __itkPathSource_txx
18 #define __itkPathSource_txx
19 
20 #include "itkPathSource.h"
21 
22 namespace itk
23 {
24 
28 template<class TOutputPath>
31 {
32  // Create the output. We use static_cast<> here because we know the default
33  // output must be of type TOutputPath
34  OutputPathPointer output
35  = static_cast<TOutputPath*>(this->MakeOutput(0).GetPointer());
36 
38  this->ProcessObject::SetNthOutput( 0, output.GetPointer() );
39 
40  // Initialize PathSource member data
41 }
42 
46 template<class TOutputPath>
50 {
51  if (this->GetNumberOfOutputs() < 1)
52  {
53  return 0;
54  }
55 
56  return static_cast<TOutputPath*>
57  (this->ProcessObject::GetOutput(0));
58 }
59 
60 
64 template<class TOutputPath>
67 ::GetOutput(unsigned int idx)
68 {
69  return static_cast<TOutputPath*>
70  (this->ProcessObject::GetOutput(idx));
71 }
72 
76 template<class TOutputPath>
77 void
79 ::GraftOutput(TOutputPath *graft)
80 {
81  this->GraftNthOutput(0, graft);
82 }
83 
87 template<class TOutputPath>
88 void
90 ::GraftNthOutput(unsigned int idx, TOutputPath *graft)
91 {
92  if (idx < this->GetNumberOfOutputs())
93  {
94  OutputPathType * output = this->GetOutput(idx);
95 
96  if (output && graft)
97  {
98  // Paths do not have a generic pointer to their bulk data
99  itkWarningMacro( << "Warning: GraftNthOutput() is broken" );
100 
101  // possible VERY WRONG KLUDGE that should enable mini-pipelining:
102  // Completely copy the path to graft over the current output path,
103  // but RESTORE the original Source ivars to preserve pipeline routing.
104  //
105  // ProcessObject *source = output->GetSource();
106  // *output = *graft;
107  // output->DisconnectSource( graft->GetSource(),
108  // graft->GetSourceOutputIndex() );
109  // output->ConnectSource( source, idx );
110 
111 
112  // grab a handle to the bulk data of the specified data object
113  // output->SetPixelContainer( graft->GetPixelContainer() );
114 
115  // copy the region ivars of the specified data object
116  // output->SetRequestedRegion( graft->GetRequestedRegion() );
117  // output->SetLargestPossibleRegion( graft->GetLargestPossibleRegion() );
118  // output->SetBufferedRegion( graft->GetBufferedRegion() );
119 
120  // copy the meta-information
121  //output->CopyInformation( graft );
122  }
123  }
124 }
125 
129 template<class TOutputPath>
132 ::MakeOutput(unsigned int)
133 {
134  return static_cast<DataObject*>(TOutputPath::New().GetPointer());
135 }
136 
140 template<class TOutputPath>
141 void
143 ::PrintSelf(std::ostream& os, Indent indent) const
144 {
145  Superclass::PrintSelf(os,indent);
146 }
147 
148 } // end namespace itk
149 
150 #endif

Generated at Sat Feb 2 2013 23:58:59 for Orfeo Toolbox with doxygen 1.8.1.1