comparison UnitTestsSources/UnitTestsMain.cpp @ 809:e8fdf29cd0ca

VolumeImageGeometry::GetProjectionSlice()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 28 May 2019 18:09:26 +0200
parents 4fe4b221a31f
children 118fc5c85d07
comparison
equal deleted inserted replaced
807:c237e0625065 809:e8fdf29cd0ca
697 for (int p = 0; p < 3; p++) 697 for (int p = 0; p < 3; p++)
698 { 698 {
699 OrthancStone::VolumeProjection projection = (OrthancStone::VolumeProjection) p; 699 OrthancStone::VolumeProjection projection = (OrthancStone::VolumeProjection) p;
700 const OrthancStone::CoordinateSystem3D& s = g.GetProjectionGeometry(projection); 700 const OrthancStone::CoordinateSystem3D& s = g.GetProjectionGeometry(projection);
701 701
702 ASSERT_THROW(g.GetProjectionSlice(projection, g.GetProjectionDepth(projection)), Orthanc::OrthancException);
703
702 for (unsigned int i = 0; i < g.GetProjectionDepth(projection); i++) 704 for (unsigned int i = 0; i < g.GetProjectionDepth(projection); i++)
703 { 705 {
704 OrthancStone::CoordinateSystem3D plane( 706 OrthancStone::CoordinateSystem3D plane = g.GetProjectionSlice(projection, i);
705 s.GetOrigin() + static_cast<double>(i) * s.GetNormal() * g.GetVoxelDimensions(projection)[2], 707
706 s.GetAxisX(), 708 ASSERT_TRUE(IsEqualVector(plane.GetOrigin(), s.GetOrigin() + static_cast<double>(i) *
707 s.GetAxisY()); 709 s.GetNormal() * g.GetVoxelDimensions(projection)[2]));
710 ASSERT_TRUE(IsEqualVector(plane.GetAxisX(), s.GetAxisX()));
711 ASSERT_TRUE(IsEqualVector(plane.GetAxisY(), s.GetAxisY()));
708 712
709 unsigned int slice; 713 unsigned int slice;
710 OrthancStone::VolumeProjection q; 714 OrthancStone::VolumeProjection q;
711 ASSERT_TRUE(g.DetectSlice(q, slice, plane)); 715 ASSERT_TRUE(g.DetectSlice(q, slice, plane));
712 ASSERT_EQ(projection, q); 716 ASSERT_EQ(projection, q);
713 ASSERT_EQ(i, slice); 717 ASSERT_EQ(i, slice);
714 } 718 }
715 } 719 }
716 } 720 }
717 721
718 int main(int argc, char **argv) 722 int main(int argc, char **argv)