コード例 #1
0
        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));
        }
コード例 #2
0
 /// <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)
 {
 }
コード例 #3
0
 public IVolumeSlicerCore CreateSlicerCore(IVolumeReference volumeReference, VolumeSliceArgs args)
 {
     return(new VtkVolumeSlicerCore(volumeReference, args));
 }
コード例 #4
0
 public bool IsSupported(VolumeSliceArgs args)
 {
     return(true);
 }