Commit b0bd0465 authored by Ben Boeckel's avatar Ben Boeckel

vtkImagePlaneWidget: avoid divide-by-zero

Change-Id: I136a04d90cd32c36960a8c1c4f25efb7d25b66b2
parent e736ad42
......@@ -1716,8 +1716,8 @@ void vtkImagePlaneWidget::UpdatePlane()
}
}
double outputSpacingX = (planeSizeX == 0) ? 1.0 : planeSizeX/extentX;
double outputSpacingY = (planeSizeY == 0) ? 1.0 : planeSizeY/extentY;
double outputSpacingX = (extentX == 0) ? 1.0 : planeSizeX/extentX;
double outputSpacingY = (extentY == 0) ? 1.0 : planeSizeY/extentY;
this->Reslice->SetOutputSpacing(outputSpacingX, outputSpacingY, 1);
this->Reslice->SetOutputOrigin(0.5*outputSpacingX, 0.5*outputSpacingY, 0);
this->Reslice->SetOutputExtent(0, extentX-1, 0, extentY-1, 0, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment