ITK  4.6.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 {
73 template< typename TInputImage,
74  typename TOutputImage,
75  typename TInputFilter = ImageToImageFilter<
76  Image< typename TInputImage::PixelType, TInputImage::ImageDimension - 1 >,
77  Image< typename TOutputImage::PixelType, TOutputImage ::ImageDimension - 1 > >,
78  class TOutputFilter = typename TInputFilter::Superclass,
79  class TInternalInputImage = typename TInputFilter::InputImageType,
80  class TInternalOutputImage = typename TOutputFilter::OutputImageType >
82  public ImageToImageFilter< TInputImage, TOutputImage >
83 {
84 public:
90 
93 
95  itkNewMacro(Self);
96 
99 
101  typedef TInputImage InputImageType;
102  typedef typename TInputImage::RegionType RegionType;
103  typedef typename TInputImage::SizeType SizeType;
104  typedef typename TInputImage::IndexType IndexType;
105  typedef typename TInputImage::PixelType PixelType;
106  typedef typename TInputImage::OffsetType OffsetType;
107 
108  typedef TOutputImage OutputImageType;
109  typedef typename TOutputImage::PixelType OutputPixelType;
110 
111  typedef TInputFilter InputFilterType;
112  typedef TOutputFilter OutputFilterType;
113 
114  typedef TInternalInputImage InternalInputImageType;
115  typedef typename InternalInputImageType::RegionType InternalRegionType;
116  typedef typename InternalInputImageType::SizeType InternalSizeType;
117  typedef typename InternalInputImageType::IndexType InternalIndexType;
118  typedef typename InternalInputImageType::OffsetType InternalOffsetType;
119  typedef typename InternalInputImageType::PixelType InternalInputPixelType;
120 
121  typedef TInternalOutputImage InternalOutputImageType;
122  typedef typename InternalOutputImageType::PixelType InternalOutputPixelType;
123 
125  itkStaticConstMacro(ImageDimension, unsigned int,
126  TInputImage::ImageDimension);
127 
128  itkStaticConstMacro(InternalImageDimension, unsigned int,
129  InternalInputImageType::ImageDimension);
130 
131  itkSetMacro(Dimension, unsigned int);
132  itkGetConstMacro(Dimension, unsigned int);
133 
134  void SetFilter(InputFilterType *filter);
135 
137  {
138  return this->m_InputFilter;
139  }
140 
141  const InputFilterType * GetFilter() const
142  {
143  return this->m_InputFilter;
144  }
145 
146  void SetInputFilter(InputFilterType *filter);
147  itkGetModifiableObjectMacro(InputFilter, InputFilterType);
148 
149  void SetOutputFilter(OutputFilterType *filter);
150  itkGetModifiableObjectMacro(OutputFilter, OutputFilterType);
151 
156  itkGetConstMacro(SliceIndex, IndexValueType);
157 
158 protected:
161 
162  void VerifyInputInformation();
163 
164  void GenerateData();
165 
166  void PrintSelf(std::ostream & os, Indent indent) const;
167 
168  virtual void GenerateInputRequestedRegion();
169 
170 private:
171  SliceBySliceImageFilter(const Self &); //purposely not implemented
172  void operator=(const Self &); //purposely not implemented
173 
174  unsigned int m_Dimension;
175 
176  typename InputFilterType::Pointer m_InputFilter;
177 
178  typename OutputFilterType::Pointer m_OutputFilter;
179 
181 };
182 }
183 
184 #ifndef ITK_MANUAL_INSTANTIATION
185 #include "itkSliceBySliceImageFilter.hxx"
186 #endif
187 
188 #endif
static const unsigned int ImageDimension
void operator=(const Self &)
InternalOutputImageType::PixelType InternalOutputPixelType
InputImageType::Pointer InputImagePointer
signed long IndexValueType
Definition: itkIntTypes.h:150
void SetInputFilter(InputFilterType *filter)
void SetOutputFilter(OutputFilterType *filter)
static const unsigned int InternalImageDimension
Apply a filter or a pipeline slice by slice on an image.
InternalInputImageType::RegionType InternalRegionType
void PrintSelf(std::ostream &os, Indent indent) const
Base class for all process objects that output image data.
void VerifyInputInformation()
Verifies that the input images occupy the same physical space and the each index is at the same physi...
Superclass::InputImagePointer InputImagePointer
ImageToImageFilter< TInputImage, TOutputImage > Superclass
InternalInputImageType::IndexType InternalIndexType
void SetFilter(InputFilterType *filter)
virtual void GenerateInputRequestedRegion()
const InputFilterType * GetFilter() const
InputFilterType::Pointer m_InputFilter
InternalInputImageType::OffsetType InternalOffsetType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
OutputFilterType::Pointer m_OutputFilter
InternalInputImageType::SizeType InternalSizeType
SmartPointer< const Self > ConstPointer
InternalInputImageType::PixelType InternalInputPixelType