ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkFileListVideoIO.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 itkFileListVideoIO_h
19 #define itkFileListVideoIO_h
20 
21 #include "itkVideoIOBase.h"
22 #include "ITKVideoIOExport.h"
23 
24 namespace itk
25 {
39 class ITKVideoIO_EXPORT FileListVideoIO : public VideoIOBase
40 {
41 public:
47 
49  itkNewMacro(Self);
50 
52  itkTypeMacro(FileListVideoIO, VideoIOBase);
53 
55  itkGetConstObjectMacro(ImageIO, ImageIOBase);
56 
58  itkGetConstMacro(FileNames, std::vector<std::string>);
59 
61  virtual void SetFileName(const std::string& fileList) ITK_OVERRIDE;
62  virtual void SetFileName(const char* fileList) ITK_OVERRIDE;
64 
66  virtual void FinishReadingOrWriting() ITK_OVERRIDE;
67 
71  static std::vector<std::string> SplitFileNames(const std::string& fileList);
72 
74  virtual void SetReadFromFile() ITK_OVERRIDE;
75 
77  virtual void SetReadFromCamera() ITK_OVERRIDE;
78 
81  virtual bool CanReadFile(const char *) ITK_OVERRIDE;
82 
84  virtual bool CanReadCamera( CameraIDType cameraID )const ITK_OVERRIDE;
85 
87  virtual void ReadImageInformation() ITK_OVERRIDE;
88 
90  virtual void Read(void *buffer) ITK_OVERRIDE;
91 
94  virtual bool SetNextFrameToRead(FrameOffsetType frameNumber) ITK_OVERRIDE;
95 
97  virtual TemporalOffsetType GetPositionInMSec() const ITK_OVERRIDE
98  {
99  return this->m_PositionInMSec;
100  }
101  virtual TemporalOffsetType GetRatio() const ITK_OVERRIDE
102  {
103  return this->m_Ratio;
104  }
105  virtual FrameOffsetType GetFrameTotal() const ITK_OVERRIDE
106  {
107  return this->m_FrameTotal;
108  }
109  virtual TemporalRatioType GetFramesPerSecond() const ITK_OVERRIDE
110  {
111  return this->m_FramesPerSecond;
112  }
113  virtual FrameOffsetType GetCurrentFrame() const ITK_OVERRIDE
114  {
115  return this->m_CurrentFrame;
116  }
117  itkGetConstMacro(IFrameInterval,FrameOffsetType);
118  virtual FrameOffsetType GetLastIFrame() const ITK_OVERRIDE
119  {
120  return this->m_LastIFrame;
121  }
123 
125  virtual double GetSpacing(unsigned int i) const ITK_OVERRIDE;
126 
127  virtual double GetOrigin(unsigned int i) const ITK_OVERRIDE;
128 
129  virtual std::vector< double > GetDirection(unsigned int i) const ITK_OVERRIDE;
130 
133  virtual bool CanWriteFile(const char *) ITK_OVERRIDE;
134 
137  virtual void WriteImageInformation() ITK_OVERRIDE;
138 
141  virtual void Write(const void *buffer) ITK_OVERRIDE;
142 
144  virtual void SetWriterParameters( TemporalRatioType framesPerSecond,
145  const std::vector<SizeValueType>& dim,
146  const char* fourCC,
147  unsigned int nChannels,
148  IOComponentType componentType ) ITK_OVERRIDE;
149 
150 protected:
151  FileListVideoIO();
152  ~FileListVideoIO() ITK_OVERRIDE;
153 
154  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
155 
157  void ResetMembers();
158 
160  void OpenReader();
161 
163  void OpenWriter();
164 
166  bool VerifyExtensions( const std::vector<std::string>& fileList ) const;
167 
168 private:
169  ITK_DISALLOW_COPY_AND_ASSIGN(FileListVideoIO);
170 
171  ImageIOBase::Pointer m_ImageIO;
172 
173  std::vector<std::string> m_FileNames;
174 
175 };
176 } // end namespace itk
177 
178 #endif // itkFileListVideoIO_h
Light weight base class for most itk classes.
virtual TemporalRatioType GetFramesPerSecond() const override
Abstract superclass defines video IO interface.
Abstract superclass defines image IO interface.
virtual TemporalOffsetType GetRatio() const override
unsigned long SizeValueType
Definition: itkIntTypes.h:143
VideoIO object for reading and writing videos as a sequence of frame files.
SmartPointer< const Self > ConstPointer
virtual FrameOffsetType GetCurrentFrame() const override
SizeValueType FrameOffsetType
SmartPointer< Self > Pointer
SizeValueType CameraIDType
virtual FrameOffsetType GetLastIFrame() const override
virtual FrameOffsetType GetFrameTotal() const override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
double TemporalRatioType
double TemporalOffsetType