Example #1
0
 public void SetWindowWidthCentre(int minVal, int maxVal, int widthVal, int centreVal, Imagebpp bpp, bool sign)
 {
     winMin = minVal;
     winMax = maxVal;
     winWidth = widthVal;
     winCentre = centreVal;
     iBpp = bpp;
     signedImage = sign;
     Invalidate();
 }
Example #2
0
 public void SetWindowWidthCentre(int minVal, int maxVal, int widthVal, int centreVal, Imagebpp bpp, bool sign)
 {
     winMin      = minVal;
     winMax      = maxVal;
     winWidth    = widthVal;
     winCentre   = centreVal;
     iBpp        = bpp;
     signedImage = sign;
     Invalidate();
 }
Example #3
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();
        }
Example #4
0
        public void SetParametersHistogram(int minVal, int maxVal, int widthVal, int centreVal, Imagebpp bpp, bool sign, long[] histogram)
        {
            winMin    = minVal;
            winMax    = maxVal;
            winWidth  = widthVal;
            winCentre = centreVal;
            first     = false;

            iBpp            = bpp;
            signedImage     = sign;
            histogram_255   = histogram;
            paint_histogram = true;
            Invalidate();
        }
Example #5
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();
        }
Example #6
0
        public void UpdateWindowLevel(int winWidth_from_Canvas, int winCentre_from_Canvas, Imagebpp bpp, long[] histogram)
        {
            int winMin = Convert.ToInt32(winCentre_from_Canvas - 0.5 * winWidth_from_Canvas);
            int winMax = winMin + winWidth_from_Canvas;

            winWidth  = winWidth_from_Canvas;
            winCentre = winCentre_from_Canvas;

            int w = (int)winWidth;
            int с = (int)winCentre;

            this.Windowing.SetWindowWidthCentre(winMin, winMax, w, с, bpp, signedImage);
            this.ColoredTFobj.SetParametersHistogram(winMin, winMax, w, с, bpp, signedImage, histogram);
        }
Example #7
0
        public void UpdateWindowLevel(int winWidth_from_Canvas, int winCentre_from_Canvas, Imagebpp bpp, long[] histogram)
        {
            int winMin = Convert.ToInt32(winCentre_from_Canvas - 0.5 * winWidth_from_Canvas);
            int winMax = winMin + winWidth_from_Canvas;
            winWidth = winWidth_from_Canvas;
            winCentre = winCentre_from_Canvas;

            int w = (int)winWidth;
            int с = (int)winCentre;

            this.Windowing.SetWindowWidthCentre(winMin, winMax, w, с, bpp, signedImage);
            this.ColoredTFobj.SetParametersHistogram(winMin, winMax, w, с, bpp, signedImage, histogram);
        }
Example #8
0
        public void SetParametersHistogram(int minVal, int maxVal, int widthVal, int centreVal, Imagebpp bpp, bool sign, long[] histogram)
        {
            winMin = minVal;
            winMax = maxVal;
            winWidth = widthVal;
            winCentre = centreVal;
            first = false;

            iBpp = bpp;
            signedImage = sign;
            histogram_255 = histogram;
            paint_histogram = true;
            Invalidate();
        }
Example #9
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();
        }
Example #10
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();
        }