ITK  6.0.0
Insight Toolkit
itkVideoFileReader.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 itkVideoFileReader_h
19#define itkVideoFileReader_h
20
21#include "itkVideoSource.h"
22#include "itkVideoIOFactory.h"
24
25namespace itk
26{
27
41template <typename TOutputVideoStream>
42class ITK_TEMPLATE_EXPORT VideoFileReader : public VideoSource<TOutputVideoStream>
43{
44public:
45 ITK_DISALLOW_COPY_AND_MOVE(VideoFileReader);
46
51 using VideoStreamType = TOutputVideoStream;
53
54 using FrameType = typename VideoStreamType::FrameType;
55 using PixelType = typename FrameType::PixelType;
57 using SizeType = typename FrameType::SizeType;
60 using SpacingType = typename FrameType::SpacingType;
62
66
67 static constexpr unsigned int FrameDimension = FrameType::ImageDimension;
68
71
73 itkNewMacro(Self);
74
76 itkOverrideGetNameOfClassMacro(VideoFileReader);
77
78
80 itkSetStringMacro(FileName);
81 itkGetStringMacro(FileName);
86 itkSetMacro(IFrameSafe, bool);
87 itkGetMacro(IFrameSafe, bool);
88 itkBooleanMacro(IFrameSafe);
92 void
94
97 void
99
103
106
109
113
117
118protected:
120 ~VideoFileReader() override = default;
121 void
122 PrintSelf(std::ostream & os, Indent indent) const override;
123
127 void
129
131 void
132 DoConvertBuffer(const void * inputData, FrameOffsetType frameNumber);
133
136 void
138
139private:
141 std::string m_FileName{};
142
146
148 bool m_PixelConversionNeeded{};
149
152 bool m_IFrameSafe{};
153};
154
155} // end namespace itk
156
157#ifndef ITK_MANUAL_INSTANTIATION
158# include "itkVideoFileReader.hxx"
159#endif
160
161#endif
Traits class used to by ConvertPixels to convert blocks of pixels.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Reader that creates a VideoStream.
typename FrameType::SpacingType SpacingType
typename VideoIOBase::TemporalOffsetType TemporalOffsetType
typename VideoStreamType::FrameType FrameType
typename VideoStreamType::Pointer VideoStreamPointer
TemporalRatioType GetCurrentPositionRatio()
FrameOffsetType GetNumberOfFrames()
typename FrameType::DirectionType DirectionType
void UpdateOutputInformation() override
typename FrameType::RegionType RegionType
typename FrameType::SizeType SizeType
typename FrameType::PixelType PixelType
typename VideoIOBase::TemporalRatioType TemporalRatioType
void PrintSelf(std::ostream &os, Indent indent) const override
void DoConvertBuffer(const void *inputData, FrameOffsetType frameNumber)
~VideoFileReader() override=default
TemporalOffsetType GetCurrentPositionMSec()
void SetVideoIO(VideoIOBase *videoIO)
typename FrameType::IndexType IndexType
FrameOffsetType GetCurrentPositionFrame()
typename FrameType::PointType PointType
void TemporalStreamingGenerateData() override
typename VideoIOBase::FrameOffsetType FrameOffsetType
TOutputVideoStream VideoStreamType
TemporalRatioType GetFramesPerSecond()
Abstract superclass defines video IO interface.
SizeValueType FrameOffsetType
double TemporalRatioType
double TemporalOffsetType
A TemporalProcessObject that produces a VideoStream.
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....