ITK  4.3.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< class TInputVideoStream >
39 class ITK_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 
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 
90  using Superclass::SetInput;
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();
109 
112  virtual void UpdateLargestPossibleRegion();
113 
114 protected:
115 
118  VideoFileWriter();
119  virtual ~VideoFileWriter();
120  void PrintSelf(std::ostream &os, Indent indent) const;
121 
123  bool InitializeOutputParameters();
124 
128  bool InitializeVideoIO();
129 
131  virtual void TemporalStreamingGenerateData();
132 
136  std::string m_FileName;
137 
140 
143 
146  std::string m_FourCC;
147  std::vector<SizeValueType> m_Dimensions;
150 
151 private:
152  VideoFileWriter(const Self &); // purposely not implemented
153  void operator=(const Self &); // purposely not implemented
154 
155 };
156 
157 } // end namespace itk
158 
159 #ifndef ITK_MANUAL_INSTANTIATION
160 #include "itkVideoFileWriter.hxx"
161 #endif
162 
163 #endif
164