Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLStreamingVolumeNode.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3 Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4 Queen's University, Kingston, ON, Canada. All Rights Reserved.
5 
6 See COPYRIGHT.txt
7 or http://www.slicer.org/copyright/copyright.txt for details.
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 
15 This file was originally developed by Kyle Sunderland, PerkLab, Queen's University
16 and was supported through CANARIE's Research Software Program, and Cancer
17 Care Ontario.
18 
19 ==============================================================================*/
20 
21 #ifndef __vtkMRMLStreamingVolumeNode_h
22 #define __vtkMRMLStreamingVolumeNode_h
23 
24 // MRML includes
25 #include "vtkMRML.h"
26 #include "vtkMRMLNode.h"
27 #include "vtkMRMLStorageNode.h"
31 
32 // vtkAddon includes
34 
35 // VTK includes
36 #include <vtkImageData.h>
37 #include <vtkObject.h>
38 #include <vtkStdString.h>
39 #include <vtkUnsignedCharArray.h>
40 
46 {
47 public:
50  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
51 
52  virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;
53 
54  virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) VTK_OVERRIDE;
55 
57  virtual void ReadXMLAttributes(const char** atts) VTK_OVERRIDE;
58 
60  virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;
61 
63  virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;
64 
66  virtual const char* GetNodeTagName() VTK_OVERRIDE
67  {return "StreamingVolume";}
68 
71  virtual void SetAndObserveImageData(vtkImageData* imageData) VTK_OVERRIDE;
72  virtual vtkImageData* GetImageData() VTK_OVERRIDE;
73  virtual vtkAlgorithmOutput* GetImageDataConnection() VTK_OVERRIDE;
74 
77  void SetAndObserveFrame(vtkStreamingVolumeFrame* frame);
78 
80  vtkStreamingVolumeFrame* GetFrame(){return this->Frame.GetPointer();};
81 
84  virtual bool EncodeImageData(bool forceKeyFrame = false);
85 
88  virtual bool DecodeFrame();
89 
92  virtual bool IsKeyFrame();
93 
96  static void FrameModifiedCallback(vtkObject *caller, unsigned long eid, void* clientData, void* callData);
97  enum
98  {
99  FrameModifiedEvent = 18002
100  };
101 
103  vtkSetMacro(Codec, vtkStreamingVolumeCodec*);
104  vtkStreamingVolumeCodec* GetCodec();
105 
108  vtkGetMacro(CodecFourCC, std::string);
109  vtkSetMacro(CodecFourCC, std::string);
110 
113  void SetCodecParameterString(std::string parameterString);
114  std::string GetCodecParameterString();
115 
116 protected:
121 
123  void AllocateImageForFrame(vtkImageData* imageData);
124 
126  bool HasExternalImageObserver();
127 
128 protected:
129  vtkSmartPointer<vtkStreamingVolumeCodec> Codec;
130  std::string CodecFourCC;
131  vtkSmartPointer<vtkStreamingVolumeFrame> Frame;
134  vtkSmartPointer<vtkCallbackCommand> FrameModifiedCallbackCommand;
135 
136 };
137 
138 #endif
vtkSmartPointer< vtkCallbackCommand > FrameModifiedCallbackCommand
VTK object containing a single compressed frame.
VTK object for representing a volume compression codec (normally a video compression codec) ...
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
MRML node for representing a single compressed video frame that can be decoded to an image representa...
void operator=(const vtkMRMLVectorVolumeNode &)
vtkSmartPointer< vtkStreamingVolumeCodec > Codec
static vtkMRMLVectorVolumeNode * New()
MRML node for representing a vector volume (image stack).
vtkSmartPointer< vtkStreamingVolumeFrame > Frame
virtual void SetAndObserveImageData(vtkImageData *ImageData)
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
virtual vtkImageData * GetImageData()
virtual vtkMRMLNode * CreateNodeInstance() VTK_OVERRIDE
MRMLNode methods.