Fraxinus  18.10
An IGT application
cxSlicedImageProxy.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 
13 #ifndef CXSLICEDIMAGEPROXY_H_
14 #define CXSLICEDIMAGEPROXY_H_
15 
16 #include "cxResourceExport.h"
17 
18 #include <QObject>
19 #include "cxIndent.h"
20 #include "cxTransform3D.h"
21 #include "vtkForwardDeclarations.h"
22 
23 namespace cx
24 {
25 // forward declarations
26 typedef boost::shared_ptr<class Image> ImagePtr;
27 typedef boost::shared_ptr<class SliceProxy> SliceProxyPtr;
28 typedef boost::shared_ptr<class SliceProxyInterface> SliceProxyInterfacePtr;
29 
30 typedef boost::shared_ptr<class SlicedImageProxy> SlicedImageProxyPtr;
31 typedef boost::shared_ptr<class ApplyLUTToImage2DProxy> ApplyLUTToImage2DProxyPtr;
32 
48 class cxResource_EXPORT ApplyLUTToImage2DProxy : public QObject
49 {
50 Q_OBJECT
51 public:
53  virtual ~ApplyLUTToImage2DProxy();
54  void setInputData(vtkImageDataPtr image, vtkLookupTablePtr lut);
55  void setInput(vtkImageAlgorithmPtr input, vtkLookupTablePtr lut);
56  vtkImageDataPtr getOutput();
57  vtkImageAlgorithmPtr getOutputPort();
58 
59 private:
60  vtkImageDataPtr mDummyImage;
61  vtkImageAlgorithmPtr mRedirecter;
62 };
63 
76 class cxResource_EXPORT SlicedImageProxy : public QObject
77 {
78 Q_OBJECT
79 public:
81  virtual ~SlicedImageProxy();
82  void setSliceProxy(SliceProxyInterfacePtr slicer);
83  void setImage(ImagePtr image);
84  ImagePtr getImage() const;
85  void setOutputFormat(Vector3D origin, Eigen::Array3i dim, Vector3D spacing);
86  void update();
87  vtkImageDataPtr getOutput();
88  vtkImageAlgorithmPtr getOutputPort();
89  vtkImageDataPtr getOutputWithoutLUT();
90  vtkImageAlgorithmPtr getOutputPortWithoutLUT();
91  void printSelf(std::ostream & os, Indent indent);
92 
93 private slots:
94  void transformChangedSlot();
95  void transferFunctionsChangedSlot();
96  void updateRedirecterSlot();
97 
98 private:
99  ApplyLUTToImage2DProxyPtr mImageWithLUTProxy;
100 
101  SliceProxyInterfacePtr mSlicer;
102  ImagePtr mImage;
103 
104  vtkImageReslicePtr mReslicer;
105  vtkMatrix4x4Ptr mMatrixAxes;
106 
107  vtkImageChangeInformationPtr mRedirecter;
108 };
109 
110 //---------------------------------------------------------
111 }//end namespace
112 //---------------------------------------------------------
113 #endif /*CXSLICEDIMAGEPROXY_H_*/
vtkSmartPointer< class vtkMatrix4x4 > vtkMatrix4x4Ptr
Definition: cxMathBase.h:37
boost::shared_ptr< class SliceProxy > SliceProxyPtr
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
vtkSmartPointer< vtkImageChangeInformation > vtkImageChangeInformationPtr
Definition: cxImage.cpp:46
boost::shared_ptr< class SlicedImageProxy > SlicedImageProxyPtr
Helper class for slicing an image given a SliceProxy and an image.
boost::shared_ptr< class ApplyLUTToImage2DProxy > ApplyLUTToImage2DProxyPtr
vtkSmartPointer< class vtkImageAlgorithm > vtkImageAlgorithmPtr
vtkSmartPointer< class vtkImageReslice > vtkImageReslicePtr
Formatting class for debug printing of the ssc library.
Definition: cxIndent.h:28
vtkSmartPointer< class vtkLookupTable > vtkLookupTablePtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
boost::shared_ptr< class SliceProxyInterface > SliceProxyInterfacePtr
Helper class for applying sscLUT2D to an image.
Namespace for all CustusX production code.