private void RotateImage(RotationOperation operation) { vtkImageReslice reslice = vtkImageReslice.New(); vtkTransform transform = vtkTransform.New(); transform.PostMultiply(); double[] center = { 75, 100, 0 }; transform.Translate(-center[0], -center[1], -center[2]); if (operation == RotationOperation.Forward) { transform.RotateZ(90); } else if (operation == RotationOperation.Back) { transform.RotateZ(-90); } transform.Translate(+center[0], +center[1], +center[2]); transform.Update(); reslice.SetInput(_viewer.GetInput()); reslice.SetResliceTransform(transform); reslice.Update(); _viewer.SetInput(reslice.GetOutput()); UpdateViewer(); }