22 : m_ShiftUp(0.0), m_ShiftRight(0.0), m_ShiftNormal(0.0), m_ITKAssumedSliceSpacing(0.0), m_NumberOfSlicesApart(1)
26 #define doublepoint(x) \
32 #define doublevector(x) \
42 unsigned int numberOfSlicesApart)
43 : m_ShiftUp(0.0), m_ShiftRight(0.0), m_ShiftNormal(0.0), m_NumberOfSlicesApart(numberOfSlicesApart)
45 assert(numberOfSlicesApart);
71 Vector3Dd normal = itk::CrossProduct(right, up);
72 Point3Dd pointAlongNormal = origin2 + normal;
74 double numerator = itk::CrossProduct(pointAlongNormal - origin2, origin2 - origin1).GetSquaredNorm();
75 double denominator = (pointAlongNormal - origin2).GetSquaredNorm();
77 double distance = sqrt(numerator / denominator);
81 MITK_DEBUG <<
" Series seems to contain a tilted (or sheared) geometry";
82 MITK_DEBUG <<
" Distance of expected slice origin from actual slice origin: " << distance;
83 MITK_DEBUG <<
" ==> storing this shift for later analysis:";
104 double signedDistance =
105 (planeNormal[0] * testPoint[0] + planeNormal[1] * testPoint[1] + planeNormal[2] * testPoint[2] -
106 (planeNormal[0] * origin2[0] + planeNormal[1] * origin2[1] + planeNormal[2] * origin2[2])) /
107 sqrt(planeNormal[0] * planeNormal[0] + planeNormal[1] * planeNormal[1] + planeNormal[2] * planeNormal[2]);
120 MITK_DEBUG <<
" tilt angle (deg): " << atan(m_ShiftUp / m_ShiftNormal) * 180.0 / 3.1415926535;
134 Vector3Dd lineOriginToP = p - lineOrigin;
135 double innerProduct = lineOriginToP * lineDirection;
137 double factor = innerProduct / lineDirection.GetSquaredNorm();
138 Point3Dd projection = lineOrigin + factor * lineDirection;
146 return atan(fabs(m_ShiftUp) / m_ShiftNormal) * 180.0 / 3.1415926535;
152 return m_ShiftUp /
static_cast<double>(m_NumberOfSlicesApart);
157 return m_ShiftNormal /
static_cast<double>(m_NumberOfSlicesApart);
162 return (fabs(m_ShiftRight) > 0.001 || fabs(m_ShiftUp) > 0.001);
167 return (fabs(m_ShiftRight) < 0.001 && fabs(m_ShiftUp) > 0.001);
DataCollection - Class to facilitate loading/accessing structured data.