ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkVideoSource.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 itkVideoSource_h
19 #define itkVideoSource_h
20 
22 #include "itkVideoStream.h"
23 
24 namespace itk
25 {
26 
42 template< typename TOutputVideoStream >
44 {
45 public:
46 
47  /*-TYPEDEFS----------------------------------------------------------------*/
48 
50  typedef VideoSource Self;
55  typedef TOutputVideoStream OutputVideoStreamType;
56 
65 
66  itkNewMacro(Self);
67 
69  itkTypeMacro(VideoSource, TemporalProcessObject);
70 
71  /*-PUBLIC METHODS----------------------------------------------------------*/
72 
74  itkStaticConstMacro(OutputFrameDimension, unsigned int, OutputFrameType::ImageDimension);
75  static unsigned int GetOutputFrameDimension()
76  {
77  return OutputFrameType::ImageDimension;
78  }
80 
86 
87  OutputVideoStreamType* GetOutput(unsigned int idx);
88 
91  virtual void GraftNthOutput(unsigned int idx, OutputVideoStreamType* output);
92 
96  virtual void GraftOutput(OutputVideoStreamType* output);
97 
104 
105 protected:
106 
118  virtual void GenerateOutputRequestedTemporalRegion(TemporalDataObject* output) ITK_OVERRIDE;
119 
125  virtual void TemporalStreamingGenerateData() ITK_OVERRIDE;
126 
138  virtual void ThreadedGenerateData(
139  const OutputFrameSpatialRegionType& outputRegionForThread,
140  int threadId);
141 
147  virtual void AllocateOutputs();
148 
151  virtual void BeforeThreadedGenerateData() {
152  }
153 
156  virtual void AfterThreadedGenerateData() {
157  }
158 
162  virtual int SplitRequestedSpatialRegion(int i, int num,
163  OutputFrameSpatialRegionType& splitRegion);
164 
167  static ITK_THREAD_RETURN_TYPE ThreaderCallback(void* arg);
168 
171  struct ThreadStruct {
173  };
174 
175  VideoSource();
176  virtual ~VideoSource();
177  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
178 
179 private:
180 
181  VideoSource(const Self &) ITK_DELETE_FUNCTION;
182  void operator=(const Self &) ITK_DELETE_FUNCTION;
183 
184 }; // end class VideoSource
185 
186 } // end namespace itk
187 
188 #ifndef ITK_MANUAL_INSTANTIATION
189 #include "itkVideoSource.hxx"
190 #endif
191 
192 #endif
Light weight base class for most itk classes.
TemporalProcessObject Superclass
static unsigned int GetOutputFrameDimension()
FrameType::PixelType PixelType
FrameType::RegionType SpatialRegionType
virtual void GraftNthOutput(unsigned int idx, OutputVideoStreamType *output)
virtual void PrintSelf(std::ostream &os, Indent indent) const override
virtual void ThreadedGenerateData(const OutputFrameSpatialRegionType &outputRegionForThread, int threadId)
static const unsigned int OutputFrameDimension
virtual void BeforeThreadedGenerateData()
virtual void GraftOutput(OutputVideoStreamType *output)
Implements a weak reference to an object.
FrameType::PointType PointType
A TemporalProcessObject that produces a VideoStream.
#define ITK_THREAD_RETURN_TYPE
virtual int SplitRequestedSpatialRegion(int i, int num, OutputFrameSpatialRegionType &splitRegion)
OutputVideoStreamType::DirectionType OutputFrameDirectionType
TOutputVideoStream OutputVideoStreamType
SmartPointer< const Self > ConstPointer
TemporalProcessObject implements a ProcessObject for the itk pipeline with the notion of a temporal r...
OutputVideoStreamType::PointType OutputFramePointType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
VideoSource Self
virtual void TemporalStreamingGenerateData() override
FrameType::DirectionType DirectionType
SmartPointer< Self > Pointer
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
Make a DataObject of the correct type to used as the specified output.
FrameType::SizeType SizeType
virtual void AllocateOutputs()
OutputVideoStreamType::SpatialRegionType OutputFrameSpatialRegionType
TFrameType FrameType
OutputVideoStreamType::FrameType OutputFrameType
virtual ~VideoSource()
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
virtual void GenerateOutputRequestedTemporalRegion(TemporalDataObject *output) override
static ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg)
OutputVideoStreamType::SizeType OutputFrameSizeType
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
FrameType::IndexType IndexType
OutputVideoStreamType::IndexType OutputFrameIndexType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
DataObject subclass with knowledge of temporal region.
virtual void AfterThreadedGenerateData()
OutputVideoStreamType * GetOutput()
OutputVideoStreamType::SpacingType OutputFrameSpacingType
OutputVideoStreamType::PixelType OutputFramePixelType
WeakPointer< const Self > ConstWeakPointer
FrameType::SpacingType SpacingType