Ejemplo n.º 1
0
        public void LoadDICOMTestDataSet(List <ushort> buffer, ushort num_of_images, double winCentre, double winWidth, double intercept, bool signed)
        {
            ushort i = 0;
            short  k;

            winCentre_vox = (int)(winCentre);
            winWidth_vox  = (int)(winWidth);

            int winMax = Convert.ToInt32(winCentre_vox + 0.5 * winWidth);
            int winMin = winMax - (int)(winWidth);

            winMax   -= 32768;
            winMin   -= 32768;
            vol       = new VoxelVolume(517, manager);
            boxMinCon = new Float4(0, 0, 0, 0);
            boxMaxCon = new Float4(512, 512, 512, 0);

            /* для ускорения работы с буфером вокселей, ось x самая внутренняя. VolumetricMethodsInVisualEffects2010 */
            for (var f = 1; f <= num_of_images; f++)
            {
                for (var y = 0; y < 512; y++)
                {
                    for (var x = 0; x < 512; x++)
                    {
                        i = buffer[(f - 1) * 512 * 512 + (x * 512 + y)];
                        k = (short)(i - 32768);
                        if (k > winMin && k < winMax)  // учесть преобразование wincentre
                        {
                            var xx = (int)((x / 512.0) * (513.0 - 5));
                            var yy = 512 - (int)((y / 512.0) * (513.0 - 5));
                            var zz = (int)((f / 167.0) * (166.0));
                            vol.SetValue(xx, (330 - zz * 2), yy, k);
                            vol.SetValue(xx, (330 - zz * 2 + 1), yy, k);
                            vol.SetValue(xx, (330 - zz * 2 + 2), yy, k);
                        }
                    }
                }
            }
            camfactorX = 2;
            //camfactorY = 2;
            camfactorZ = 2;
        }
Ejemplo n.º 2
0
        public void LoadHeadDICOMTestDataSet(List<ushort> buffer, ushort num_of_images, double winCentre, double winWidth, double intercept, bool signed)
        {
            ushort i = 0;
            short k;

            winCentre_vox = (int)(winCentre);
            winWidth_vox = (int)(winWidth);

            int winMax = Convert.ToInt32(winCentre_vox + 0.5 * winWidth);
            int winMin = winMax - (int)(winWidth);
            winMax -= 32768;
            winMin -= 32768;
            vol = new VoxelVolume(517, manager);
            boxMinCon = new Float4(0, 0, 0, 0);
            boxMaxCon = new Float4(512, 512, 512, 0);

            /* для ускорения работы с буфером вокселей, ось x самая внутренняя. VolumetricMethodsInVisualEffects2010 */
            for (var f = 1; f <= num_of_images; f++)
            {
                for (var y = 0; y < 512; y++)
                {
                    for (var x = 0; x < 512; x++)
                    {
                        i = buffer[(f - 1) * 512 * 512 + (x * 512 + y)];
                        k = (short)(i - 32768);
                        if (k > winMin && k < winMax)  // учесть преобразование wincentre
                        {
                            var xx = (int)((x / 512.0) * (513.0 - 5));
                            var yy = 512 - (int)((y / 512.0) * (513.0 - 5));
                            var zz = (int)((f / 348.0) * (349.0));
                            vol.SetValue(xx, (330 - zz * 2), yy, k);
                            vol.SetValue(xx, (330 - zz * 2 + 1), yy, k);
                            vol.SetValue(xx, (330 - zz * 2 + 2), yy, k);
                        }
                    }

                }
            }
             camfactorX = 2;
            //camfactorY = 2;
            camfactorZ = 2;
        }
Ejemplo n.º 3
0
 public void LoadHeadDICOMTestDataSet(List<ushort> buffer, ushort num_of_images, double winCentre, double winWidth, double intercept, bool signed)
 {
     ushort i = 0;
     short k;
     winCentre_vox = (int)(winCentre);
     winWidth_vox = (int)(winWidth);
     int winMax = Convert.ToInt32(winCentre_vox + 0.5 * winWidth);
     int winMin = winMax - (int)(winWidth);
     winMax -= 32768;
     winMin -= 32768;
     vol = new VoxelVolume(517, manager);
     boxMinCon = new Float4(0, 0, 0, 0);
     boxMaxCon = new Float4(512, 512, 512, 0);
     /* to speed up the buffer voxels x axis innermost. VolumetricMethodsInVisualEffects2010 */
     for (var f = 1; f <= num_of_images; f++){
         for (var y = 0; y < 512; y++){
             for (var x = 0; x < 512; x++){
                 i = buffer[(f - 1) * 512 * 512 + (x * 512 + y)];
                 k = (short)(i - 32768);
                 if (k > winMin && k < winMax)  // consider converting win centre
                 {
                     var xx = (int)((x / 512.0) * (513.0 - 5));
                     var yy = 512 - (int)((y / 512.0) * (513.0 - 5));
                     var zz = (int)((f / 348.0) * (349.0));
                     vol.SetValue(xx, (330 - zz * 2), yy, k);
                     vol.SetValue(xx, (330 - zz * 2 + 1), yy, k);
                     vol.SetValue(xx, (330 - zz * 2 + 2), yy, k);
                 }
             }
         }
         GC.Collect();
     }
     GC.Collect();
     camfactorX = 2;
     camfactorY = 2;
     camfactorZ = 2;
 }