Exemplo n.º 1
0
        public void VoxelImage_Load(List<ushort> buffer, ushort num_of_images, double winCentre, double winWidth, double intercept, bool signed, Main form)
        {
            try
            {
                InitializeOpenCL();
                LoadDICOMTestDataSet(buffer, num_of_images, winCentre, winWidth, intercept, signed);
                initialize = true;
                form_this = form;

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, " Ошибка инициализации OpenCl  или проблема с загрузкой DICOM файлов!");
            }
        }
Exemplo n.º 2
0
 public void PassAlong(Main form)
 {
     form_this = form;
 }
Exemplo n.º 3
0
        /*для глубины  bpp=8*/
        public void SetParameters(ref List<byte> arr, int wid, int hei, double windowWidth,
            double windowCentre, int samplesPerPixel, bool resetScroll, Main mainFrm, long[] hi, Color inkColor)
        {
            if (samplesPerPixel == 1)
            {
                bpp = Imagebpp.Eightbpp;
                imgWidth = wid;
                imgHeight = hei;
                histogram = new long[256];
                histogram = hi;
                winWidth = Convert.ToInt32(windowWidth);
                winCentre = Convert.ToInt32(windowCentre);
                changeValWidth = 0.1;
                changeValCentre = 0.1;
                sizeImg = imgWidth * imgHeight;
                sizeImg3 = sizeImg * 3;
                pix8 = arr;
                imagePixels8 = new byte[sizeImg3];
                mf = mainFrm;
                imageAvailable = true;
                if (bmp != null)
                    bmp.Dispose();
                ResetValues();
                fillColor = inkColor;
                ComputeLookUpTable8();
                bmp = new Bitmap(imgWidth, imgHeight, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
                CreateImage8();
            }

            if (resetScroll == true) ComputeScrollBarParameters();
            Invalidate();
        }
Exemplo n.º 4
0
        public void SetParameters(ref List<ushort> arr,double intercept, int wid, int hei, double windowWidth,   // arr ushort
            double windowCentre, bool resetScroll, Main mainFrm, ref long[] hi, Color inkColor)
        {
            bpp = Imagebpp.Sixteenbpp;
            imgWidth = wid;
            imgHeight = hei;
            histogram = hi;
            EraseHistogramArray();
            winWidth = Convert.ToInt32(windowWidth);
            winCentre = Convert.ToInt32(windowCentre);
            sizeImg = imgWidth * imgHeight;
            sizeImg3 = sizeImg * 3;
            double sizeImg3By4 = sizeImg3 / 4.0;
            if (signed16Image == true)
                winCentre -= short.MinValue;

            if (winWidth < 5000)
            {
                changeValWidth = 2;
                changeValCentre = 2;
            }
            else if (Width > 40000)
            {
                changeValWidth = 50;
                changeValCentre = 50;
            }
            else
            {
                changeValWidth = 25;
                changeValCentre = 25;
            }
            pix16 = arr;
            imagePixels16 = new byte[sizeImg3];
            mf = mainFrm;

            imageAvailable = true;
            if (bmp != null)
                bmp.Dispose();
            ResetValues();
            fillColor = inkColor;
            ComputeLookUpTable16();
            bmp = new Bitmap(imgWidth, imgHeight, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
            CreateImage16();
            if (resetScroll == true) ComputeScrollBarParameters();
            Invalidate();
        }
Exemplo n.º 5
0
        public void VoxelImage_Load(List<ushort> buffer, ushort num_of_images, double winCentre, double winWidth, double intercept, bool signed, Main form)
        {
            try{
                InitializeOpenCL();
                LoadDICOMTestDataSet(buffer, num_of_images, winCentre, winWidth, intercept, signed);
                initialize = true;
                form_this = form;

            }
            catch (Exception ex){
                MessageBox.Show(ex.Message, " OpenCl initialization error or a problem with loading DICOM files!");
            }
        }