Fraxinus  2023.01.05-dev+develop.0da12
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_
virtual IMAGE_SUBTYPE getImageType() const
boost::shared_ptr< class RegistrationHistory > RegistrationHistoryPtr
Definition: cxDataManager.h:37
virtual RegistrationHistoryPtr get_rMd_History()
virtual QString getType() const
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
#define CALL_IN_WEAK_PTR(weak_base, func, defarg)
virtual IMAGE_MODALITY getModality() const
virtual QString getFilename() const
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
virtual Image::ShadingStruct getShading() const
A volumetric data set.
Definition: cxImage.h:45
Identification of a Coordinate system.
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,xmax,ymin,ymax,zmin,zmax}, in order to simplify communication with vtk.
Class that holds an unsigned version of a base Image.
virtual QString getName() const
virtual QDateTime getAcquisitionTime() const
vtkSmartPointer< class vtkImageData > vtkImageDataPtr
virtual Transform3D get_rMd() const
virtual DoubleBoundingBox3D boundingBox() const
bounding box in image space
Namespace for all CustusX production code.