/// <summary> /// Update the 2D visualization when the plane moved. /// </summary> /// <param name="plane">PlaneWidget which changed the coordinates.</param> public void PlaneMoved(vtkImagePlaneWidget plane) { vtkImageReslice reslice = vtkImageReslice.New(); vtkTransform transform = vtkTransform.New(); transform.PostMultiply(); //TODO wyznaczenie centrum okna double[] center = { 75, 100, 0 }; transform.Translate(-center[0], -center[1], -center[2]); transform.RotateZ(_orientation); transform.Translate(+center[0], +center[1], +center[2]); transform.Update(); reslice.SetInput(plane.GetResliceOutput()); reslice.SetResliceTransform(transform); reslice.Update(); // vtkImageData viewerInputData; viewerInputData = reslice.GetOutput(); _lastData = viewerInputData; _viewer.SetInput(viewerInputData); // //_viewer.SetInput(reslice.GetOutput()); UpdateViewer(); }
public void update2DVisualization(float windowLevel, float windowWidth) { this.windowLevel = windowLevel; this.windowWidth = windowWidth; widget = vtkImagePlaneWidget.New(); widget.SetInput(dicomReader.GetOutput()); widget.SetPlaneOrientationToYAxes(); widget.SetSliceIndex((int)slicePosition); widget.SetWindowLevel(this.windowWidth, this.windowLevel, 1); viewer.SetInput(widget.GetResliceOutput()); viewer.Render(); }
public void sliceX(float slicePosition) { this.slicePosition = slicePosition; widget = vtkImagePlaneWidget.New(); widget.SetInput(dicomReader.GetOutput()); widget.SetPlaneOrientationToXAxes(); widget.SetSliceIndex((int)slicePosition); widget.SetWindowLevel(this.windowWidth, this.windowLevel, 1); viewer.SetInput(widget.GetResliceOutput()); viewer.Render(); window.Update(); window.RenderWindow.Render(); }
public void sliceZ(float slicePosition) { this.slicePosition = slicePosition; widget = vtkImagePlaneWidget.New(); widget.SetInput(dicomReader.GetOutput()); widget.SetPlaneOrientationToZAxes(); widget.SetSliceIndex((int)slicePosition); widget.SetWindowLevel(this.windowWidth, this.windowLevel, 1); viewer.SetInput(widget.GetResliceOutput()); viewer.Render(); window.Update(); window.RenderWindow.Render(); }
public vtkImagePlaneWidget GetPlane(int i) { vtkImagePlaneWidget vtkImagePlaneWidget = null; uint mteStatus = 0u; uint mteIndex = 4294967295u; uint rawRefCount = 0u; IntPtr intPtr = vtkImageOrthoPlanes.vtkImageOrthoPlanes_GetPlane_01(base.GetCppThis(), i, ref mteStatus, ref mteIndex, ref rawRefCount); if (IntPtr.Zero != intPtr) { bool flag; vtkImagePlaneWidget = (vtkImagePlaneWidget)Methods.CreateWrappedObject(mteStatus, mteIndex, rawRefCount, intPtr, true, out flag); if (flag) { vtkImagePlaneWidget.Register(null); } } return(vtkImagePlaneWidget); }
//TODO /// <summary> /// Update the 2D visualization window with new slice of pass X, Y or Z coordination. /// </summary> /// <param name="dicomLoader"> Dicom input from we are going to cut the slice.</param> /// <param name="slicePosition">Coordinates of the slice. </param> /// <param name="axis">Name of axis to set cut orientation (X,Y,Z). </param> public void SliceToAxes(DicomLoader dicomLoader, float slicePosition, Axis axis) { vtkImagePlaneWidget planeWidget = vtkImagePlaneWidget.New(); planeWidget.SetInput(dicomLoader.GetOutput()); if (axis == Axis.X) { planeWidget.SetPlaneOrientationToXAxes(); } else if (axis == Axis.Y) { planeWidget.SetPlaneOrientationToYAxes(); } else if (axis == Axis.Z) { planeWidget.SetPlaneOrientationToZAxes(); } planeWidget.SetSliceIndex((int)slicePosition); _viewer.SetInput(planeWidget.GetResliceOutput()); planeWidget.Dispose(); UpdateViewer(); }
/// <summary> /// Update the 2D visualization when the plane moved. /// </summary> /// <param name="plane">PlaneWidget which changed the coordinates.</param> public void PlaneMoved(vtkImagePlaneWidget plane) { vtkImageReslice reslice = vtkImageReslice.New(); vtkTransform transform = vtkTransform.New(); transform.PostMultiply(); //TODO wyznaczenie centrum okna double[] center = {75, 100, 0}; transform.Translate( -center[0], -center[1], -center[2] ); transform.RotateZ(_orientation); transform.Translate( +center[0], +center[1], +center[2] ); transform.Update(); reslice.SetInput(plane.GetResliceOutput()); reslice.SetResliceTransform(transform); reslice.Update(); _viewer.SetInput(reslice.GetOutput()); UpdateViewer(); }
/// <summary> /// Update the 2D visualization when the plane moved. /// </summary> /// <param name="plane">PlaneWidget which changed the coordinates.</param> public void PlaneMoved(vtkImagePlaneWidget plane) { _viewer.SetInput(plane.GetResliceOutput()); UpdateViewer(); }
public void SetPlane(int i, vtkImagePlaneWidget imagePlaneWidget) { vtkImageOrthoPlanes.vtkImageOrthoPlanes_SetPlane_10(base.GetCppThis(), i, (imagePlaneWidget == null) ? default(HandleRef) : imagePlaneWidget.GetCppThis()); }
public void HandlePlaneEvent(vtkImagePlaneWidget imagePlaneWidget) { vtkImageOrthoPlanes.vtkImageOrthoPlanes_HandlePlaneEvent_03(base.GetCppThis(), (imagePlaneWidget == null) ? default(HandleRef) : imagePlaneWidget.GetCppThis()); }
/// <summary> /// Update the 2D visualization when the plane moved. /// </summary> /// <param name="plane">PlaneWidget which changed the coordinates.</param> public void PlaneMoved(vtkImagePlaneWidget plane) { _viewer.SetInput(plane.GetResliceOutput()); UpdateViewer(); }
public void update2DVisualization(float windowLevel, float windowWidth) { this.windowLevel = windowLevel; this.windowWidth = windowWidth; widget = vtkImagePlaneWidget.New(); widget.SetInput(dicomReader.GetOutput()); widget.SetPlaneOrientationToYAxes(); widget.SetSliceIndex((int)slicePosition); widget.SetWindowLevel(this.windowWidth, this.windowLevel, 1); viewer.SetInput(widget.GetResliceOutput()); viewer.Render(); }