ITK  4.6.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 
23 namespace itk
24 {
39 {
40 public:
45 
47  itkNewMacro(Self);
48 
50  itkTypeMacro(FileListVideoIO, Superclass);
51 
53  virtual void FinishReadingOrWriting() ITK_OVERRIDE;
54 
58  static std::vector<std::string> SplitFileNames(const std::string& fileList);
59 
60  /*-------- This part of the interface deals with reading data. ------ */
61 
63  virtual void SetReadFromFile() ITK_OVERRIDE;
64 
66  virtual void SetReadFromCamera() ITK_OVERRIDE;
67 
70  virtual bool CanReadFile(const char *) ITK_OVERRIDE;
71 
73  virtual bool CanReadCamera( CameraIDType cameraID )const ITK_OVERRIDE;
74 
76  virtual void ReadImageInformation() ITK_OVERRIDE;
77 
79  virtual void Read(void *buffer) ITK_OVERRIDE;
80 
83  virtual bool SetNextFrameToRead(FrameOffsetType frameNumber) ITK_OVERRIDE;
84 
86  itkGetConstMacro(PositionInMSec,TemporalOffsetType);
87  itkGetConstMacro(Ratio,TemporalRatioType);
88  itkGetConstMacro(FrameTotal,FrameOffsetType);
89  itkGetConstMacro(FramesPerSecond,TemporalRatioType);
90  itkGetConstMacro(CurrentFrame,FrameOffsetType);
91  itkGetConstMacro(IFrameInterval,FrameOffsetType);
92  itkGetConstMacro(LastIFrame,FrameOffsetType);
94 
96  virtual void SetFileName(const std::string& fileList) ITK_OVERRIDE;
97  virtual void SetFileName(const char* fileList) ITK_OVERRIDE;
99 
101  virtual double GetSpacing(unsigned int i) const ITK_OVERRIDE;
102 
103  virtual double GetOrigin(unsigned int i) const ITK_OVERRIDE;
104 
105  virtual std::vector< double > GetDirection(unsigned int i) const ITK_OVERRIDE;
106 
107  /*-------- This part of the interfaces deals with writing data. ----- */
108 
111  virtual bool CanWriteFile(const char *) ITK_OVERRIDE;
112 
115  virtual void WriteImageInformation() ITK_OVERRIDE;
116 
119  virtual void Write(const void *buffer) ITK_OVERRIDE;
120 
122  virtual void SetWriterParameters( TemporalRatioType framesPerSecond,
123  const std::vector<SizeValueType>& dim,
124  const char* fourCC,
125  unsigned int nChannels,
126  IOComponentType componentType ) ITK_OVERRIDE;
127 
128 protected:
129  FileListVideoIO();
130  ~FileListVideoIO();
131 
132  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
133 
135  void ResetMembers();
136 
138  void OpenReader();
139 
141  void OpenWriter();
142 
144  bool VerifyExtensions( const std::vector<std::string>& fileList ) const;
145 
146 private:
147  FileListVideoIO(const Self &); //purposely not implemented
148  void operator=(const Self &); //purposely not implemented
149 
152 
154  std::vector<std::string> m_FileNames;
155 
156 };
157 } // end namespace itk
158 
159 #endif // __itkFileListVideoIO_h
bool VerifyExtensions(const std::vector< std::string > &fileList) const
Light weight base class for most itk classes.
static std::vector< std::string > SplitFileNames(const std::string &fileList)
Abstract superclass defines video IO interface.
Abstract superclass defines image IO interface.
virtual void SetReadFromFile() ITK_OVERRIDE
virtual void FinishReadingOrWriting() ITK_OVERRIDE
virtual void SetWriterParameters(TemporalRatioType framesPerSecond, const std::vector< SizeValueType > &dim, const char *fourCC, unsigned int nChannels, IOComponentType componentType) ITK_OVERRIDE
virtual void WriteImageInformation() ITK_OVERRIDE
VideoIO object for reading and writing videos as a sequence of frame files.
SizeValueType FrameOffsetType
virtual void Write(const void *buffer) ITK_OVERRIDE
virtual double GetOrigin(unsigned int i) const ITK_OVERRIDE
SmartPointer< Self > Pointer
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
std::vector< std::string > m_FileNames
virtual bool SetNextFrameToRead(FrameOffsetType frameNumber) ITK_OVERRIDE
virtual void Read(void *buffer) ITK_OVERRIDE
SizeValueType CameraIDType
::itk::SizeValueType SizeValueType
ImageIOBase::Pointer m_ImageIO
virtual void ReadImageInformation() ITK_OVERRIDE
virtual void SetReadFromCamera() ITK_OVERRIDE
virtual void SetFileName(const std::string &fileList) ITK_OVERRIDE
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:57
virtual std::vector< double > GetDirection(unsigned int i) const ITK_OVERRIDE
virtual double GetSpacing(unsigned int i) const ITK_OVERRIDE
virtual bool CanReadCamera(CameraIDType cameraID) const ITK_OVERRIDE
virtual bool CanWriteFile(const char *) ITK_OVERRIDE
double TemporalRatioType
double TemporalOffsetType
virtual bool CanReadFile(const char *) ITK_OVERRIDE