ITK  4.4.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  itkGetModifiableObjectMacro(InputFilter, InputFilterType);
147 
148  void SetOutputFilter(OutputFilterType *filter);
149  itkGetModifiableObjectMacro(OutputFilter, OutputFilterType);
150 
155  itkGetConstMacro(SliceIndex, IndexValueType);
156 
157 protected:
160 
161  void GenerateData();
162 
163  void PrintSelf(std::ostream & os, Indent indent) const;
164 
165  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) );
166 
167 private:
168  SliceBySliceImageFilter(const Self &); //purposely not implemented
169  void operator=(const Self &); //purposely not implemented
170 
171  unsigned int m_Dimension;
172 
173  typename InputFilterType::Pointer m_InputFilter;
174 
175  typename OutputFilterType::Pointer m_OutputFilter;
176 
178 };
179 }
180 
181 #ifndef ITK_MANUAL_INSTANTIATION
182 #include "itkSliceBySliceImageFilter.hxx"
183 #endif
184 
185 #endif
186