Change MPR Orientation string logic.

This commit is contained in:
Krad
2022-12-30 10:44:08 +08:00
parent fba3dfce7b
commit 121571b13b

View File

@@ -16,9 +16,10 @@
#include <vtkMatrix4x4.h> #include <vtkMatrix4x4.h>
#include <vtkProperty2D.h> #include <vtkProperty2D.h>
#include <vtkTextProperty.h> #include <vtkTextProperty.h>
#include <vtkCornerAnnotation.h>
#include "Rendering/Legend/ResliceCursorLegendActor.h" #include "Rendering/Legend/ResliceCursorLegendActor.h"
#include "Rendering/Legend/FastOrientationLegendActor.h"
#include "Rendering/Legend/ResliceSquareLegendActor.h" #include "Rendering/Legend/ResliceSquareLegendActor.h"
#include "Interaction/ResliceImageInteractorStyle.h" #include "Interaction/ResliceImageInteractorStyle.h"
@@ -26,13 +27,13 @@ namespace {
void GetDirectionString(const double *directionVector, std::string &str) { void GetDirectionString(const double *directionVector, std::string &str) {
str.clear(); str.clear();
char dV [3] = {' ', ' ', ' '}; char dV [3] = {' ', ' ', ' '};
if (fabs(directionVector[0]) > 0.6){ if (fabs(directionVector[0]) > 0.3){
dV[0] = directionVector[0] > 0 ? 'L' : 'R'; dV[0] = directionVector[0] > 0 ? 'L' : 'R';
} }
if (fabs(directionVector[1]) > 0.6){ if (fabs(directionVector[1]) > 0.3){
dV[1] = directionVector[1]> 0 ? 'P' : 'A'; dV[1] = directionVector[1]> 0 ? 'P' : 'A';
} }
if (fabs(directionVector[2]) > 0.6){ if (fabs(directionVector[2]) > 0.3){
dV[2] = directionVector[2] > 0 ? 'H' : 'F'; dV[2] = directionVector[2] > 0 ? 'H' : 'F';
} }
if (fabs(directionVector[2]) > fabs(directionVector[1])) std::swap(dV[1], dV[2]); if (fabs(directionVector[2]) > fabs(directionVector[1])) std::swap(dV[1], dV[2]);