Mercurial > hg > orthanc-stone
comparison Framework/Volumes/VolumeImageGeometry.cpp @ 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 | 19b1c8caade4 2d8ab34c8c91 |
comparison
equal
deleted
inserted
replaced
948:141cc19e6b7d | 949:32eaf4929b08 |
---|---|
44 Vector origin = ( | 44 Vector origin = ( |
45 axialGeometry_.MapSliceToWorldCoordinates(-0.5 * voxelDimensions_[0], | 45 axialGeometry_.MapSliceToWorldCoordinates(-0.5 * voxelDimensions_[0], |
46 -0.5 * voxelDimensions_[1]) - | 46 -0.5 * voxelDimensions_[1]) - |
47 0.5 * voxelDimensions_[2] * axialGeometry_.GetNormal()); | 47 0.5 * voxelDimensions_[2] * axialGeometry_.GetNormal()); |
48 | 48 |
49 LOG(TRACE) << "VolumeImageGeometry::Invalidate() origin = " << origin(0) << "," << origin(1) << "," << origin(2) << " | width_ = " << width_ << " | height_ = " << height_ << " | depth_ = " << depth_; | |
50 | |
49 Vector scaling; | 51 Vector scaling; |
50 | 52 |
51 if (width_ == 0 || | 53 if (width_ == 0 || |
52 height_ == 0 || | 54 height_ == 0 || |
53 depth_ == 0) | 55 depth_ == 0) |
78 LinearAlgebra::AssignVector(voxelDimensions_, 1, 1, 1); | 80 LinearAlgebra::AssignVector(voxelDimensions_, 1, 1, 1); |
79 Invalidate(); | 81 Invalidate(); |
80 } | 82 } |
81 | 83 |
82 | 84 |
83 void VolumeImageGeometry::SetSize(unsigned int width, | 85 void VolumeImageGeometry::SetSizeInVoxels(unsigned int width, |
84 unsigned int height, | 86 unsigned int height, |
85 unsigned int depth) | 87 unsigned int depth) |
86 { | 88 { |
87 width_ = width; | 89 width_ = width; |
88 height_ = height; | 90 height_ = height; |
321 | 323 |
322 plane.SetOrigin(plane.GetOrigin() + static_cast<double>(z) * plane.GetNormal() * dim[2]); | 324 plane.SetOrigin(plane.GetOrigin() + static_cast<double>(z) * plane.GetNormal() * dim[2]); |
323 | 325 |
324 return plane; | 326 return plane; |
325 } | 327 } |
328 | |
329 std::ostream& operator<<(std::ostream& s, const VolumeImageGeometry& v) | |
330 { | |
331 s << "width: " << v.width_ << " height: " << v.height_ | |
332 << " depth: " << v.depth_ | |
333 << " axialGeometry: " << v.axialGeometry_ | |
334 << " coronalGeometry: " << v.coronalGeometry_ | |
335 << " sagittalGeometry: " << v.sagittalGeometry_ | |
336 << " voxelDimensions_: " << v.voxelDimensions_ | |
337 << " height: " << v.height_ | |
338 << " transform: " << v.transform_ | |
339 << " transformInverse: " << v.transformInverse_; | |
340 return s; | |
341 } | |
342 | |
326 } | 343 } |