CustusX  22.04
An IGT application
cxMHDImageStreamer.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXMHDIMAGESTREAMER_H_
13 #define CXMHDIMAGESTREAMER_H_
14 
15 #include "cxGrabberExport.h"
16 
17 #include "boost/shared_ptr.hpp"
18 #include "cxStreamer.h"
19 #include "cxForwardDeclarations.h"
20 
21 class QTimer;
22 class QDomElement;
23 
24 namespace cx
25 {
26 
27 typedef boost::shared_ptr<struct Package> PackagePtr;
28 typedef boost::shared_ptr<class FilePathProperty> FilePathPropertyPtr;
29 
30 vtkImageDataPtr loadImage(QString filename);
31 vtkLookupTablePtr createLookupTable(int numberOfTableValues);
34 
42 class cxGrabber_EXPORT ImageTestData
43 {
44 public:
45  static ImageTestData initializePrimaryData(vtkImageDataPtr source, QString filename);
46  static ImageTestData initializeSecondaryData(vtkImageDataPtr source, QString filename);
47  static PackagePtr createPackage(ImageTestData* data);
48 
50  boost::shared_ptr<class SplitFramesContainer> mDataSource;
52  QString mRawUid;
53 };
54 typedef boost::shared_ptr<class ImageTestData> ImageTestDataPtr;
55 
58 class cxGrabber_EXPORT ImageStreamerDummyArguments
59 {
60 public:
61  QStringList getArgumentDescription();
62  virtual std::vector<PropertyPtr> getSettings(QDomElement root);
63  StringMap convertToCommandLineArguments(QDomElement root);
64 
65  FilePathPropertyPtr getFilenameOption(QDomElement root);
66  BoolPropertyBasePtr getSecondaryOption(QDomElement root);
67 };
68 
69 
78 class cxGrabber_EXPORT DummyImageStreamer: public CommandLineStreamer
79 {
80 Q_OBJECT
81 
82 public:
84  virtual ~DummyImageStreamer(){};
85 
86  virtual void initialize(QString filename, bool secondaryStream, bool sendonce = false);
87  virtual void initialize(StringMap arguments);
88  virtual void startStreaming(SenderPtr sender);
89  virtual void stopStreaming();
90  virtual bool isStreaming();
91 
92  virtual QString getType();
93  virtual QStringList getArgumentDescription();
94 
95 private slots:
96  virtual void streamSlot();
97 
98 private:
99  vtkImageDataPtr internalLoadImage(QString filename);
100  QString getFileName();
101  void setSendOnce(bool sendonce);
102  bool mSendOnce;
103  QString mFilename;
104 
105  bool shouldSetupSecondaryDataSource();
106  vtkSmartPointer<vtkImageData> hasSecondaryData();
107  void createTestDataSource(vtkImageDataPtr source);
108  void sendTestDataFrames();
109 
110  bool mUseSecondaryStream;
111  ImageTestData mPrimaryDataSource;
112  ImageTestData mSecondaryDataSource;
113 };
114 typedef boost::shared_ptr<class DummyImageStreamer> DummyImageStreamerPtr;
115 
116 }
117 
118 #endif /* CXMHDIMAGESTREAMER_H_ */
boost::shared_ptr< class ImageTestData > ImageTestDataPtr
vtkLookupTablePtr createLookupTable(int numberOfTableValues)
vtkImageDataPtr mImageData
std::map< QString, QString > StringMap
boost::shared_ptr< class BoolPropertyBase > BoolPropertyBasePtr
vtkSmartPointer< class vtkLookupTable > vtkLookupTablePtr
vtkImageDataPtr applyLUTToImage(vtkImageDataPtr input, vtkLookupTablePtr lut)
boost::shared_ptr< struct Package > PackagePtr
boost::shared_ptr< class SplitFramesContainer > mDataSource
vtkImageDataPtr convertToTestColorImage(vtkImageDataPtr image)
boost::shared_ptr< class FilePathProperty > FilePathPropertyPtr
boost::shared_ptr< class DummyImageStreamer > DummyImageStreamerPtr
boost::shared_ptr< Sender > SenderPtr
Definition: cxSender.h:64
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
vtkImageDataPtr loadImage(QString filename)
Namespace for all CustusX production code.