ITK  6.0.0
Insight Toolkit
itkImageToVideoFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 itkImageToVideoFilter_h
19 #define itkImageToVideoFilter_h
20 
21 #include "itkImage.h"
22 #include "itkVideoSource.h"
23 #include "itkVideoStream.h"
24 #include "itkTemporalRegion.h"
25 #include "itkMacro.h"
26 
27 namespace itk
28 {
29 
50 template <typename TInputImage,
51  typename TOutputVideoStream =
52  VideoStream<Image<typename TInputImage::PixelType, TInputImage::ImageDimension - 1>>>
53 class ITK_TEMPLATE_EXPORT ImageToVideoFilter : public VideoSource<TOutputVideoStream>
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_MOVE(ImageToVideoFilter);
57 
59  using InputImageType = TInputImage;
60  using OutputVideoStreamType = TOutputVideoStream;
66 
68  using OutputFrameType = typename Superclass::OutputFrameType;
69  using OutputFrameSpatialRegionType = typename Superclass::OutputFrameSpatialRegionType;
70  using OutputTemporalRegionType = typename TOutputVideoStream::TemporalRegionType;
71 
76  using InputImagePixelType = typename InputImageType::PixelType;
78  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
79 
80  itkNewMacro(Self);
81 
83  itkOverrideGetNameOfClassMacro(ImageToVideoFilter);
84 
86  using Superclass::SetInput;
87  virtual void
88  SetInput(const InputImageType * image);
89 
90  virtual void
91  SetInput(unsigned int idx, const InputImageType * image);
92 
94  const InputImageType *
95  GetInput() const;
96 
97  const InputImageType *
98  GetInput(unsigned int idx) const;
99 
102  itkGetMacro(FrameAxis, IndexValueType);
103  itkSetMacro(FrameAxis, IndexValueType);
106 protected:
108  ~ImageToVideoFilter() override = default;
109 
110  void
111  PrintSelf(std::ostream & os, Indent indent) const override;
112 
117  GetInput();
118 
120  GetInput(unsigned int idx);
121 
125  void
126  GenerateOutputInformation() override;
127 
132  void
133  UpdateOutputInformation() override;
134 
138  void
139  GenerateOutputRequestedRegion(DataObject * output) override;
140 
144  void
145  GenerateInputRequestedRegion() override;
146 
148  void
149  GenerateData() override;
150 
151 private:
156  IndexValueType m_FrameAxis{ TInputImage::ImageDimension - 1 };
157 
158 }; // end class ImageToVideoFilter
159 
160 } // end namespace itk
161 
162 #ifndef ITK_MANUAL_INSTANTIATION
163 # include "itkImageToVideoFilter.hxx"
164 #endif
165 
166 #endif // itkImageToVideoFilter_h
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::ImageToVideoFilter::InputImageIndexType
typename InputImageType::IndexType InputImageIndexType
Definition: itkImageToVideoFilter.h:77
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itkVideoStream.h
itk::ImageToVideoFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToVideoFilter.h:59
itk::ImageToVideoFilter
Converts Image to VideoStream representation with a temporal axis.
Definition: itkImageToVideoFilter.h:53
itkImage.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::IndexValueType
long IndexValueType
Definition: itkIntTypes.h:93
itk::ImageToVideoFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToVideoFilter.h:75
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkMacro.h
itk::ImageToVideoFilter::OutputTemporalRegionType
typename TOutputVideoStream::TemporalRegionType OutputTemporalRegionType
Definition: itkImageToVideoFilter.h:70
itk::ImageToVideoFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkImageToVideoFilter.h:76
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageToVideoFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToVideoFilter.h:73
itk::ImageToVideoFilter::OutputVideoStreamType
TOutputVideoStream OutputVideoStreamType
Definition: itkImageToVideoFilter.h:60
itkTemporalRegion.h
itk::ImageToVideoFilter::OutputFrameSpatialRegionType
typename Superclass::OutputFrameSpatialRegionType OutputFrameSpatialRegionType
Definition: itkImageToVideoFilter.h:69
itk::WeakPointer
Implements a weak reference to an object.
Definition: itkWeakPointer.h:44
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ImageToVideoFilter::OutputFrameType
typename Superclass::OutputFrameType OutputFrameType
Definition: itkImageToVideoFilter.h:68
itk::ImageToVideoFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkImageToVideoFilter.h:74
itkVideoSource.h
itk::VideoSource
A TemporalProcessObject that produces a VideoStream.
Definition: itkVideoSource.h:44
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293