private void Sobel_Click(object sender, RoutedEventArgs e)
 {
     if (mainControl.OriginalGrayscaleImage != null)
     {
         Tdialog = new Windows.TDialog(this, true);
         Tdialog.Show();
     }
 }
        private void Bin_3D_Click(object sender, RoutedEventArgs e)
        {

            if (mainControl.OriginalColorImage != null)
            {
                if (T_SHOW)
                {
                    T_SHOW = false;
                    Tdialog.Close();
                }
                else
                {
                    Tdialog = new Windows.TDialog(this);
                    Tdialog.Show();
                    T_SHOW = true;
                }
                // mainControl.ProcessedGrayscaleImage=Tools.Mirror(mainControl.OriginalGrayscaleImage);
            }
        }