Example #1
0
void MainWindow::OnCommonOpenDICOMDIR(wxCommandEvent&)
{
	wxFileDialog_Ptr dialog = construct_open_dialog(this, "Open DICOMDIR", "DICOMDIR Files|DICOMDIR");
	if(dialog->ShowModal() == wxID_OK)
	{
		std::string path = wxString_to_string(dialog->GetPath());
		try
		{
			check_file_exists(path);

			// Display a volume chooser dialog to allow the user to choose which volume to load.
			VolumeChooserDialog dialog(path);
			dialog.ShowModal();

			if(dialog.volume_choice())
			{
				load_volume(dialog.dicomdir(), *dialog.volume_choice());
			}
		}
		catch(std::exception& e)
		{
			wxMessageBox(string_to_wxString(e.what()), wxT("Error"), wxOK|wxICON_ERROR|wxCENTRE, this);
		}
	}
}
Example #2
0
void MainWindow::OnCommonOpenSavedVolumeChoice(wxCommandEvent&)
{
	wxFileDialog_Ptr dialog = construct_open_dialog(this, "Open Saved Volume Choice", "Volume Choice Files (*.vcf)|*.vcf");
	if(dialog->ShowModal() == wxID_OK)
	{
		std::string path = wxString_to_string(dialog->GetPath());
		load_saved_volume_choice(path);
	}
}
Example #3
0
void SegmentationWindow::OnMenuSegmentationLoadSegmentation(wxCommandEvent&)
{
	wxFileDialog_Ptr dialog = construct_open_dialog(this, "Load Segmentation", "Image Partition Forest Files (*.ipf)|*.ipf|All Files|*.*");
	if(dialog->ShowModal() == wxID_OK)
	{
		std::string path = wxString_to_string(dialog->GetPath());
		try
		{
			check_file_exists(path);
			PartitionModelT::VolumeIPF_Ptr volumeIPF = VolumeIPFFile::load(path);
			m_model->set_volume_ipf(volumeIPF);
		}
		catch(std::exception& e)
		{
			wxMessageBox(string_to_wxString(e.what()), wxT("Error"), wxOK|wxICON_ERROR|wxCENTRE, this);
		}
	}
}