feat: add TransformPointM2W

This commit is contained in:
kradchen
2025-06-12 13:49:30 +08:00
parent af9a734bf3
commit cb7d4db7ef
2 changed files with 11 additions and 0 deletions

View File

@@ -494,6 +494,15 @@ void DICOMImageViewer::GetSlicePoint(double *point) {
point[2] = focusPoint[2]; point[2] = focusPoint[2];
} }
void DICOMImageViewer::TransformPointM2W(double *point)
{
double focusPoint[4] = {point[0], point[1], point[2], 1.0};
ModelToWorldMatrix->MultiplyPoint(focusPoint, focusPoint);
point[0] = focusPoint[0];
point[1] = focusPoint[1];
point[2] = focusPoint[2];
}
void DICOMImageViewer::applySliceOffset(double offset, double direction){ void DICOMImageViewer::applySliceOffset(double offset, double direction){
double projV = Renderer->GetActiveCamera()->GetDirectionOfProjection()[SliceIJK]; double projV = Renderer->GetActiveCamera()->GetDirectionOfProjection()[SliceIJK];
double defaultProjV = defaultProjection[SliceIJK][SliceIJK]; double defaultProjV = defaultProjection[SliceIJK][SliceIJK];

View File

@@ -373,6 +373,8 @@ public:
void GetSlicePoint(double *point); void GetSlicePoint(double *point);
void TransformPointM2W(double *point);
void applySliceOffset(double offset, double direction); void applySliceOffset(double offset, double direction);
virtual void UpdateReconPlane(); virtual void UpdateReconPlane();