private static VolumeSlice CreateSlice(IVolumeReference volumeReference, IVolumeSlicerParams slicerParams, float thicknessAndSpacing, Vector3D throughPoint) { // compute Rows and Columns to reflect actual output size var frameSize = GetSliceExtent(volumeReference, slicerParams); // compute Pixel Spacing var effectiveSpacing = GetEffectiveSpacing(volumeReference); // compute Image Orientation (Patient) var matrix = new Matrix(slicerParams.SlicingPlaneRotation); matrix[3, 0] = throughPoint.X; matrix[3, 1] = throughPoint.Y; matrix[3, 2] = throughPoint.Z; var resliceAxesPatientOrientation = volumeReference.RotateToPatientOrientation(matrix); // compute Image Position (Patient) var topLeftOfSlicePatient = GetTopLeftOfSlicePatient(frameSize, throughPoint, volumeReference, slicerParams); var args = new VolumeSliceArgs(frameSize.Height, frameSize.Width, effectiveSpacing, effectiveSpacing, new Vector3D(resliceAxesPatientOrientation[0, 0], resliceAxesPatientOrientation[0, 1], resliceAxesPatientOrientation[0, 2]), new Vector3D(resliceAxesPatientOrientation[1, 0], resliceAxesPatientOrientation[1, 1], resliceAxesPatientOrientation[1, 2]), thicknessAndSpacing, Convert(slicerParams.InterpolationMode)); return(new VolumeSlice(volumeReference, true, args, topLeftOfSlicePatient, thicknessAndSpacing)); }
/// <summary> /// Initializes a new instance of <see cref="VtkVolumeSlicerCore"/>. /// </summary> /// <param name="volumeReference"></param> /// <param name="args"></param> public VtkVolumeSlicerCore(IVolumeReference volumeReference, VolumeSliceArgs args) : base(volumeReference, args) { }
public IVolumeSlicerCore CreateSlicerCore(IVolumeReference volumeReference, VolumeSliceArgs args) { return(new VtkVolumeSlicerCore(volumeReference, args)); }
public bool IsSupported(VolumeSliceArgs args) { return(true); }