comparison Framework/Toolbox/DicomStructureSet.cpp @ 1170:1644de437a7b broker

fixes related to swapped normal in sagittal geometry
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 20 Nov 2019 13:09:15 +0100
parents 709aa65aca17
children 3c7cdbf32e2a
comparison
equal deleted inserted replaced
1167:ad4e21df4e40 1170:1644de437a7b
371 } 371 }
372 } 372 }
373 else if (GeometryToolbox::IsParallelOrOpposite 373 else if (GeometryToolbox::IsParallelOrOpposite
374 (isOpposite, slice.GetNormal(), geometry_.GetAxisX())) 374 (isOpposite, slice.GetNormal(), geometry_.GetAxisX()))
375 { 375 {
376 // plane is constant X 376 // plane is constant X => Sagittal view (remember that in the
377 377 // sagittal projection, the normal must be swapped)
378
379
378 /* 380 /*
379 Please read the comments in the section above, by taking into account 381 Please read the comments in the section above, by taking into account
380 the fact that, in this case, the plane has a constant X, not Y (in 382 the fact that, in this case, the plane has a constant X, not Y (in
381 polygon geometry_ coordinates) 383 polygon geometry_ coordinates)
382 */ 384 */
424 Vector p2 = (geometry_.MapSliceToWorldCoordinates(x, ymax) - 426 Vector p2 = (geometry_.MapSliceToWorldCoordinates(x, ymax) -
425 sliceThickness_ / 2.0 * geometry_.GetNormal()); 427 sliceThickness_ / 2.0 * geometry_.GetNormal());
426 428
427 slice.ProjectPoint2(x1, y1, p1); 429 slice.ProjectPoint2(x1, y1, p1);
428 slice.ProjectPoint2(x2, y2, p2); 430 slice.ProjectPoint2(x2, y2, p2);
429
430 // TODO WHY THIS???
431 y1 = -y1;
432 y2 = -y2;
433 431
434 return true; 432 return true;
435 } 433 }
436 } 434 }
437 else 435 else