private void SaveSegmentationAs(object sender, RoutedEventArgs e)
        {
            if (!Engine.Segmenter.DatasetLoaded)
            {
                Console.WriteLine("No dataset loaded.");
                return;
            }

            var dialog = new LoadSaveSegmentationDialog("Save Segmentation As", Settings.Default, "ColorImagesSaveAs", Settings.Default, "IdImagesSaveAs");
            var result = dialog.ShowDialog();

            if (result == true)
            {
                var segmenterImageStackSaveDescription = new SegmenterImageStackSaveDescription
                {
                    Directories = new Dictionary <string>
                    {
                        { "ColorMap", dialog.ColorImages.Text },
                        { "IdMap", dialog.IdImages.Text }
                    },
                };

                Engine.Segmenter.SaveSegmentationAs(segmenterImageStackSaveDescription);
            }
        }
        private void LoadSegmentation(object sender, RoutedEventArgs e)
        {
            if (!Engine.Segmenter.DatasetLoaded)
            {
                Console.WriteLine("No dataset loaded.");
                return;
            }

            var dialog = new LoadSaveSegmentationDialog("Load Segmentation", Settings.Default, "ColorImagesLoad", Settings.Default, "IdImagesLoad");
            var result = dialog.ShowDialog();

            if (result == true)
            {
                if (!Directory.Exists(dialog.ColorImages.Text))
                {
                    Console.WriteLine("ColorImages directory does not exist.");
                    return;
                }
                if (!Directory.Exists(dialog.IdImages.Text))
                {
                    Console.WriteLine("IdImages directory does not exist.");
                    return;
                }

                var segmenterImageStackLoadDescription = new SegmenterImageStackLoadDescription
                {
                    Directories = new Dictionary <string>
                    {
                        { "ColorMap", dialog.ColorImages.Text },
                        { "IdMap", dialog.IdImages.Text }
                    },
                };

                Engine.Segmenter.LoadSegmentation(segmenterImageStackLoadDescription);
            }
        }