Orfeo Toolbox  3.16
itkPadLabelMapFilter.txx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkPadLabelMapFilter.txx,v $
5  Language: C++
6  Date: $Date: 2009-07-23 22:27:53 $
7  Version: $Revision: 1.1 $
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  Portions of this code are covered under the VTK copyright.
13  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
14 
15  This software is distributed WITHOUT ANY WARRANTY; without even
16  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17  PURPOSE. See the above copyright notices for more information.
18 
19 =========================================================================*/
20 #ifndef __itkPadLabelMapFilter_txx
21 #define __itkPadLabelMapFilter_txx
22 #include "itkPadLabelMapFilter.h"
23 
24 namespace itk
25 {
26 
27 template <class TInputImage>
28 void
31 {
32  const TInputImage * inputPtr = this->GetInput();
33  if( !inputPtr )
34  {
35  return;
36  }
37 
38  // Compute the new region size.
39  RegionType croppedRegion;
40  SizeType size;
41  IndexType index;
42 
43  SizeType inputSize = inputPtr->GetLargestPossibleRegion().GetSize();
44  IndexType inputIndex = inputPtr->GetLargestPossibleRegion().GetIndex();
45 
46  SizeType originalPadSize = m_UpperBoundaryPadSize + m_LowerBoundaryPadSize;
47 
48  index = inputIndex - m_LowerBoundaryPadSize;
49  size = inputSize + ( originalPadSize );
50 
51  croppedRegion.SetSize(size);
52  croppedRegion.SetIndex(index);
53 
54  // Set extraction region in the superclass.
55  this->SetRegion(croppedRegion);
56 
57  Superclass::GenerateOutputInformation();
58 }
59 
60 
61 template <class TInputImage>
62 void
64 ::PrintSelf(std::ostream& os, Indent indent) const
65 {
66  Superclass::PrintSelf(os,indent);
67 
68  os << indent << "UpperBoundaryPadSize: " << m_UpperBoundaryPadSize << std::endl;
69  os << indent << "LowerBoundaryPadSize: " << m_LowerBoundaryPadSize << std::endl;
70 }
71 
72 } // end namespace itk
73 
74 #endif

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