comparison Framework/Volumes/VolumeImageGeometry.h @ 949:32eaf4929b08 toa2019081301

OrthancMultiframeVolumeLoader and OrthancSeriesVolumeProgressiveLoader now implement IGeometryProvider so that the geometry reference can be switched (CT or DOSE, for instance) + VolumeImageGeometry::SetSize renamed to VolumeImageGeometry::SetSizeInVoxels + prevent text layer update if text or properties do not change + a few stream operator<< for debug (Vector, Matrix,...) + fixed memory access aligment issues in ImageBuffer3D::ExtractSagittalSlice + fix for wrong screen Y offset of mpr slices in DicomVolumeImageMPRSlicer.
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 13 Aug 2019 16:01:05 +0200
parents ffec76a5f7eb
children 2d8ab34c8c91
comparison
equal deleted inserted replaced
948:141cc19e6b7d 949:32eaf4929b08
22 #pragma once 22 #pragma once
23 23
24 #include "../StoneEnumerations.h" 24 #include "../StoneEnumerations.h"
25 #include "../Toolbox/CoordinateSystem3D.h" 25 #include "../Toolbox/CoordinateSystem3D.h"
26 26
27 #include <iosfwd>
28
27 namespace OrthancStone 29 namespace OrthancStone
28 { 30 {
29 class VolumeImageGeometry 31 class VolumeImageGeometry
30 { 32 {
31 private: 33 private:
38 Vector voxelDimensions_; 40 Vector voxelDimensions_;
39 Matrix transform_; 41 Matrix transform_;
40 Matrix transformInverse_; 42 Matrix transformInverse_;
41 43
42 void Invalidate(); 44 void Invalidate();
45
46 friend std::ostream& operator<<(std::ostream& s, const VolumeImageGeometry& v);
43 47
44 public: 48 public:
45 VolumeImageGeometry(); 49 VolumeImageGeometry();
46 50
47 unsigned int GetWidth() const 51 unsigned int GetWidth() const
84 const Matrix& GetTransformInverse() const 88 const Matrix& GetTransformInverse() const
85 { 89 {
86 return transformInverse_; 90 return transformInverse_;
87 } 91 }
88 92
89 void SetSize(unsigned int width, 93 void SetSizeInVoxels(unsigned int width,
90 unsigned int height, 94 unsigned int height,
91 unsigned int depth); 95 unsigned int depth);
92 96
93 // Set the geometry of the first axial slice (i.e. the one whose 97 // Set the geometry of the first axial slice (i.e. the one whose
94 // depth == 0) 98 // depth == 0)
118 /** 122 /**
119 Being given a cutting plane, this method will determine if it is an 123 Being given a cutting plane, this method will determine if it is an
120 axial, sagittal or coronal cut and returns 124 axial, sagittal or coronal cut and returns
121 the slice number corresponding to this cut. 125 the slice number corresponding to this cut.
122 126
123 If the cutting plane is not parallel to the tree x = 0, y = 0 or z = 0 127 If the cutting plane is not parallel to the three x = 0, y = 0 or z = 0
124 planes, it is considered as arbitrary and the method returns false. 128 planes, it is considered as arbitrary and the method returns false.
125 Otherwise, it returns true. 129 Otherwise, it returns true.
126 */ 130 */
127 bool DetectSlice(VolumeProjection& projection, 131 bool DetectSlice(VolumeProjection& projection,
128 unsigned int& slice, 132 unsigned int& slice,