我想从一条具有vtkimagereslice的点沿着一条曲线的体积中获取切片,并根据这2个点的方向获取一个以每个点和方向为中心的切片。问题是当我将z定义为x和y之间平面的法线时。获得的切片没有意义,但如果我不定义z,则效果很好。有人知道如何将z定义为相同但具有厚度。我想在输出坐标(原始为y)的深度z中定义z。
预先感谢
center_slice[0] = pts1[0] + (pts2[0] - pts1[0]) / 2;
center_slice[1] = pts1[1] + (pts2[1] - pts1[1]) / 2;
center_slice[2] = pts1[2] + (pts2[2] - pts1[2]) / 2;
reslice->SetOutputExtent(ext);
reslice->SetOutputOrigin(center_slice[0], center_slice[1],
center_slice[2]);
reslice->UpdateInformation();
//We want plane tangent to the curve
double perpendicular[3] = { (pts2[0] - pts1[0]),(pts2[1] -
pts1[1]),(pts2[2] - pts1[2]) };
perpendicular[2] = 0;
double *normalizedX = perpendicular;
vtkMath::Normalize(normalizedX);
//Height
double perpendicular2[3] = { 0,0,-1 };
double *normalizedY = perpendicular2;
perpendicular2[1] = 0;
vtkMath::Normalize(normalizedY);
//THE PROBLEM if i add the rotation
//for the tangent between points:
// -(pts2[1] - pts1[1]),(pts2[0] - pts1[0]),0 };
//Or the crossproduct of vector x and y i get something it does not
//make sense. Like this it works but i do not get thickness
double normalizedZ[3];
normalizedZ[0] = 0;
normalizedZ[1] = 0;
normalizedZ[2] = 0;
}