comparison OrthancStone/Sources/Volumes/DicomVolumeImageReslicer.cpp @ 1786:748bfa7df18b

removing test code in DicomVolumeImageReslicer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 15 May 2021 11:41:58 +0200
parents fca942f4b4a7
children 3889ae96d2e9
comparison
equal deleted inserted replaced
1785:58bebc904191 1786:748bfa7df18b
76 return NULL; 76 return NULL;
77 } 77 }
78 78
79 const double s = reslicer.GetPixelSpacing(); 79 const double s = reslicer.GetPixelSpacing();
80 80
81 #if 1
82 const double x1 = reslicer.GetOutputExtent().GetX1(); 81 const double x1 = reslicer.GetOutputExtent().GetX1();
83 //const double x2 = reslicer.GetOutputExtent().GetX2();
84 const double y1 = reslicer.GetOutputExtent().GetY1(); 82 const double y1 = reslicer.GetOutputExtent().GetY1();
85 const double y2 = reslicer.GetOutputExtent().GetY2();
86
87 const Vector p1 = cuttingPlane.MapSliceToWorldCoordinates(x1, y1); 83 const Vector p1 = cuttingPlane.MapSliceToWorldCoordinates(x1, y1);
88 const Vector p2 = cuttingPlane.MapSliceToWorldCoordinates(x1, y2);
89 84
90 // The "0.5" shift is to move from the corner of voxel to the center of the voxel 85 // The "0.5" shift is to move from the corner of voxel to the center of the voxel
91 86
92 if (1) 87 texture->SetCuttingPlaneTransform(
93 { 88 cuttingPlane, p1 + 0.5 * s * cuttingPlane.GetAxisX() + 0.5 * s * cuttingPlane.GetAxisY(),
94 texture->SetCuttingPlaneTransform( 89 s * cuttingPlane.GetAxisX(),
95 cuttingPlane, p1 + 0.5 * s * cuttingPlane.GetAxisX() + 0.5 * s * cuttingPlane.GetAxisY(), 90 s * cuttingPlane.GetAxisY());
96 s * cuttingPlane.GetAxisX(),
97 s * cuttingPlane.GetAxisY());
98 }
99 else
100 {
101 /**
102 * TODO - ONE WAS TO SOMETIMES FLIP the Y axis. Is it also
103 * possible for the X axis?
104 **/
105
106 texture->SetCuttingPlaneTransform(
107 cuttingPlane, p2 + 0.5 * s * cuttingPlane.GetAxisX() + 0.5 * s * cuttingPlane.GetAxisY(),
108 s * cuttingPlane.GetAxisX(),
109 -s * cuttingPlane.GetAxisY());
110 }
111 91
112 #else
113 texture->SetPixelSpacing(s, s);
114 texture->SetOrigin(reslicer.GetOutputExtent().GetX1() + 0.5 * s,
115 reslicer.GetOutputExtent().GetY1() + 0.5 * s);
116 //texture->SetFlipY(true);
117
118 // TODO - Angle!!
119 #endif
120
121 return texture.release(); 92 return texture.release();
122 } 93 }
123 else 94 else
124 { 95 {
125 return NULL; 96 return NULL;