ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkSliceBySliceImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkSliceBySliceImageFilter_h
19 #define __itkSliceBySliceImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
72 template< class TInputImage,
73  class TOutputImage,
74  class TInputFilter = ImageToImageFilter<
75  Image< typename TInputImage::PixelType, TInputImage::ImageDimension - 1 >,
76  Image< typename TOutputImage::PixelType, TOutputImage ::ImageDimension - 1 > >,
77  class TOutputFilter = typename TInputFilter::Superclass,
78  class TInternalInputImage = typename TInputFilter::InputImageType,
79  class TInternalOutputImage = typename TOutputFilter::OutputImageType >
80 class ITK_EXPORT SliceBySliceImageFilter:
81  public ImageToImageFilter< TInputImage, TOutputImage >
82 {
83 public:
89 
91  typedef typename Superclass::InputImagePointer InputImagePointer;
92 
94  itkNewMacro(Self);
95 
98 
100  typedef TInputImage InputImageType;
101  typedef typename TInputImage::RegionType RegionType;
102  typedef typename TInputImage::SizeType SizeType;
103  typedef typename TInputImage::IndexType IndexType;
104  typedef typename TInputImage::PixelType PixelType;
105  typedef typename TInputImage::OffsetType OffsetType;
106 
107  typedef TOutputImage OutputImageType;
108  typedef typename TOutputImage::PixelType OutputPixelType;
109 
110  typedef TInputFilter InputFilterType;
111  typedef TOutputFilter OutputFilterType;
112 
113  typedef TInternalInputImage InternalInputImageType;
114  typedef typename InternalInputImageType::RegionType InternalRegionType;
115  typedef typename InternalInputImageType::SizeType InternalSizeType;
116  typedef typename InternalInputImageType::IndexType InternalIndexType;
117  typedef typename InternalInputImageType::OffsetType InternalOffsetType;
118  typedef typename InternalInputImageType::PixelType InternalInputPixelType;
119 
120  typedef TInternalOutputImage InternalOutputImageType;
121  typedef typename InternalOutputImageType::PixelType InternalOutputPixelType;
122 
124  itkStaticConstMacro(ImageDimension, unsigned int,
125  TInputImage::ImageDimension);
126 
127  itkStaticConstMacro(InternalImageDimension, unsigned int,
128  InternalInputImageType::ImageDimension);
129 
130  itkSetMacro(Dimension, unsigned int);
131  itkGetConstMacro(Dimension, unsigned int);
132 
133  void SetFilter(InputFilterType *filter);
134 
135  InputFilterType * GetFilter()
136  {
137  return this->m_InputFilter;
138  }
139 
140  const InputFilterType * GetFilter() const
141  {
142  return this->m_InputFilter;
143  }
144 
145  void SetInputFilter(InputFilterType *filter);
146 
147  itkGetObjectMacro(InputFilter, InputFilterType);
148 
149  void SetOutputFilter(OutputFilterType *filter);
150 
151  itkGetObjectMacro(OutputFilter, OutputFilterType);
152 
157  itkGetConstMacro(SliceIndex, IndexValueType);
158 
159 protected:
162 
163  void GenerateData();
164 
165  void PrintSelf(std::ostream & os, Indent indent) const;
166 
167  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
168 
169 private:
170  SliceBySliceImageFilter(const Self &); //purposely not implemented
171  void operator=(const Self &); //purposely not implemented
172 
173  unsigned int m_Dimension;
174 
175  typename InputFilterType::Pointer m_InputFilter;
176 
177  typename OutputFilterType::Pointer m_OutputFilter;
178 
180 };
181 }
182 
183 #ifndef ITK_MANUAL_INSTANTIATION
184 #include "itkSliceBySliceImageFilter.hxx"
185 #endif
186 
187 #endif
188