X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fviews.cpp;fp=src%2Fviews.cpp;h=cb7663780813ec236fda07c4c46d4a647c7e58c4;hp=e3922dafce711ee8e7c1c44a01ed10e76aa8bb50;hb=6b2163676582e4d32020dc765b74cff3a1705d3c;hpb=63ef93d6bfd8039299bbf2733f054b378cfdcaa1 diff --git a/src/views.cpp b/src/views.cpp index e3922da..cb76637 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: views.cpp,v 1.170 2003/01/30 21:53:16 kevin Exp $ +** $Id: views.cpp,v 1.171 2003/03/15 10:27:30 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -2521,7 +2521,7 @@ ProjectionFileView::ProjectionFileView() m_iDefaultFilterMethod = ProcessSignal::FILTER_METHOD_CONVOLUTION; m_iDefaultFilterGeneration = ProcessSignal::FILTER_GENERATION_DIRECT; #endif - m_iDefaultZeropad = 1; + m_iDefaultZeropad = 2; m_iDefaultBackprojector = Backprojector::BPROJ_IDIFF; m_iDefaultInterpolation = Backprojector::INTERP_LINEAR; m_iDefaultInterpParam = 1; @@ -2530,7 +2530,7 @@ ProjectionFileView::ProjectionFileView() m_iDefaultPolarNX = 256; m_iDefaultPolarNY = 256; m_iDefaultPolarInterpolation = Projections::POLAR_INTERP_BILINEAR; - m_iDefaultPolarZeropad = 1; + m_iDefaultPolarZeropad = 2; } ProjectionFileView::~ProjectionFileView() @@ -3063,12 +3063,12 @@ ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view) GetDocumentManager()->FileHistoryAddFilesToMenu(m_pFileMenu); GetDocumentManager()->FileHistoryUseMenu(m_pFileMenu); - wxMenu *convert_menu = new wxMenu; - convert_menu->Append (PJMENU_CONVERT_RECTANGULAR, "&Rectangular Image"); - convert_menu->Append (PJMENU_CONVERT_POLAR, "&Polar Image...\tCtrl-L"); - convert_menu->Append (PJMENU_CONVERT_FFT_POLAR, "FF&T->Polar Image...\tCtrl-T"); - convert_menu->AppendSeparator(); - convert_menu->Append (PJMENU_CONVERT_PARALLEL, "&Interpolate to Parallel"); + m_pConvertMenu = new wxMenu; + m_pConvertMenu->Append (PJMENU_CONVERT_RECTANGULAR, "&Rectangular Image"); + m_pConvertMenu->Append (PJMENU_CONVERT_POLAR, "&Polar Image...\tCtrl-L"); + m_pConvertMenu->Append (PJMENU_CONVERT_FFT_POLAR, "FF&T->Polar Image...\tCtrl-T"); + m_pConvertMenu->AppendSeparator(); + m_pConvertMenu->Append (PJMENU_CONVERT_PARALLEL, "&Interpolate to Parallel"); // wxMenu* filter_menu = new wxMenu; // filter_menu->Append (PJMENU_ARTIFACT_REDUCTION, "&Artifact Reduction"); @@ -3077,11 +3077,10 @@ ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view) analyze_menu->Append (PJMENU_PLOT_HISTOGRAM, "&Plot Histogram"); analyze_menu->Append (PJMENU_PLOT_TTHETA_SAMPLING, "Plot T-T&heta Sampling...\tCtrl-H"); - wxMenu *reconstruct_menu = new wxMenu; - reconstruct_menu->Append (PJMENU_RECONSTRUCT_FBP, "&Filtered Backprojection...\tCtrl-R", "Reconstruct image using filtered backprojection"); - reconstruct_menu->Append (PJMENU_RECONSTRUCT_FBP_REBIN, "Filtered &Backprojection (Rebin to Parallel)...\tCtrl-B", "Reconstruct image using filtered backprojection"); - // still buggy - // reconstruct_menu->Append (PJMENU_RECONSTRUCT_FOURIER, "&Fourier...\tCtrl-E", "Reconstruct image using inverse Fourier"); + m_pReconstructMenu = new wxMenu; + m_pReconstructMenu->Append (PJMENU_RECONSTRUCT_FBP, "&Filtered Backprojection...\tCtrl-R", "Reconstruct image using filtered backprojection"); + m_pReconstructMenu->Append (PJMENU_RECONSTRUCT_FBP_REBIN, "Filtered &Backprojection (Rebin to Parallel)...\tCtrl-B", "Reconstruct image using filtered backprojection"); + m_pReconstructMenu->Append (PJMENU_RECONSTRUCT_FOURIER, "&Inverse Fourier...\tCtrl-E", "Direct inverse Fourier"); wxMenu *help_menu = new wxMenu; help_menu->Append(MAINMENU_HELP_CONTENTS, "&Contents\tF1"); @@ -3092,10 +3091,10 @@ ProjectionFileView::CreateChildFrame(wxDocument *doc, wxView *view) wxMenuBar *menu_bar = new wxMenuBar; menu_bar->Append (m_pFileMenu, "&File"); - menu_bar->Append (convert_menu, "&Convert"); + menu_bar->Append (m_pConvertMenu, "&Convert"); // menu_bar->Append (filter_menu, "Fi<er"); menu_bar->Append (analyze_menu, "&Analyze"); - menu_bar->Append (reconstruct_menu, "&Reconstruct"); + menu_bar->Append (m_pReconstructMenu, "&Reconstruct"); menu_bar->Append (help_menu, "&Help"); subframe->SetMenuBar(menu_bar); @@ -3158,6 +3157,14 @@ ProjectionFileView::OnUpdate (wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint) const Projections& rProj = GetDocument()->getProjections(); const int nDet = rProj.nDet(); const int nView = rProj.nView(); + if (rProj.geometry() == Scanner::GEOMETRY_PARALLEL) { + m_pReconstructMenu->Enable (PJMENU_RECONSTRUCT_FBP_REBIN, false); + m_pConvertMenu->Enable (PJMENU_CONVERT_PARALLEL, false); + } else { + m_pReconstructMenu->Enable (PJMENU_RECONSTRUCT_FBP_REBIN, true); + m_pConvertMenu->Enable (PJMENU_CONVERT_PARALLEL, true); + } + if (nDet != 0 && nView != 0) { const DetectorArray& detarray = rProj.getDetectorArray(0); const DetectorValue* detval = detarray.detValues();