NorMIT-nav  22.09
An IGT application
cxUnsignedDerivedImage.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 CXUNSIGNEDDERIVEDIMAGE_H_
14 #define CXUNSIGNEDDERIVEDIMAGE_H_
15 
16 #include "cxResourceExport.h"
17 #include "cxPrecompiledHeader.h"
18 
19 #include "cxImage.h"
20 
21 #define CALL_IN_WEAK_PTR(weak_base, func, defarg) \
22 { \
23  ImagePtr base = weak_base.lock(); \
24  if (!base) \
25  return defarg; \
26  return base->func(); \
27 }
28 
29 namespace cx
30 {
31 struct CoordinateSystem;
32 
43 class cxResource_EXPORT UnsignedDerivedImage : public Image
44 {
45  Q_OBJECT
46 public:
47  static ImagePtr create(ImagePtr base);
48 
49 
51 // virtual QString getUid() const { CALL_IN_WEAK_PTR(mBase, getUid, QString()); }
52  virtual QString getName() const { CALL_IN_WEAK_PTR(mBase, getName, QString()); }
53  virtual QString getFilename() const { CALL_IN_WEAK_PTR(mBase, getFilename, QString()); }
54  virtual Transform3D get_rMd() const { CALL_IN_WEAK_PTR(mBase, get_rMd, Transform3D()); }
55  virtual Image::ShadingStruct getShading() const { CALL_IN_WEAK_PTR(mBase, getShading, Image::ShadingStruct()); }
56  virtual QDateTime getAcquisitionTime() const { CALL_IN_WEAK_PTR(mBase, getAcquisitionTime, QDateTime()); }
57  virtual QString getType() const { CALL_IN_WEAK_PTR(mBase, getType, QString()); }
58  virtual QString getSpace() { CALL_IN_WEAK_PTR(mBase, getSpace, QString()); }
59  virtual QString getParentSpace() { CALL_IN_WEAK_PTR(mBase, getParentSpace, QString()); }
60  virtual DoubleBoundingBox3D boundingBox() const { CALL_IN_WEAK_PTR(mBase, boundingBox, DoubleBoundingBox3D()); }
61  virtual CoordinateSystem getCoordinateSystem();
62 
63  virtual IMAGE_MODALITY getModality() const { CALL_IN_WEAK_PTR(mBase, getModality, IMAGE_MODALITY()); }
64  virtual IMAGE_SUBTYPE getImageType() const { CALL_IN_WEAK_PTR(mBase, getImageType, IMAGE_SUBTYPE()); }
65 
66 private slots:
67  void unsignedTransferFunctionsChangedSlot();
68  void unsignedImageChangedSlot();
69  void testSlot();
70 
71 private:
73  int findShift();
74  vtkImageDataPtr convertImage();
75  void convertTransferFunctions();
76 
77  boost::weak_ptr<Image> mBase;
78 };
79 
80 }
81 #endif // CXUNSIGNEDDERIVEDIMAGE_H_
cx::UnsignedDerivedImage::getAcquisitionTime
virtual QDateTime getAcquisitionTime() const
Definition: cxUnsignedDerivedImage.h:56
cx::DoubleBoundingBox3D
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,...
Definition: cxBoundingBox3D.h:63
cx::UnsignedDerivedImage::getImageType
virtual IMAGE_SUBTYPE getImageType() const
Definition: cxUnsignedDerivedImage.h:64
CALL_IN_WEAK_PTR
#define CALL_IN_WEAK_PTR(weak_base, func, defarg)
Definition: cxUnsignedDerivedImage.h:21
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxPrecompiledHeader.h
cxImage.h
cx::UnsignedDerivedImage::getParentSpace
virtual QString getParentSpace()
Definition: cxUnsignedDerivedImage.h:59
cx::UnsignedDerivedImage::get_rMd_History
virtual RegistrationHistoryPtr get_rMd_History()
Definition: cxUnsignedDerivedImage.h:50
cx::UnsignedDerivedImage::boundingBox
virtual DoubleBoundingBox3D boundingBox() const
bounding box in image space
Definition: cxUnsignedDerivedImage.h:60
vtkImageDataPtr
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
Definition: cxVideoConnectionWidget.h:30
cx::Image::ShadingStruct
Definition: cxImage.h:50
cx::UnsignedDerivedImage::getType
virtual QString getType() const
Definition: cxUnsignedDerivedImage.h:57
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::UnsignedDerivedImage
Class that holds an unsigned version of a base Image.
Definition: cxUnsignedDerivedImage.h:43
cx::RegistrationHistoryPtr
boost::shared_ptr< class RegistrationHistory > RegistrationHistoryPtr
Definition: cxDataManager.h:37
cx::ImagePtr
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
cx::UnsignedDerivedImage::get_rMd
virtual Transform3D get_rMd() const
Definition: cxUnsignedDerivedImage.h:54
cx::UnsignedDerivedImage::getShading
virtual Image::ShadingStruct getShading() const
Definition: cxUnsignedDerivedImage.h:55
cx::Image
A volumetric data set.
Definition: cxImage.h:45
cx::UnsignedDerivedImage::getName
virtual QString getName() const
Definition: cxUnsignedDerivedImage.h:52
cx::UnsignedDerivedImage::getModality
virtual IMAGE_MODALITY getModality() const
Definition: cxUnsignedDerivedImage.h:63
cx::UnsignedDerivedImage::getSpace
virtual QString getSpace()
Definition: cxUnsignedDerivedImage.h:58
cx::CoordinateSystem
Identification of a Coordinate system.
Definition: cxCoordinateSystemHelpers.h:31
cx::UnsignedDerivedImage::getFilename
virtual QString getFilename() const
Definition: cxUnsignedDerivedImage.h:53