ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkVideoFileWriter.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 
19 #ifndef itkVideoFileWriter_h
20 #define itkVideoFileWriter_h
21 
23 #include "itkVideoIOFactory.h"
24 
25 namespace itk
26 {
27 
38 template< typename TInputVideoStream >
40 {
41 public:
42 
47 
52 
53  typedef TInputVideoStream VideoStreamType;
54  typedef typename VideoStreamType::Pointer VideoStreamPointer;
55  typedef typename VideoStreamType::FrameType FrameType;
56  typedef typename FrameType::PixelType PixelType;
57 
59  itkNewMacro(Self);
60 
63 
67  itkSetStringMacro(FileName);
68  itkGetStringMacro(FileName);
70 
72  itkSetMacro(FramesPerSecond, TemporalRatioType);
73  itkGetMacro(FramesPerSecond, TemporalRatioType);
75 
80  itkSetStringMacro(FourCC);
81  itkGetStringMacro(FourCC);
83 
85  itkSetMacro(OutputTemporalRegion, TemporalRegion);
86  itkGetMacro(OutputTemporalRegion, TemporalRegion);
88 
91  void SetInput( const VideoStreamType* input );
92  const VideoStreamType* GetInput();
94 
96  void SetVideoIO( IOBasePointer videoIO );
97 
101  void Write();
102 
104  void FinishWriting();
105 
108  virtual void Update() ITK_OVERRIDE;
109 
112  virtual void UpdateLargestPossibleRegion() ITK_OVERRIDE;
113 
114 protected:
115 
118  VideoFileWriter();
119  virtual ~VideoFileWriter();
120  virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE;
121 
124 
128  bool InitializeVideoIO();
129 
131  virtual void TemporalStreamingGenerateData() ITK_OVERRIDE;
132 
136  std::string m_FileName;
137 
140 
143 
146  std::string m_FourCC;
149  ImageIOBase::IOComponentType m_ComponentType;
150 
151 private:
152  VideoFileWriter(const Self &) ITK_DELETE_FUNCTION;
153  void operator=(const Self &) ITK_DELETE_FUNCTION;
154 
155 };
156 
157 } // end namespace itk
158 
159 #ifndef ITK_MANUAL_INSTANTIATION
160 #include "itkVideoFileWriter.hxx"
161 #endif
162 
163 #endif
TemporalRatioType m_FramesPerSecond
Light weight base class for most itk classes.
Abstract superclass defines video IO interface.
Abstract superclass defines image IO interface.
VideoStreamType::FrameType FrameType
virtual void Update() override
virtual void UpdateLargestPossibleRegion() override
bool InitializeOutputParameters()
VideoStreamType::Pointer VideoStreamPointer
IOBaseType::SizeValueType SizeValueType
Writer that takes in a VideoStream and writes the frames to a file.
void SetVideoIO(IOBasePointer videoIO)
virtual void TemporalStreamingGenerateData() override
virtual void PrintSelf(std::ostream &os, Indent indent) const override
TemporalProcessObject Superclass
TemporalRegion m_OutputTemporalRegion
TemporalProcessObject implements a ProcessObject for the itk pipeline with the notion of a temporal r...
VideoIOBase::Pointer IOBasePointer
SizeValueType m_NumberOfComponents
Region subclass that holds a region in time.
IOBaseType::TemporalRatioType TemporalRatioType
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
Protected method for setting indexed and named inputs.
std::vector< SizeValueType > m_Dimensions
void SetInput(const VideoStreamType *input)
VideoFileWriter< TInputVideoStream > Self
::itk::SizeValueType SizeValueType
const VideoStreamType * GetInput()
Control indentation during Print() invocation.
Definition: itkIndent.h:49
TInputVideoStream VideoStreamType
FrameType::PixelType PixelType
ImageIOBase::IOComponentType m_ComponentType
double TemporalRatioType
SmartPointer< Self > Pointer