Esempio n. 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) );
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 3
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);
        }
Esempio n. 4
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);
 }