示例#1
0
        private void Open_DICONDE_Button_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "DICONDE Image files (*.dcm)|*.dcm|All files (*.*)|*.*";
            if (openFileDialog.ShowDialog() == true)
            {
                µReadDICONDEFile(µsrc, openFileDialog.FileName);
                DICONDEFile    = openFileDialog.FileName;
                Info.IsEnabled = true;
                µCopy(µsrc, µdst);
                if (µdst.imageType == ImageType.U8)
                {
                    SliderMin.Maximum = SliderMax.Maximum = SliderMax.Value = 255;
                }
                if (µdst.imageType == ImageType.U16)
                {
                    SliderMin.Minimum = SliderMax.Minimum = SliderMin.Value = µGetMin(µdst);
                    SliderMin.Maximum = SliderMax.Maximum = SliderMax.Value = µGetMax(µdst);
                }
                MyµImage.SetDisplayMappingData((int)µGetMin(µdst), (int)µGetMax(µdst), µ.Display.DisplayMappingOption.Default);
                MyµImage.DisplayImage(µdst);
                MyµImage.PerformZoomToFit();
                MyµImage.DisplayImage(µdst);
                DisplayHistogram(µdst);
                //MyµImage.Dispatcher.Invoke( () => MyµImage.DisplayImage(µdst) );
            }
        }
示例#2
0
        private void Open_Button_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Image files (*.png;*.jpg;*.tif;)|*.png;*.jpg;*.tif;|All files (*.*)|*.*";
            //JPEG2000 is not supported by opencv, should use something else - freeimage or image magic...
            //openFileDialog.Filter = "Image files (*.png;*.jpg;*.tif;*.jp2)|*.png;*.jpg;*.tif;*.jp2|All files (*.*)|*.*";
            if (openFileDialog.ShowDialog() == true)
            {
                Info.IsEnabled = false;
                µReadFile(µsrc, openFileDialog.FileName);
                µCopy(µsrc, µdst);
                if (µdst.imageType == ImageType.U8)
                {
                    SliderMin.Maximum = SliderMax.Maximum = SliderMax.Value = 255;
                }
                if (µdst.imageType == ImageType.U16)
                {
                    SliderMin.Minimum = SliderMax.Minimum = SliderMin.Value = µGetMin(µdst);
                    SliderMin.Maximum = SliderMax.Maximum = SliderMax.Value = µGetMax(µdst);
                }
                MyµImage.SetDisplayMappingData((int)µGetMin(µdst), (int)µGetMax(µdst), µ.Display.DisplayMappingOption.Default);
                MyµImage.DisplayImage(µdst);
                MyµImage.PerformZoomToFit();
                DisplayHistogram(µdst);
            }
        }
示例#3
0
 private void MainWindow_Loaded(object sender, RoutedEventArgs e)
 {
     µsrc = new µImage();
     µdst = new µImage();
     µReadFile(µsrc, "Zippo.jpg");
     µCopy(µsrc, µdst);
     MyµImage.DisplayImage(µsrc);
     DisplayHistogram(µsrc);
     Info.IsEnabled = false;
 }
示例#4
0
        internal void SetWindow(µImage image, Point start, Point end)
        {
            double min, max;

            µMinMax(image, start, end, out min, out max);
            µOutputDebugString("min = " + (int)min + "; max = " + (int)max);
            MyµImage.SetDisplayMappingData(min, max, µ.Display.DisplayMappingOption.GivenRange);
            MyµImage.Dispatcher.Invoke(() => MyµImage.DisplayImage(µdst));
            MyµImage.Dispatcher.Invoke(() => SliderMin.Value      = min);
            MyµImage.Dispatcher.Invoke(() => SliderMax.Value      = max);
            MyµImage.Dispatcher.Invoke(() => linegraph.Visibility = Visibility.Hidden);
            System.Threading.Thread.Sleep(1);
        }
示例#5
0
        private void PaletteComboBox_Selected(object sender, RoutedEventArgs e)
        {
            if (null == µdst)
            {
                return;                           //not loaded yet
            }
            switch (PalettesList.SelectedIndex)
            {
            case 0: MyµImage.DisplayImage(µdst, PaletteType.Gray); break;

            case 1: MyµImage.DisplayImage(µdst, PaletteType.Binary); break;

            case 2: MyµImage.DisplayImage(µdst, PaletteType.Gradient); break;

            case 3: MyµImage.DisplayImage(µdst, PaletteType.Rainbow); break;

            case 4: MyµImage.DisplayImage(µdst, PaletteType.Temperature); break;

            case 5: MyµImage.DisplayImage(µdst, PaletteType.InvertedGray); break;

            case 6: MyµImage.DisplayImage(µdst, PaletteType.Gamma_1_1); break;

            case 7: MyµImage.DisplayImage(µdst, PaletteType.Gamma_1_3); break;

            case 8: MyµImage.DisplayImage(µdst, PaletteType.Gamma_1_5); break;

            case 9: MyµImage.DisplayImage(µdst, PaletteType.Gamma_1_7); break;

            case 10: MyµImage.DisplayImage(µdst, PaletteType.Gamma_1_9); break;

            case 11: MyµImage.DisplayImage(µdst, PaletteType.Gamma_2_1); break;

            case 12: MyµImage.DisplayImage(µdst, PaletteType.Gamma_2_3); break;

            case 13: MyµImage.DisplayImage(µdst, PaletteType.Gamma_2_5); break;
            }
        }
示例#6
0
 internal void ApplyMinMax(double min, double max)
 {
     MyµImage.SetDisplayMappingData(min, max, µ.Display.DisplayMappingOption.GivenRange);
     MyµImage.Dispatcher.Invoke(() => MyµImage.DisplayImage(µdst));
     System.Threading.Thread.Sleep(1);
 }
示例#7
0
 private void Threshold_Button_Click(object sender, RoutedEventArgs e)
 {
     Threshold_Demo(µsrc, µdst);
     MyµImage.DisplayImage(µdst);
     DisplayHistogram(µdst);
 }
示例#8
0
 private void Original_Button_Click(object sender, RoutedEventArgs e)
 {
     µCopy(µsrc, µdst);
     MyµImage.DisplayImage(µdst);
     DisplayHistogram(µdst);
 }