コード例 #1
0
        // This method is used by the VolumeSlice to generate pixel data on demand
        internal byte[] CreateSliceNormalizedPixelData(Vector3D throughPoint)
        {
            Matrix resliceAxes = new Matrix(_slicerParams.SlicingPlaneRotation);

            resliceAxes[3, 0] = throughPoint.X;
            resliceAxes[3, 1] = throughPoint.Y;
            resliceAxes[3, 2] = throughPoint.Z;

#if SLAB
            using (vtkImageData imageData = GenerateVtkSlab(resliceAxes, 10))              // baked 10 voxels for testing
            {
                byte[] pixelData = MipPixelDataFromVtkSlab(imageData);
                imageData.ReleaseData();

                return(pixelData);
            }
#else
            using (vtkImageData imageData = GenerateVtkSlice(resliceAxes))
            {
                byte[] pixelData = CreatePixelDataFromVtkSlice(imageData);
                imageData.ReleaseData();

                return(pixelData);
            }
#endif
        }