ITK  4.13.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 >
39 class ITK_TEMPLATE_EXPORT VideoFileWriter : public TemporalProcessObject
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 
64 
66  itkSetStringMacro(FileName);
67  itkGetStringMacro(FileName);
69 
71  itkSetMacro(FramesPerSecond, TemporalRatioType);
72  itkGetMacro(FramesPerSecond, TemporalRatioType);
74 
79  itkSetStringMacro(FourCC);
80  itkGetStringMacro(FourCC);
82 
84  itkSetMacro(OutputTemporalRegion, TemporalRegion);
85  itkGetMacro(OutputTemporalRegion, TemporalRegion);
87 
89  using Superclass::SetInput;
90  void SetInput( const VideoStreamType* input );
91  const VideoStreamType* GetInput();
93 
95  void SetVideoIO( IOBasePointer videoIO );
96 
100  void Write();
101 
103  void FinishWriting();
104 
107  virtual void Update() ITK_OVERRIDE;
108 
111  virtual void UpdateLargestPossibleRegion() ITK_OVERRIDE;
112 
113 protected:
114 
115  VideoFileWriter();
116  virtual ~VideoFileWriter() ITK_OVERRIDE;
117  virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE;
118 
120  bool InitializeOutputParameters();
121 
125  bool InitializeVideoIO();
126 
128  virtual void TemporalStreamingGenerateData() ITK_OVERRIDE;
129 
130 private:
131  ITK_DISALLOW_COPY_AND_ASSIGN(VideoFileWriter);
132 
134  std::string m_FileName;
135 
137  IOBasePointer m_VideoIO;
138 
140  TemporalRegion m_OutputTemporalRegion;
141 
143  TemporalRatioType m_FramesPerSecond;
144  std::string m_FourCC;
145  std::vector<SizeValueType> m_Dimensions;
146  SizeValueType m_NumberOfComponents;
147  ImageIOBase::IOComponentType m_ComponentType;
148 };
149 
150 } // end namespace itk
151 
152 #ifndef ITK_MANUAL_INSTANTIATION
153 #include "itkVideoFileWriter.hxx"
154 #endif
155 
156 #endif
Light weight base class for most itk classes.
Abstract superclass defines video IO interface.
Abstract superclass defines image IO interface.
VideoStreamType::FrameType FrameType
VideoStreamType::Pointer VideoStreamPointer
IOBaseType::SizeValueType SizeValueType
Writer that takes in a VideoStream and writes the frames to a file.
TemporalProcessObject Superclass
TemporalProcessObject implements a ProcessObject for the itk pipeline with the notion of a temporal r...
VideoIOBase::Pointer IOBasePointer
Region subclass that holds a region in time.
IOBaseType::TemporalRatioType TemporalRatioType
VideoFileWriter< TInputVideoStream > Self
::itk::SizeValueType SizeValueType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
TInputVideoStream VideoStreamType
FrameType::PixelType PixelType
double TemporalRatioType
SmartPointer< Self > Pointer