ITK  4.13.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 >
43 class ITK_TEMPLATE_EXPORT VideoSource : public TemporalProcessObject
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 
85  OutputVideoStreamType* GetOutput();
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 
102  using Superclass::MakeOutput;
103  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE;
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() ITK_OVERRIDE;
177  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
178 
179 private:
180 
181  ITK_DISALLOW_COPY_AND_ASSIGN(VideoSource);
182 
183 }; // end class VideoSource
184 
185 } // end namespace itk
186 
187 #ifndef ITK_MANUAL_INSTANTIATION
188 #include "itkVideoSource.hxx"
189 #endif
190 
191 #endif
Light weight base class for most itk classes.
TemporalProcessObject Superclass
static unsigned int GetOutputFrameDimension()
FrameType::PixelType PixelType
FrameType::RegionType SpatialRegionType
Implements a weak reference to an object.
FrameType::PointType PointType
A TemporalProcessObject that produces a VideoStream.
#define ITK_THREAD_RETURN_TYPE
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
FrameType::DirectionType DirectionType
SmartPointer< Self > Pointer
FrameType::SizeType SizeType
OutputVideoStreamType::SpatialRegionType OutputFrameSpatialRegionType
TFrameType FrameType
OutputVideoStreamType::FrameType OutputFrameType
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::SpacingType OutputFrameSpacingType
OutputVideoStreamType::PixelType OutputFramePixelType
WeakPointer< const Self > ConstWeakPointer
FrameType::SpacingType SpacingType