ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkVideoFileReader.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 itkVideoFileReader_h
19 #define itkVideoFileReader_h
20 
21 #include "itkVideoSource.h"
22 #include "itkVideoIOFactory.h"
24 
25 namespace itk
26 {
27 
40 template< typename TOutputVideoStream >
41 class VideoFileReader : public VideoSource< TOutputVideoStream >
42 {
43 public:
44 
49  typedef TOutputVideoStream VideoStreamType;
50  typedef typename VideoStreamType::Pointer VideoStreamPointer;
51 
52  typedef typename VideoStreamType::FrameType FrameType;
53  typedef typename FrameType::PixelType PixelType;
54  typedef typename FrameType::RegionType RegionType;
55  typedef typename FrameType::SizeType SizeType;
56  typedef typename FrameType::IndexType IndexType;
57  typedef typename FrameType::PointType PointType;
58  typedef typename FrameType::SpacingType SpacingType;
59  typedef typename FrameType::DirectionType DirectionType;
60 
64 
65  itkStaticConstMacro(FrameDimension,unsigned int,FrameType::ImageDimension);
66 
69 
71  itkNewMacro(Self);
72 
74  itkTypeMacro(VideoFileReader, VideoSource);
75 
79  itkSetStringMacro(FileName);
80  itkGetStringMacro(FileName);
82 
85  itkSetMacro(IFrameSafe, bool);
86  itkGetMacro(IFrameSafe, bool);
88 
90  virtual void UpdateOutputInformation() ITK_OVERRIDE;
91 
94  void SetVideoIO(VideoIOBase* videoIO);
95 
98 
100 
102 
105 
108 
109 protected:
110 
112  VideoFileReader();
113  virtual ~VideoFileReader();
114  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
116 
120  virtual void TemporalStreamingGenerateData() ITK_OVERRIDE;
121 
123  void DoConvertBuffer(void* inputData, FrameOffsetType frameNumber);
124 
127  void InitializeVideoIO();
128 
132  std::string m_FileName;
133 
137 
140 
144 
145 private:
146  VideoFileReader(const Self &) ITK_DELETE_FUNCTION;
147  void operator=(const Self &) ITK_DELETE_FUNCTION;
148 
149 };
150 
151 } // end namespace itk
152 
153 #ifndef ITK_MANUAL_INSTANTIATION
154 #include "itkVideoFileReader.hxx"
155 #endif
156 
157 #endif
Light weight base class for most itk classes.
virtual void TemporalStreamingGenerateData() override
void DoConvertBuffer(void *inputData, FrameOffsetType frameNumber)
Abstract superclass defines video IO interface.
DefaultConvertPixelTraits< PixelType > ConvertPixelTraits
VideoStreamType::FrameType FrameType
FrameType::SizeType SizeType
Traits class used to by ConvertPixels to convert blocks of pixels.
FrameType::SpacingType SpacingType
static const unsigned int FrameDimension
TemporalOffsetType GetCurrentPositionMSec()
virtual void UpdateOutputInformation() override
A TemporalProcessObject that produces a VideoStream.
FrameType::DirectionType DirectionType
VideoIOBase::FrameOffsetType FrameOffsetType
SizeValueType FrameOffsetType
void PrintSelf(std::ostream &os, Indent indent) const override
TOutputVideoStream VideoStreamType
FrameType::PixelType PixelType
FrameType::PointType PointType
VideoStreamType::Pointer VideoStreamPointer
TemporalRatioType GetFramesPerSecond()
TemporalRatioType GetCurrentPositionRatio()
SmartPointer< Self > Pointer
void SetVideoIO(VideoIOBase *videoIO)
VideoIOBase::TemporalRatioType TemporalRatioType
VideoIOBase::TemporalOffsetType TemporalOffsetType
VideoIOBase::Pointer m_VideoIO
Reader that creates a VideoStream.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
FrameOffsetType GetNumberOfFrames()
FrameOffsetType GetCurrentPositionFrame()
double TemporalRatioType
VideoSource< TOutputVideoStream > Superclass
FrameType::RegionType RegionType
double TemporalOffsetType
FrameType::IndexType IndexType