ITK  5.0.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 >
81 class ITK_TEMPLATE_EXPORT SliceBySliceImageFilter:
82  public ImageToImageFilter< TInputImage, TOutputImage >
83 {
84 public:
85  ITK_DISALLOW_COPY_AND_ASSIGN(SliceBySliceImageFilter);
86 
92 
94  using InputImagePointer = typename Superclass::InputImagePointer;
95 
97  itkNewMacro(Self);
98 
101 
103  using InputImageType = TInputImage;
105  using SizeType = typename TInputImage::SizeType;
107  using PixelType = typename TInputImage::PixelType;
108  using OffsetType = typename TInputImage::OffsetType;
109 
110  using OutputImageType = TOutputImage;
111  using OutputPixelType = typename TOutputImage::PixelType;
112 
113  using InputFilterType = TInputFilter;
114  using OutputFilterType = TOutputFilter;
115 
116  using InternalInputImageType = TInternalInputImage;
120  using InternalOffsetType = typename InternalInputImageType::OffsetType;
121  using InternalInputPixelType = typename InternalInputImageType::PixelType;
122  using InternalSpacingType = typename InternalInputImageType::SpacingType;
124 
125  using InternalOutputImageType = TInternalOutputImage;
126  using InternalOutputPixelType = typename InternalOutputImageType::PixelType;
127 
129  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
130 
131  static constexpr unsigned int InternalImageDimension = InternalInputImageType::ImageDimension;
132 
133  itkSetMacro(Dimension, unsigned int);
134  itkGetConstMacro(Dimension, unsigned int);
135 
136  void SetFilter(InputFilterType *filter);
137 
139  {
140  return this->m_InputFilter;
141  }
142 
143  const InputFilterType * GetFilter() const
144  {
145  return this->m_InputFilter;
146  }
147 
148  void SetInputFilter(InputFilterType *filter);
149  itkGetModifiableObjectMacro(InputFilter, InputFilterType);
150 
151  void SetOutputFilter(OutputFilterType *filter);
152  itkGetModifiableObjectMacro(OutputFilter, OutputFilterType);
153 
158  itkGetConstMacro(SliceIndex, IndexValueType);
159 
160 protected:
162  ~SliceBySliceImageFilter() override = default;
163 
164  void VerifyInputInformation() ITKv5_CONST override;
165 
166  void GenerateData() override;
167 
168  void PrintSelf(std::ostream & os, Indent indent) const override;
169 
170  void GenerateInputRequestedRegion() override;
171 
172 private:
173  unsigned int m_Dimension;
174 
175  typename InputFilterType::Pointer m_InputFilter;
176 
177  typename OutputFilterType::Pointer m_OutputFilter;
178 
179  IndexValueType m_SliceIndex;
180 };
181 }
182 
183 #ifndef ITK_MANUAL_INSTANTIATION
184 #include "itkSliceBySliceImageFilter.hxx"
185 #endif
186 
187 #endif
typename TInputImage::IndexType IndexType
typename InternalInputImageType::PixelType InternalInputPixelType
typename TInputImage::RegionType RegionType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Apply a filter or a pipeline slice by slice on an image.
Base class for all process objects that output image data.
typename TInputImage::PixelType PixelType
typename InternalInputImageType::PointType InternalPointType
typename TInputImage::OffsetType OffsetType
typename InternalInputImageType::OffsetType InternalOffsetType
typename InputImageType::Pointer InputImagePointer
typename InternalInputImageType::IndexType InternalIndexType
TOutputImage OutputImageType
signed long IndexValueType
Definition: itkIntTypes.h:90
typename InternalInputImageType::SpacingType InternalSpacingType
typename TOutputImage::PixelType OutputPixelType
const InputFilterType * GetFilter() const
typename TInputImage::SizeType SizeType
typename InternalInputImageType::RegionType InternalRegionType
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
typename InternalInputImageType::SizeType InternalSizeType
typename InternalOutputImageType::PixelType InternalOutputPixelType