comparison OrthancStone/UnitTestsSources/GeometryToolboxTests.cpp @ 1961:cbf54cd28d59

added CoordinateSystem3D::GetOrientationMarkers()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Oct 2022 18:43:20 +0200
parents a2955abe4c2e
children 07964689cb0b
comparison
equal deleted inserted replaced
1960:40f8009ceb4e 1961:cbf54cd28d59
1089 OrthancStone::CoordinateSystem3D("-217.0492\\-161.4141\\376.61", "1\\0\\0\\0\\1\\0"))); 1089 OrthancStone::CoordinateSystem3D("-217.0492\\-161.4141\\376.61", "1\\0\\0\\0\\1\\0")));
1090 ASSERT_EQ(OrthancStone::VolumeProjection_Axial, projection); 1090 ASSERT_EQ(OrthancStone::VolumeProjection_Axial, projection);
1091 ASSERT_EQ(376u - 323u, slice); 1091 ASSERT_EQ(376u - 323u, slice);
1092 } 1092 }
1093 } 1093 }
1094
1095
1096 TEST(GeometryToolbox, OrientationMarkers)
1097 {
1098 std::string top, bottom, left, right;
1099
1100 OrthancStone::CoordinateSystem3D s;
1101 ASSERT_FALSE(s.IsValid());
1102 ASSERT_THROW(s.GetOrientationMarkers(top, bottom, left, right), Orthanc::OrthancException);
1103
1104 {
1105 // BRAINIX series: 3ca69615-fcd4a4fb-e5f2cc9d-9c7a49a5-add98bbf
1106 s = OrthancStone::CoordinateSystem3D(
1107 "0\\0\\0",
1108 "0.99971222877502\\7.8810308973E-12\\0.02398800104856\\-0.0017278126906\\0.99740260839462\\0.07200747728347");
1109 ASSERT_TRUE(s.IsValid());
1110 s.GetOrientationMarkers(top, bottom, left, right);
1111 ASSERT_EQ("AFL", top);
1112 ASSERT_EQ("PHR", bottom);
1113 ASSERT_EQ("RF", left);
1114 ASSERT_EQ("LH", right);
1115 }
1116
1117 {
1118 // BRAINIX series: dc0216d2-a406a5ad-31ef7a78-113ae9d9-29939f9e
1119 s = OrthancStone::CoordinateSystem3D(
1120 "0\\0\\0",
1121 "0.99971222877502\\7.8810308973E-12\\0.02398800104856\\0.02392569556832\\0.07202820479869\\-0.9971156120300");
1122 s.GetOrientationMarkers(top, bottom, left, right);
1123 ASSERT_EQ("HAR", top);
1124 ASSERT_EQ("FPL", bottom);
1125 ASSERT_EQ("RF", left);
1126 ASSERT_EQ("LH", right);
1127 }
1128
1129 {
1130 // ASSURANCETOURIX series: 1de00990-03680ef4-0be6bd5b-73a7d350-fb46abfa
1131 s = OrthancStone::CoordinateSystem3D(
1132 "0\\0\\0",
1133 "1\\0\\0\\0\\1\\0");
1134 s.GetOrientationMarkers(top, bottom, left, right);
1135 ASSERT_EQ("A", top);
1136 ASSERT_EQ("P", bottom);
1137 ASSERT_EQ("R", left);
1138 ASSERT_EQ("L", right);
1139 }
1140
1141 {
1142 // KNEE series: 4d04593b-953ced51-87e93f11-ae4cf03c-25defdcd
1143 s = OrthancStone::CoordinateSystem3D(
1144 "0\\0\\0",
1145 "-0\\1\\0\\-0\\-0\\-1");
1146 s.GetOrientationMarkers(top, bottom, left, right);
1147 ASSERT_EQ("H", top);
1148 ASSERT_EQ("F", bottom);
1149 ASSERT_EQ("A", left);
1150 ASSERT_EQ("P", right);
1151 }
1152
1153 {
1154 // KNEE series: 20b9d0c2-97d85e07-f4dbf4d2-f09e7e6a-0c19062e
1155 s = OrthancStone::CoordinateSystem3D(
1156 "0\\0\\0",
1157 "0.999993\\-0.0036927\\0\\-0\\-0\\-1");
1158 s.GetOrientationMarkers(top, bottom, left, right);
1159 ASSERT_EQ("H", top);
1160 ASSERT_EQ("F", bottom);
1161 ASSERT_EQ("RP", left);
1162 ASSERT_EQ("LA", right);
1163 }
1164
1165 {
1166 // KNEE series: f2635388-f01d497a-15f7c06b-ad7dba06-c4c599fe
1167 s = OrthancStone::CoordinateSystem3D(
1168 "0\\0\\0",
1169 "0.999841\\0.000366209\\0.0178227\\-0.000427244\\0.999995\\0.00326546");
1170 s.GetOrientationMarkers(top, bottom, left, right);
1171 ASSERT_EQ("AFL", top);
1172 ASSERT_EQ("PHR", bottom);
1173 ASSERT_EQ("RFA", left);
1174 ASSERT_EQ("LHP", right);
1175 }
1176 }