comparison Framework/Toolbox/LinearAlgebra.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 61ba4b504e9a
children 1f74bc3459ba
comparison
equal deleted inserted replaced
948:141cc19e6b7d 949:32eaf4929b08
19 **/ 19 **/
20 20
21 21
22 #include "LinearAlgebra.h" 22 #include "LinearAlgebra.h"
23 23
24 #include "../StoneException.h"
25
24 #include <Core/Logging.h> 26 #include <Core/Logging.h>
25 #include <Core/OrthancException.h> 27 #include <Core/OrthancException.h>
26 #include <Core/Toolbox.h> 28 #include <Core/Toolbox.h>
27 29
28 #include <stdio.h>
29 #include <boost/lexical_cast.hpp> 30 #include <boost/lexical_cast.hpp>
30 #include <boost/numeric/ublas/lu.hpp> 31 #include <boost/numeric/ublas/lu.hpp>
32
33 #include <stdio.h>
34 #include <iostream>
31 35
32 namespace OrthancStone 36 namespace OrthancStone
33 { 37 {
34 namespace LinearAlgebra 38 namespace LinearAlgebra
35 { 39 {
650 m(3,2) = -shear(3,2); 654 m(3,2) = -shear(3,2);
651 655
652 return m; 656 return m;
653 } 657 }
654 } 658 }
659
660 std::ostream& operator<<(std::ostream& s, const Vector& vec)
661 {
662 s << "(";
663 for (size_t i = 0; i < vec.size(); ++i)
664 {
665 s << vec(i);
666 if (i < (vec.size() - 1))
667 s << ", ";
668 }
669 s << ")";
670 return s;
671 }
672
673 std::ostream& operator<<(std::ostream& s, const Matrix& m)
674 {
675 ORTHANC_ASSERT(m.size1() == m.size2());
676 s << "(";
677 for (size_t i = 0; i < m.size1(); ++i)
678 {
679 s << "(";
680 for (size_t j = 0; j < m.size2(); ++j)
681 {
682 s << m(i,j);
683 if (j < (m.size2() - 1))
684 s << ", ";
685 }
686 s << ")";
687 if (i < (m.size1() - 1))
688 s << ", ";
689 }
690 s << ")";
691 return s;
692 }
655 } 693 }