CustusX  22.04-rc5
An IGT application
cxIGTLinkConversionImage.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 
14  Portions (c) Copyright 2008-2009 Brigham and Women's Hospital (BWH) All Rights Reserved.
15 
16  See Doc/copyright/copyright.txt
17  or http://www.slicer.org/copyright/copyright.txt for details.
18 
19  Program: 3D Slicer
20  Module: $HeadURL: http://svn.slicer.org/Slicer3/trunk/Modules/OpenIGTLinkIF/vtkIGTLToMRMLImage.h $
21  Date: $Date: 2010-11-23 00:58:13 -0500 (Tue, 23 Nov 2010) $
22  Version: $Revision: 15552 $
23 
24 ==========================================================================*/
25 #ifndef CXIGTLINKCONVERSIONIMAGE_H
26 #define CXIGTLINKCONVERSIONIMAGE_H
27 
28 #include "igtlImageMessage.h"
29 #include "cxImage.h"
30 #include "cxOpenIGTLinkUtilitiesExport.h"
31 
32 
33 namespace cx
34 {
35 
47 class cxOpenIGTLinkUtilities_EXPORT IGTLinkConversionImage
48 {
49 public:
50  igtl::ImageMessage::Pointer encode(ImagePtr in, PATIENT_COORDINATE_SYSTEM externalSpace);
51  ImagePtr decode(igtl::ImageMessage *in);
52 
53 private:
54  vtkImageDataPtr decode_vtkImageData(igtl::ImageMessage* in);
55  void decode_rMd(igtl::ImageMessage* msg, ImagePtr out);
56 // void encode_Transform3D(Transform3D rMd, igtl::ImageMessage *outmsg);
57  void encode_rMd(ImagePtr image, igtl::ImageMessage *outmsg, PATIENT_COORDINATE_SYSTEM externalSpace);
58  void encode_vtkImageData(vtkImageDataPtr in, igtl::ImageMessage *outmsg);
59 
60 private:
61  int IGTLToVTKScalarType(int igtlType);
62  Transform3D getMatrix(igtl::ImageMessage *msg);
63  void setMatrix(igtl::ImageMessage *msg, Transform3D matrix);
64  int getIgtlCoordinateSystem(PATIENT_COORDINATE_SYSTEM space) const;
65  PATIENT_COORDINATE_SYSTEM getPatientCoordinateSystem(int igtlSpace) const;
66 };
67 
68 } //namespace cx
69 
70 #endif // CXIGTLINKCONVERSIONIMAGE_H
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Namespace for all CustusX production code.