From: jean-pierre roux Date: Fri, 21 Nov 2008 15:13:29 +0000 (+0000) Subject: Removing references to gdcm X-Git-Tag: EED.02Oct2009~154 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=7234ef12a3b295a25bfc11492e50be0e148091f6;p=creaMaracasVisu.git Removing references to gdcm --- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/CMakeLists.txt b/lib/maracasVisuLib/src/interface/wxWindows/CMakeLists.txt index 75381cb..40c79c1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/CMakeLists.txt +++ b/lib/maracasVisuLib/src/interface/wxWindows/CMakeLists.txt @@ -36,20 +36,6 @@ SET(MARACAS_TOOLS_SOURCES # Required libraries (dll o so) #----------------------------------------------------------------------------- -##EED 6 aout 2007 -##TARGET_LINK_LIBRARIES(MaracasTools OSGi ${maracas_WXWIDGETS_LIBRARIES} ) - - - -#SUBDIRS(ILPD) - - -#GSLobj need GSL -#INCLUDE_DIRECTORIES(${GSL_INCLUDE_DIR}) - -#kernel need gdcm -#INCLUDE_DIRECTORIES(${GDCM_INCLUDE_DIR}) - #TODO for a nice VC++ we need to add header file... SET(MARACAS_LIB_SRCS @@ -269,60 +255,6 @@ SET(MARACAS_LIB_SRCS_02 wxMaracas_ManualContour_Panel.cxx wxMaracas_ManualContour_Panel.h -##### Contour Edition - JS - Juan Sebastian - #Contour/ContourPropagation.cxx - #Contour/ContourPropagation.h - #Contour/ExtractControlPoints2D.cxx - #Contour/ExtractControlPoints2D.h - #Contour/ContoursIntersection.cxx - #Contour/ContoursIntersection.h - #Contour/vectorFunctions.cxx - #Contour/vectorFunctions.h - #Contour/Propagation.cxx - #Contour/Propagation.h - -#####pPlotter classes - Monica/Silvia - #1widgets/pPlotter/HistogramDialog.cxx - #1widgets/pPlotter/HistogramDialog.h - #1widgets/pPlotter/HistogramWidget.cxx - #1widgets/pPlotter/HistogramWidget.h - #1widgets/pPlotter/pHistogram.cxx - #1widgets/pPlotter/pHistogram.h - #1widgets/pPlotter/mBarRange.cxx - #1widgets/pPlotter/mBarRange.h - #1widgets/pPlotter/pLogicalFunction.cxx - #1widgets/pPlotter/pLogicalFunction.h - #1widgets/pPlotter/pGraphicalFunction.h - #1widgets/pPlotter/pGraphicalFunction.cxx - #1widgets/pPlotter/pFunctionPoint.cxx - #1widgets/pPlotter/pFunctionPoint.h - #1widgets/pPlotter/pPlotterWindow.cxx - #1widgets/pPlotter/pPlotterWindow.h - #1widgets/pPlotter/pPlotterLayer.cxx - #1widgets/pPlotter/pPlotterLayer.h - #1widgets/pPlotter/pPlotterScaleX.h - #1widgets/pPlotter/pPlotterScaleX.cxx - #1widgets/pPlotter/pPlotterScaleY.h - #1widgets/pPlotter/pPlotterScaleY.cxx - #1widgets/pPlotter/pColorBar.h - #1widgets/pPlotter/pColorBar.cxx - #1widgets/pPlotter/pFigure.h - #1widgets/pPlotter/pFigure.cxx - #1widgets/pPlotter/pColorPoint.h - #1widgets/pPlotter/pColorPoint.cxx - #1widgets/pPlotter/pPlotter.h - #1widgets/pPlotter/pPlotter.cxx - #1widgets/pPlotter/mathplot.cxx - #1widgets/pPlotter/mathplot.h - #1widgets/pPlotter/MaximumsDialog.cxx - #1widgets/pPlotter/MaximumsDialog.h -# widgets/pPlotter/DegradeRectangle.cxx -# widgets/pPlotter/DegradeRectangle.h - #1widgets/pPlotter/LogicalColorBar.cxx - #1widgets/pPlotter/LogicalColorBar.h - #1widgets/pPlotter/Histogram.cxx - #1widgets/pPlotter/Histogram.h - ) @@ -337,7 +269,7 @@ TARGET_LINK_LIBRARIES(MaracasInterface02WX ## MaracasTools #${LIBIDO_LIBRARIES} ${GLIB_LIBRARIES} - ${GDCM_LIBRARIES} +# ${GDCM_LIBRARIES} vtkCommon vtkFiltering vtkGraphics vtkIO vtkImaging vtkRendering vtkHybrid ) @@ -348,40 +280,26 @@ SET(MARACAS_WIN32LIB_SRCS StdAfx.cpp wxMaracasApp.cxx wxMaracasApp.h - ../../kernel/marSimpleDicom.cpp - ../../kernel/marSimpleDicom.h +# ../../kernel/marSimpleDicom.cpp +# ../../kernel/marSimpleDicom.h res/wxInterface.rc ) -#ADD_LIBRARY(MaracasWin32Lib SHARED ${MARACAS_WIN32LIB_SRCS} ) -#TARGET_LINK_LIBRARIES(MaracasWin32Lib -# MaracasAlgorithm -# MaracasKernel -# MaracasSnakeContour -# MaracasInterfaceWX -# ${WXWIDGETS_LIBRARIES} -# vtkCommon vtkFiltering vtkGraphics vtkIO vtkImaging vtkRendering vtkHybrid vtkPatented -#) - - IF(WIN32) SET(MARACAS_WIN32APP_SRCS wxMaracasApp02.cxx wxMaracasApp02.h - ../../kernel/marGdcmDicom.cpp - ../../kernel/marGdcmDicom.h +# ../../kernel/marGdcmDicom.cpp +# ../../kernel/marGdcmDicom.h res/wxInterface.rc ) set(CMAKE_MFC_FLAG 2) ADD_EXECUTABLE(maracas WIN32 ${MARACAS_WIN32APP_SRCS} ) TARGET_LINK_LIBRARIES(maracas -# debug msvcrtd -# debug msvcprtd -# optimized msvcrt -# optimized msvcprt + MaracasAlgorithm MaracasKernel MaracasSnakeContour MaracasInterface02WX vtkCommon vtkFiltering vtkGraphics vtkIO vtkImaging vtkRendering vtkHybrid #vtkPatented @@ -390,29 +308,10 @@ IF(WIN32) ILPDInterface ILPDModel ILPDcontrolerInterface ${MYSQL_LIBRARIES} ${maracas_WXWIDGETS_LIBRARIES} - ${GDCM_LIBRARIES} + #${GDCM_LIBRARIES} ) -### -# SET(WIDO_WIN32APP_SRCS -# wxWidoApp.cxx -# wxWidoApp.h -# ) -# ADD_EXECUTABLE(wido_wx_test WIN32 ${WIDO_WIN32APP_SRCS} ) -# TARGET_LINK_LIBRARIES(wido_wx_test -# MaracasInterface02WX -# vtkCommon vtkFiltering vtkGraphics vtkIO vtkImaging vtkRendering vtkHybrid vtkPatented -# ${WXWIDGETS_LIBRARIES} -# debug msvcrtd -# debug msvcprtd -# optimized msvcrt -# optimized msvcprt -# ) -# -## - - IF(MYSQL_PATH) ##----Copy Debug cofiguration and DLLs--- @@ -454,16 +353,16 @@ IF(WIN32) ENDIF( EXISTS ${MYSQL_PATH}/Embedded/DLL/debug/libmysqld.dll ) - IF ( EXISTS ${GDCM_DIR}/../../bin/vtkgdcm.dll ) - CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmopenjpeg.dll ${LIBRARY_OUTPUT_PATH}/debug/gdcmopenjpeg.dll COPYONLY ) - CONFIGURE_FILE( ${GDCM_DIR}/../../bin/vtkgdcm.dll ${LIBRARY_OUTPUT_PATH}/debug/vtkgdcm.dll COPYONLY ) - CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmjpeg16.dll ${LIBRARY_OUTPUT_PATH}/debug/gdcmjpeg16.dll COPYONLY ) - CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmjpeg12.dll ${LIBRARY_OUTPUT_PATH}/debug/gdcmjpeg12.dll COPYONLY ) - CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmjpeg8.dll ${LIBRARY_OUTPUT_PATH}/debug/gdcmjpeg8.dll COPYONLY ) - CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcm.dll ${LIBRARY_OUTPUT_PATH}/debug/gdcm.dll COPYONLY ) - ELSE ( EXISTS ${GDCM_DIR}/../../bin/vtkgdcm.dll ) - MESSAGE (FATAL_ERROR, " gdcm dlls not found (Debug copy dlls) )") - ENDIF( EXISTS ${GDCM_DIR}/../../bin/vtkgdcm.dll ) +# IF ( EXISTS ${GDCM_DIR}/../../bin/vtkgdcm.dll ) +# CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmopenjpeg.dll ${LIBRARY_OUTPUT_PATH}/debug/gdcmopenjpeg.dll COPYONLY ) +# CONFIGURE_FILE( ${GDCM_DIR}/../../bin/vtkgdcm.dll ${LIBRARY_OUTPUT_PATH}/debug/vtkgdcm.dll COPYONLY ) +# CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmjpeg16.dll ${LIBRARY_OUTPUT_PATH}/debug/gdcmjpeg16.dll COPYONLY ) +# CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmjpeg12.dll ${LIBRARY_OUTPUT_PATH}/debug/gdcmjpeg12.dll COPYONLY ) +# CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmjpeg8.dll ${LIBRARY_OUTPUT_PATH}/debug/gdcmjpeg8.dll COPYONLY ) +# CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcm.dll ${LIBRARY_OUTPUT_PATH}/debug/gdcm.dll COPYONLY ) +# ELSE ( EXISTS ${GDCM_DIR}/../../bin/vtkgdcm.dll ) +# MESSAGE (FATAL_ERROR, " gdcm dlls not found (Debug copy dlls) )") +# ENDIF( EXISTS ${GDCM_DIR}/../../bin/vtkgdcm.dll ) IF ( EXISTS ${VTK_DIR}/../../bin/vtkCommon.dll ) CONFIGURE_FILE( ${VTK_DIR}/../../bin/vtkCommon.dll ${LIBRARY_OUTPUT_PATH}/debug/vtkCommon.dll COPYONLY ) @@ -537,16 +436,16 @@ IF(WIN32) MESSAGE (FATAL_ERROR, " libmysqld.dll not found (Release copy dlls)") ENDIF( EXISTS ${MYSQL_PATH}/Embedded/DLL/release/libmysqld.dll ) - IF ( EXISTS ${GDCM_DIR}/../../bin/vtkgdcm.dll ) - CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmopenjpeg.dll ${LIBRARY_OUTPUT_PATH}/release/gdcmopenjpeg.dll COPYONLY ) - CONFIGURE_FILE( ${GDCM_DIR}/../../bin/vtkgdcm.dll ${LIBRARY_OUTPUT_PATH}/release/vtkgdcm.dll COPYONLY ) - CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmjpeg16.dll ${LIBRARY_OUTPUT_PATH}/release/gdcmjpeg16.dll COPYONLY ) - CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmjpeg12.dll ${LIBRARY_OUTPUT_PATH}/release/gdcmjpeg12.dll COPYONLY ) - CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmjpeg8.dll ${LIBRARY_OUTPUT_PATH}/release/gdcmjpeg8.dll COPYONLY ) - CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcm.dll ${LIBRARY_OUTPUT_PATH}/release/gdcm.dll COPYONLY ) - ELSE ( EXISTS ${GDCM_DIR}/../../bin/vtkgdcm.dll ) - MESSAGE (FATAL_ERROR, " gdcm dlls not found (Release copy dlls)") - ENDIF( EXISTS ${GDCM_DIR}/../../bin/vtkgdcm.dll ) +# IF ( EXISTS ${GDCM_DIR}/../../bin/vtkgdcm.dll ) +# CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmopenjpeg.dll ${LIBRARY_OUTPUT_PATH}/release/gdcmopenjpeg.dll COPYONLY ) +# CONFIGURE_FILE( ${GDCM_DIR}/../../bin/vtkgdcm.dll ${LIBRARY_OUTPUT_PATH}/release/vtkgdcm.dll COPYONLY ) +# CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmjpeg16.dll ${LIBRARY_OUTPUT_PATH}/release/gdcmjpeg16.dll COPYONLY ) +# CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmjpeg12.dll ${LIBRARY_OUTPUT_PATH}/release/gdcmjpeg12.dll COPYONLY ) +# CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcmjpeg8.dll ${LIBRARY_OUTPUT_PATH}/release/gdcmjpeg8.dll COPYONLY ) +# CONFIGURE_FILE( ${GDCM_DIR}/../../bin/gdcm.dll ${LIBRARY_OUTPUT_PATH}/release/gdcm.dll COPYONLY ) +# ELSE ( EXISTS ${GDCM_DIR}/../../bin/vtkgdcm.dll ) +# MESSAGE (FATAL_ERROR, " gdcm dlls not found (Release copy dlls)") +# ENDIF( EXISTS ${GDCM_DIR}/../../bin/vtkgdcm.dll ) IF ( EXISTS ${VTK_DIR}/../../bin/vtkCommon.dll ) CONFIGURE_FILE( ${VTK_DIR}/../../bin/vtkCommon.dll ${LIBRARY_OUTPUT_PATH}/release/vtkCommon.dll COPYONLY ) @@ -598,8 +497,8 @@ ELSE(WIN32) SET(MARACAS_LINUXAPP_SRCS wxMaracasApp02.cxx wxMaracasApp02.h - ../../kernel/marGdcmDicom.cpp - ../../kernel/marGdcmDicom.h +# ../../kernel/marGdcmDicom.cpp +# ../../kernel/marGdcmDicom.h # res/wxInterface.rc ) # set(CMAKE_MFC_FLAG 2) @@ -621,7 +520,7 @@ ELSE(WIN32) ILPDModel ${MYSQL_LIBRARIES} ${maracas_WXWIDGETS_LIBRARIES} - ${GDCM_LIBRARIES} +# ${GDCM_LIBRARIES} ) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/wxILPDwithImage.cxx b/lib/maracasVisuLib/src/interface/wxWindows/wxILPDwithImage.cxx deleted file mode 100644 index e375775..0000000 --- a/lib/maracasVisuLib/src/interface/wxWindows/wxILPDwithImage.cxx +++ /dev/null @@ -1,452 +0,0 @@ -/*========================================================================= - - Program: wxMaracas - Module: $RCSfile: wxILPDwithImage.cxx,v $ - Language: C++ - Date: $Date: 2008/10/31 16:32:09 $ - Version: $Revision: 1.1 $ - - Copyright: (c) 2002, 2003 - License: - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - - -#include "wxILPDwithImage.h" - - -#include "ILPD/src/controlerInterface/ILPDViewListPatient.h" -#include "ILPD/src/wxInterface/ILPDViewWxWindow.h" - -#include -#include -#include "vtkGdcmReader.h" - -#include "marImageData.h" -#include "marGdcmDicom.h" - -#include - - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxILPDwithImage , wxPanel) - EVT_MENU(20001, wxILPDwithImage::OnSelectPatientStudySerieImage) -END_EVENT_TABLE() - - -//---------------------------------------------------------------------------- - -wxILPDwithImage::wxILPDwithImage(wxWindow *parent) - : wxPanel(parent, -1) -{ - - _wxvtk2Dbaseview = NULL; - _vtkbasedata = NULL; - - - wxPanel *panel=this; - panel->SetAutoLayout(true); - - - wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL ); - _pnlSplitter_ViewImage_wxILPD = new wxSplitterWindow( panel , -1); - _wxILPD = new wxILPD( _pnlSplitter_ViewImage_wxILPD ); - ILPDViewListPatient* _ilpdViewListPatient = new ILPDViewListPatient( new ILPDViewWxWindow(_wxILPD) ); - wxPanel *viewPanel = CreatePanel_ViewImagePanel_WxILPD( _pnlSplitter_ViewImage_wxILPD ); - - topsizer -> Add( _pnlSplitter_ViewImage_wxILPD ,1,wxGROW ,0); - - int ww,hh; - wxWindow *pp=this; - while (pp->GetParent()!=NULL) pp=pp->GetParent(); - pp->GetSize(&ww,&hh); - GetSize(&ww,&hh); - -//EEDxx2.4 -// pnlSplitter -> SplitHorizontally( viewPanel , _wxILPD, (int)(hh*0.45) ); - _pnlSplitter_ViewImage_wxILPD -> SplitVertically( _wxILPD , viewPanel,300); - _pnlSplitter_ViewImage_wxILPD -> SetMinimumPaneSize( 10 ); - -//EEDxx2.4 -// panel->FitInside(); - - - panel->SetSizer( topsizer ); // use the sizer for layout - panel->Layout(); - -} - -//---------------------------------------------------------------------------- -wxILPDwithImage::~wxILPDwithImage() -{ - if (_vtkbasedata!=NULL) { delete _vtkbasedata; } - if (_wxvtk2Dbaseview!=NULL) { delete _wxvtk2Dbaseview; } -} - -//---------------------------------------------------------------------------- -wxPanel *wxILPDwithImage::CreatePanel_ViewImagePanel_WxILPD( wxWindow *parent ) -{ - wxPanel *panel =new wxPanel( parent, -1 ); - - wxBoxSizer *topsizer = new wxBoxSizer(wxHORIZONTAL ); - _pnlSplitter_Image_DicomList = new wxSplitterWindow( panel , -1); - - _panelImage = new wxPanel(_pnlSplitter_Image_DicomList,-1); - _panelImage->SetBackgroundColour( wxColour(0,0,0) ); - wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL ); -// _panelImage->SetAutoLayout(true); - _panelImage->SetSizer( sizer ); // use the sizer for layout -// _panelImage->Layout(); -// _panelImage->FitInside(); - - int ww,hh; - wxWindow *pp=this; - while (pp->GetParent()!=NULL) pp=pp->GetParent(); - pp->GetSize(&ww,&hh); - - - _dicomPanelListView = new wxListView( _pnlSplitter_Image_DicomList, -1 ); - _pnlSplitter_Image_DicomList->SetMinimumPaneSize( 200 ); - -//EEDxx2.4 -// pnlSplitter -> SplitVertically( _panelImage, _dicomPanelListView, (int)(ww*0.45) ); - _pnlSplitter_Image_DicomList -> SplitHorizontally( _panelImage, _dicomPanelListView, 300); - - topsizer -> Add( _pnlSplitter_Image_DicomList ,1,wxGROW ,0); - - panel->SetAutoLayout(true); - panel->SetSizer( topsizer ); // use the sizer for layout - panel->Layout(); - -//EEDxx2.4 -// panel->FitInside(); - - - return panel; -} - - -//---------------------------------------------------------------------------- - -void wxILPDwithImage::SelectedSerie() -{ - if (_wxILPD->GetTypeOfSelection() == 3) - { - vector lstStringFileName; - _wxILPD->GetLstImageFiles(&lstStringFileName); - -//EED 4 oct 2006 -// marGdcmDicomILPD *margdcmdicomILPD = (marGdcmDicomILPD*)_mar->_dicom; -// margdcmdicomILPD->SetListImages( &lstStringFileName ); - - if (_backStringFirstFile==*(lstStringFileName[0])) - { -//EED 14Avril2008 OJO -// _noteBook->SetPageImage(1, 4); - } else { -//EED 14Avril2008 OJO -// _noteBook->SetPageImage(1, 3); - } - - // Show Image - int i,sizeLstNameFiles=lstStringFileName.size(); - i=sizeLstNameFiles/2; - - ShowDicomImage( lstStringFileName[i] ); - - // Show Number of Images - _dicomPanelListView->InsertColumn(0, _T("Number of Images") , wxLIST_FORMAT_LEFT, 100); - wxString text; - text.Printf(_T("%d"),sizeLstNameFiles); - SetItem(_dicomPanelListView,0,0, text ); - - - } else { -//EED 14Avril2008 OJO -// _noteBook->SetPageImage(1, 5); - } - -} - -//---------------------------------------------------------------------------- - -void wxILPDwithImage::ShowDicomInformation(string *fileImageName) -{ - - - GDCM_NAME_SPACE::File *gdcmFile = GDCM_NAME_SPACE::File::New(); - gdcmFile->SetLoadMode(GDCM_NAME_SPACE::LD_ALL); - gdcmFile->SetFileName( fileImageName->c_str() ); - bool ok = gdcmFile->Load(); - - // Filling lines - if (gdcmFile->IsEmpty()==true) - { - _dicomPanelListView->InsertColumn(0, _T("Error") , wxLIST_FORMAT_LEFT, 80); - SetItem(_dicomPanelListView,0,0, _T("File not found...") ); - } else { - - // Creating Columns - _dicomPanelListView->InsertColumn(0, _T("Tag") , wxLIST_FORMAT_LEFT, 80); - _dicomPanelListView->InsertColumn(1, _T("VR") , wxLIST_FORMAT_LEFT, 40); - _dicomPanelListView->InsertColumn(2, _T("Name") , wxLIST_FORMAT_LEFT, 150); - _dicomPanelListView->InsertColumn(3, _T("Value") , wxLIST_FORMAT_LEFT, 400); - - - - int line=0; - GDCM_NAME_SPACE::DataEntry *entry; - entry = (GDCM_NAME_SPACE::DataEntry*)gdcmFile->GetFirstEntry(); - while (entry!=NULL) - { - string groupelem = GDCM_NAME_SPACE::Util::Format("%04x | %04x" , entry->GetGroup() , entry->GetElement()); - SetItem(_dicomPanelListView,line,0, wxString(groupelem.c_str(), wxConvUTF8) ); - - string vr =entry->GetVR().str(); - SetItem(_dicomPanelListView,line,1, wxString(vr.c_str(), wxConvUTF8) ); - SetItem(_dicomPanelListView,line,2, wxString(entry->GetName().c_str(), wxConvUTF8) ); - - if (entry->GetBinArea()) - { - // Print Value - string value; - if( vr == "US" || vr == "SS" || vr == "UL" || vr == "SL" || vr == "FL" || vr == "FD") - { - value = entry->GetString(); - } else { - value = GDCM_NAME_SPACE::Util::CreateCleanString( entry->GetBinArea(),entry->GetLength() ); - } - value = "[" + value + "]" ; - SetItem(_dicomPanelListView,line,3, wxString(value.c_str(), wxConvUTF8) ); - } else { - SetItem(_dicomPanelListView,line,3, _T("- NOT LOADED -") ); - } - entry = (GDCM_NAME_SPACE::DataEntry*)gdcmFile->GetNextEntry(); - line++; - } // while - } //IsEmpty - gdcmFile->Delete(); -} - -//---------------------------------------------------------------------------- - -void wxILPDwithImage::ShowDicomImage(string *fileImageName) -{ - - bool reconfigure=false; - double colorwindow; - double colorlevel; - - - FILE *ff = fopen( fileImageName->c_str(),"r"); - if (ff==NULL) - { -// string msgText= "File not found: \n\n"; -// msgText.append(fileImageName->c_str()); -// wxMessageDialog msgBox(this, msgText.c_str(),"Read file ERROR", wxOK ); -// msgBox.ShowModal(); - } else { - fclose(ff); - if (_wxvtk2Dbaseview!=NULL) - { - reconfigure=true; - colorwindow = _wxvtk2Dbaseview->_imageViewer2XYZ->GetVtkImageViewer2()->GetColorWindow(); - colorlevel = _wxvtk2Dbaseview->_imageViewer2XYZ->GetVtkImageViewer2()->GetColorLevel(); - } - - - // Read header file - GDCM_NAME_SPACE::File *gdcmFile = GDCM_NAME_SPACE::File::New(); - gdcmFile->SetLoadMode(GDCM_NAME_SPACE::LD_NOSHADOW); - gdcmFile->SetFileName( fileImageName->c_str() ); - bool ok = gdcmFile->Load(); - long int offset = gdcmFile->GetPixelOffset(); - int dim[3]; - dim[0]=gdcmFile->GetXSize(); - dim[1]=gdcmFile->GetYSize(); - dim[2]=1; - - - // Memory allocation - vtkImageData *imageData = vtkImageData::New(); - imageData->SetDimensions ( dim ); - imageData->SetScalarTypeToUnsignedShort(); - imageData->AllocateScalars(); - imageData->Update(); - - marImageData *marimagedata = new marImageData(imageData); - - // Read Image - marGdcmDicom margdcmdicom; - void *p_vol = imageData->GetScalarPointer(0,0,0); - margdcmdicom.loadFileDicom( p_vol , dim , (char *)fileImageName->c_str() ); - -// EED 17 Oct 2007 Before -// if ( _wxvtk2Dbaseview ) { delete _wxvtk2Dbaseview; } -// _wxvtk2Dbaseview = new wxVtk2DBaseView( _panelImage ); - - -// EED 17 Oct 2007 After - if ( _wxvtk2Dbaseview==NULL ) - { - _wxvtk2Dbaseview = new wxVtk2DBaseView( _panelImage ); - wxVTKRenderWindowInteractor *imagePanel = _wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor(); - wxSizer *sizer=_panelImage->GetSizer(); - sizer-> Add( imagePanel ,1,wxGROW ,0); - _panelImage->SetAutoLayout(true); - _panelImage->Layout(); - } - - - if ( _vtkbasedata ) { delete _vtkbasedata; } -// if ( _widgetMesure ) { delete _widgetMesure; } - - -//_widgetMesure = new wxWidgetMesure2D(_panelImage); - -//_wxvtk2Dbaseview = new wxVtk2DBaseView( _widgetMesure ); - - - - _vtkbasedata = new vtkBaseData(); - _vtkbasedata->SetMarImageData( marimagedata ); - _wxvtk2Dbaseview->SetVtkBaseData( _vtkbasedata ); - _wxvtk2Dbaseview->Configure(true); - -//_widgetMesure->ConfigureA(_wxvtk2Dbaseview); -//_widgetMesure -> SetMesureScale( gdcmFile->GetXSpacing() ); - - gdcmFile->Delete(); - -//sizer-> Add( _widgetMesure ,1,wxGROW ,0); - - - _wxvtk2Dbaseview->Refresh(); - - if (reconfigure==true) - { - _wxvtk2Dbaseview->_imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow( colorwindow ); - _wxvtk2Dbaseview->_imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel( colorlevel ); - } - - } - -} - - -//---------------------------------------------------------------------------- -void wxILPDwithImage::ResetwxListView() -{ - // Reset wxListView - _dicomPanelListView->DeleteAllItems(); - int i,size=_dicomPanelListView->GetColumnCount(); - for (i=0;iDeleteColumn(0); - } -} - -//---------------------------------------------------------------------------- - -void wxILPDwithImage::SelectedImage() -{ - if (_wxILPD->GetTypeOfSelection() == 4) - { - string fileImageName; - _wxILPD->GetFileImageName( &fileImageName ); - ShowDicomInformation( &fileImageName ); - ShowDicomImage(&fileImageName); - } -} - -//---------------------------------------------------------------------------- - -void wxILPDwithImage::SelectedPatient() -{ - if (_wxILPD->GetTypeOfSelection() == 1) - { - _dicomPanelListView->InsertColumn(0, _T("Number of Series") , wxLIST_FORMAT_LEFT, 80); - int numberOfSeries = _wxILPD->GetNumberOfSeries(); - wxString text; - text.Printf(_T("%d"),numberOfSeries); - SetItem(_dicomPanelListView,0,0, text ); - } -} - -//---------------------------------------------------------------------------- - -void wxILPDwithImage::OnSelectPatientStudySerieImage(wxCommandEvent& event) -{ - ResetwxListView(); - SelectedPatient(); - - SelectedSerie(); - SelectedImage(); - - // Reset Image if there is no selection - if ((_wxILPD->GetTypeOfSelection() == 4) || (_wxILPD->GetTypeOfSelection() == 3)) - { - } else { - if (_vtkbasedata) - { - delete _vtkbasedata; - _vtkbasedata=NULL; - } - if (_wxvtk2Dbaseview) - { -// delete _wxvtk2Dbaseview; -// _wxvtk2Dbaseview=NULL; - } - } -} - - -//---------------------------------------------------------------------------- -void wxILPDwithImage::SetItem( wxListView *wxlistview, int line, int col, wxString text ) -{ - if (wxlistview->GetItemCount() <= line) - { - wxlistview->InsertItem(line,_T(" "),1); - } - wxListItem item; - item.m_itemId = line; - item.SetTextColour(*wxBLACK); - item.SetFont(*wxNORMAL_FONT); // or wxNORMAL_FONT, wxSMALL_FONT, wxSWISS_FONT - item.SetBackgroundColour(wxColour(255,255,255)); - wxlistview->SetItem( item ); - wxlistview->SetItem(line,col,text); -} - - - - - -//---------------------------------------------------------------------------- - -wxILPD *wxILPDwithImage::GetWxILPD() -{ - return _wxILPD; -} - - - - - - - -//---------------------------------------------------------------------------- -void wxILPDwithImage::Configure() -{ - _pnlSplitter_ViewImage_wxILPD -> SetSashPosition(850); - _pnlSplitter_Image_DicomList -> SetSashPosition(400); -} - diff --git a/lib/maracasVisuLib/src/interface/wxWindows/wxILPDwithImage.h b/lib/maracasVisuLib/src/interface/wxWindows/wxILPDwithImage.h deleted file mode 100644 index a0a4b5b..0000000 --- a/lib/maracasVisuLib/src/interface/wxWindows/wxILPDwithImage.h +++ /dev/null @@ -1,63 +0,0 @@ -/*========================================================================= - - Program: wxMaracas - Module: $RCSfile: wxILPDwithImage.h,v $ - Language: C++ - Date: $Date: 2008/10/31 16:32:09 $ - Version: $Revision: 1.1 $ - - Copyright: (c) 2002, 2003 - License: - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - -#ifndef __WX__ILPD__WITH__IMAGE__HXX__ -#define __WX__ILPD__WITH__IMAGE__HXX__ - -#include -#include // pour std::string - -#include "widgets/wxMPRWidget.h" - -using namespace std; -#include "ILPD/src/wxInterface/wxILPD.h" - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -class wxILPDwithImage: public wxPanel -{ -public: - wxILPDwithImage(wxWindow *parent); - ~wxILPDwithImage(); - wxPanel *CreatePanel_ViewImagePanel_WxILPD( wxWindow *parent ); - void OnSelectPatientStudySerieImage(wxCommandEvent& event); - void Configure(); - - wxILPD *GetWxILPD(); - DECLARE_EVENT_TABLE(); -private: - string _backStringFirstFile; - string _backStringFirstFile2; - wxILPD *_wxILPD; - wxListView *_dicomPanelListView; - wxVtk2DBaseView *_wxvtk2Dbaseview; - vtkBaseData *_vtkbasedata; - wxPanel *_panelImage; - wxSplitterWindow *_pnlSplitter_ViewImage_wxILPD; - wxSplitterWindow *_pnlSplitter_Image_DicomList; - void SetItem( wxListView *wxlistview, int line, int col, wxString text ) ; - void ResetwxListView(); - void SelectedPatient(); - void SelectedSerie(); - void SelectedImage(); - void ShowDicomInformation(string *fileImageName); - void ShowDicomImage(string *fileImageName); -}; - -#endif // __WX__ILPD__WITH__IMAGE__HXX__ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasFrame02.cxx b/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasFrame02.cxx deleted file mode 100644 index debef6a..0000000 --- a/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasFrame02.cxx +++ /dev/null @@ -1,4241 +0,0 @@ -/*========================================================================= - - Program: wxMaracas - Module: $RCSfile: wxMaracasFrame02.cxx,v $ - Language: C++ - Date: $Date: 2008/10/31 16:32:10 $ - Version: $Revision: 1.1 $ - - Copyright: (c) 2002, 2003 - License: - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - - -#include -#include -#include "vtkGdcmReader.h" - - -#include "wxMaracasParametersDialog.h" -#include "wxMaracasDataBrowser.h" -#include "widgets/wxSTLWidget_02.h" -#include "widgets/wxSTLWidget_03.h" -#include "widgets/wxMPRWidget.h" - - -#include -#include -#include -#include -#include -#include - -// EED Borrame not used -#include "wxMaracasImageBrowser.h" - -#include "wxMaracasHelpDialog.h" -#include "marDictionary.h" -#include "kernel/marImageData.h" - - - -//using namespace std; -#include "wxMaracasFrame02.h" - -#include "ILPD/src/controlerInterface/ILPDViewListPatient.h" -#include "ILPD/src/wxInterface/ILPDViewWxWindow.h" - - -// ---------------------------------------------------------------------------- -// Maracas "logic world" headers -// ---------------------------------------------------------------------------- -//#include - -#ifndef __WXMSW__ - #include "res/bitmaps/connect.xpm" - #include "res/bitmaps/params.xpm" - #include "res/bitmaps/imagebrowser.xpm" - #include "res/bitmaps/3D.xpm" - #include "res/bitmaps/plans.xpm" - #include "res/bitmaps/quant.xpm" - #include "res/bitmaps/rotate.xpm" - #include "res/bitmaps/bright.xpm" - #include "res/bitmaps/pan.xpm" - #include "res/bitmaps/zoom.xpm" - #include "res/bitmaps/clear.xpm" - #include "res/bitmaps/intensity.xpm" - #include "res/bitmaps/help.xpm" - #include "res/bitmaps/stl.xpm" - #include "res/bitmaps/creatis_logo.xpm" - #include "res/bitmaps/MPR.xpm" - #include "res/bitmaps/Axis_JF.xpm" - #include "res/bitmaps/Axis_JF_MH1.xpm" - #include "res/bitmaps/Axis_JF_MH2.xpm" - #include "res/bitmaps/ProcessingCT.xpm" - #include "res/bitmaps/QuantificationCT.xpm" - #include "res/icons/maracas.xpm" - - - #include "res/bitmaps2/v2_bi_bl_CTQuantification.xpm" - #include "res/bitmaps2/v2_bi_bl_Information.xpm" - #include "res/bitmaps2/v2_bi_bl_IRMQuantification.xpm" - #include "res/bitmaps2/v2_bi_bl_ListPatient_Voi.xpm" - #include "res/bitmaps2/v2_bi_bl_Logo.xpm" - #include "res/bitmaps2/v2_bi_bl_ManualRegistration.xpm" - #include "res/bitmaps2/v2_bi_bl_Params.xpm" - #include "res/bitmaps2/v2_bi_bl_Processing.xpm" - #include "res/bitmaps2/v2_bi_bl_STLFormat.xpm" - #include "res/bitmaps2/v2_bi_bl_Tests.xpm" - #include "res/bitmaps2/v2_bi_bl_VascularTree.xpm" - #include "res/bitmaps2/v2_bi_mask.xpm" - #include "res/bitmaps2/v2_bi_re_CTQuantification.xpm" - #include "res/bitmaps2/v2_bi_re_IRMQuantification.xpm" - #include "res/bitmaps2/v2_bi_re_ListPatient_Voi.xpm" - #include "res/bitmaps2/v2_bi_re_Logo.xpm" - #include "res/bitmaps2/v2_bi_re_ManualRegistration.xpm" - #include "res/bitmaps2/v2_bi_re_Params.xpm" - #include "res/bitmaps2/v2_bi_re_Processing.xpm" - #include "res/bitmaps2/v2_bi_re_STLFormat.xpm" - #include "res/bitmaps2/v2_bi_re_Tests.xpm" - #include "res/bitmaps2/v2_bi_re_VascularTree.xpm" - #include "res/bitmaps2/v2_sm_bl_AddAllPatients.xpm" - #include "res/bitmaps2/v2_sm_bl_AddPatient.xpm" - #include "res/bitmaps2/v2_sm_bl_AxisExtraction.xpm" - #include "res/bitmaps2/v2_sm_bl_CreateDICOMDIR.xpm" - #include "res/bitmaps2/v2_sm_bl_ListPatient.xpm" - #include "res/bitmaps2/v2_sm_bl_MPR.xpm" - #include "res/bitmaps2/v2_sm_bl_OpenDICOMDIR.xpm" - #include "res/bitmaps2/v2_sm_bl_OpenDirectory.xpm" - #include "res/bitmaps2/v2_sm_bl_ProcessingCT.xpm" - #include "res/bitmaps2/v2_sm_bl_Processing.xpm" - #include "res/bitmaps2/v2_sm_bl_Quantification.xpm" - #include "res/bitmaps2/v2_sm_bl_STLFormat.xpm" - #include "res/bitmaps2/v2_sm_bl_TreeExtraction_JF_MH.xpm" - #include "res/bitmaps2/v2_sm_bl_voi.xpm" - #include "res/bitmaps2/v2_sm_mask.xpm" - #include "res/bitmaps2/v2_sm_re_ListPatient.xpm" - #include "res/bitmaps2/v2_sm_re_voi.xpm" - #include "res/bitmaps2/v2_sm_tr_MPR.xpm" - #include "res/bitmaps2/v2_sm_tr_Processing.xpm" - #include "res/bitmaps2/v2_sm_tr_Quantification.xpm" - #include "res/bitmaps2/v2_sm_tr_STLFormat.xpm" - #include "res/bitmaps2/v2_sm_tr_VOI.xpm" -#endif - - - - - - -BEGIN_EVENT_TABLE( wxMaracasFrame02, wxFrame ) - EVT_MENU( ID_TOOLBAR_DATA_BROWSER , wxMaracasFrame02::OnLoadPatientData ) - - EVT_MENU( ID_TOOLBAR_PARAMETERS , wxMaracasFrame02::OnParameters ) - EVT_MENU( ID_TOOLBAR_IMAGE_BROWSER , wxMaracasFrame02::OnLoadImageData02 ) - EVT_MENU( ID_TOOLBAR_3D_BROWSER , wxMaracasFrame02::OnStartExperiment ) - EVT_MENU( ID_TOOLBAR_HELP , wxMaracasFrame02::OnHelp ) - EVT_MENU( ID_TOOLBAR_PLANS , wxMaracasFrame02::OnQuant ) - - EVT_MENU( ID_TOOLBAR_MPR , wxMaracasFrame02::OnMPR ) - EVT_MENU( ID_TOOLBAR_PROCESSING_CT , wxMaracasFrame02::OnProcessingCT ) - EVT_MENU( ID_TOOLBAR_QUANTIFICATION_CT, wxMaracasFrame02::OnQuantificationCT ) - - EVT_MENU( ID_TOOLBAR_EMPTY_PANEL , wxMaracasFrame02::OnEmptyPanel ) - EVT_MENU( ID_TOOLBAR_EMPTY_PANEL_2 , wxMaracasFrame02::OnEmptyPanel_2 ) - - EVT_MENU( ID_TOOLBAR_STL , wxMaracasFrame02::OnStl ) - EVT_CLOSE( wxMaracasFrame02::OnQuit ) - - // EED : This is not top !!!!!!!!!!! - EVT_TOOL( 19999 , wxMaracasFrame02::OnRegenerateAll ) - EVT_TOOL( 19998 , wxMaracasFrame02::OnRegenerateSplineAxe ) - EVT_TOOL( 19997 , wxMaracasFrame02::OnCleanContours ) - EVT_TOOL( 19996 , wxMaracasFrame02::OnRegenerateSignal ) - - EVT_LIST_ITEM_ACTIVATED( ID_SERIES_LIST, wxMaracasFrame02::OnLoadImageData ) - - EVT_TOOL(wxSurfaceWidget::ID_BUTTON_NEW_AXIS, wxMaracasFrame02::OnNewAxis ) - EVT_TOOL(wxSurfaceWidget::ID_BUTTON_DELETE_AXIS,wxMaracasFrame02::OnDeleteAxis ) -END_EVENT_TABLE( ); - -//---------------------------------------------------------------------------- -wxMaracasFrame02::wxMaracasFrame02( wxFrame *parent, wxWindowID id, - marInterface *mar, marInterfaceCT *marCT, - char *dictionaryFileName, - const wxString& title, const wxPoint& pos, - const wxSize& size, long style) - : wxFrame( parent, id, title, pos, size, style) -{ - marDictionary marDict; -// marDict.LoadDictionary_French(); - marDict.LoadDictionary_English(); -// marDict.LoadDictionary_Japanese(); - - -/* - if (!marDict.LoadDictionaryFile(dictionaryFileName)){ - wxMessageBox( _T("Error: File(s) marDict.txt not found..."), - _T("DxMM : MARACAS"), wxOK | wxCENTRE | wxICON_ERROR , this); - } - -*/ - _mar = mar; - _marCT = marCT; - - //good luck ! - vtkObject *a = vtkObject::New(); - a->GlobalWarningDisplayOff(); - a->Delete(); - - // At the begining, there were nothing, just a window... - _actual_panel = NULL; - - // And the programmer said: let there be a status bar - this->CreateStatusBar( ); - - this->GetStatusBar()->SetFieldsCount( 2 ); - wxRect rect; - this->GetStatusBar()->GetFieldRect(1, rect); - //wxPoint pos; - //wxSize size; - //_progressGauge = new wxGauge( this->GetStatusBar(), -1, 100); -// _progressGauge = new wxGauge( this->GetStatusBar(), -1, 50, -// rect.GetPosition(), rect.GetSize()); - this->GetStatusBar()->Show(); - this->PositionStatusBar(); - - // And an icon (to be unique) - //TODO change the icon to the real one! - this->SetIcon( wxICON( maracas_icon ) ); - - // And a toolbar (for dummy users) - this->RecreateToolbar( ); - -} -//---------------------------------------------------------------------------- -void wxMaracasFrame02::RecreateToolbar( ) -{ - wxToolBar* toolBar = this->GetToolBar( ); - delete toolBar; - this->SetToolBar( NULL ); - - toolBar = this->CreateToolBar( TOOLBAR_STYLE, ID_TOOLBAR ); - - // Set up toolbar - wxBitmap toolBarBitmaps[ 28+1 ]; - - /** - * wxBitmap vs. wxBITMAP -> add _xpm at the end of the file - */ - toolBarBitmaps[ 0 ] = wxBITMAP( toolbar_connect ); - toolBarBitmaps[ 4 ] = wxBITMAP( toolbar_params ); - toolBarBitmaps[ 7 ] = wxBITMAP( toolbar_imagebrowser ); - toolBarBitmaps[ 9 ] = wxBITMAP( toolbar_triD ); - toolBarBitmaps[ 10 ] = wxBITMAP( toolbar_plans ); - toolBarBitmaps[ 11 ] = wxBITMAP( toolbar_quant ); - toolBarBitmaps[ 12 ] = wxBITMAP( toolbar_rotate ); - toolBarBitmaps[ 13 ] = wxBITMAP( toolbar_bright ); - toolBarBitmaps[ 14 ] = wxBITMAP( toolbar_pan ); - toolBarBitmaps[ 15 ] = wxBITMAP( toolbar_zoom ); - toolBarBitmaps[ 16 ] = wxBITMAP( toolbar_clear ); - toolBarBitmaps[ 17 ] = wxBITMAP( toolbar_intensity ); - toolBarBitmaps[ 20 ] = wxBITMAP( toolbar_help ); - - toolBarBitmaps[ 21 ] = wxBITMAP( vesselstoolbar_stl ); - - toolBarBitmaps[ 22 ] = wxBITMAP( creatis_logo ); - toolBarBitmaps[ 23 ] = wxBITMAP( TOOLBAR_MPR ); - toolBarBitmaps[ 24 ] = wxBITMAP( TOOLBAR_AXIS_JF ); - toolBarBitmaps[ 25 ] = wxBITMAP( TOOLBAR_AXIS_JF_MH1 ); - toolBarBitmaps[ 26 ] = wxBITMAP( TOOLBAR_AXIS_JF_MH2 ); - toolBarBitmaps[ 27 ] = wxBITMAP( TOOLBAR_PROCESSINGCT ); - toolBarBitmaps[ 28 ] = wxBITMAP( TOOLBAR_QUANTIFICATIONCT ); - - /* - toolBarBitmaps[ 1 ] = wxBitmap( toolbar_loadexp ); - toolBarBitmaps[ 2 ] = wxBitmap( toolbar_save ); - toolBarBitmaps[ 3 ] = wxBitmap( toolbar_excel ); - toolBarBitmaps[ 5 ] = wxBitmap( toolbar_wizard ); - toolBarBitmaps[ 6 ] = wxBitmap( toolbar_back ); - toolBarBitmaps[ 8 ] = wxBitmap( toolbar_subtract ); - - toolBarBitmaps[ 18 ] = wxBitmap( toolbar_linear ); - toolBarBitmaps[ 19 ] = wxBitmap( toolbar_area ); - */ - // Set size & margins - toolBar->SetMargins( 4, 4 ); - toolBar->SetToolBitmapSize( wxSize( toolBarBitmaps[ 0 ].GetWidth( ), toolBarBitmaps[ 0 ].GetHeight( ) ) ); - - // Adding tools - toolBar->AddTool( ID_TOOLBAR_DATA_BROWSER, toolBarBitmaps[ 0 ], _T("Patient data"), _T("Load patient data: studies & series") ); - toolBar->AddSeparator( ); - toolBar->AddTool( ID_TOOLBAR_IMAGE_BROWSER, toolBarBitmaps[ 7 ], _T("Load image data"), _T("Load DICOM images from disk") ); - toolBar->AddSeparator( ); - toolBar->AddTool( ID_TOOLBAR_3D_BROWSER, toolBarBitmaps[ 9 ], _T("Start 3D"), _T("Load 3D representation") ); - toolBar->AddSeparator( ); - toolBar->AddTool( ID_TOOLBAR_PLANS, toolBarBitmaps[ 10 ], _T("Plan"), _T("Planes") ); - toolBar->AddSeparator( ); - toolBar->AddTool( ID_TOOLBAR_STL, toolBarBitmaps[ 21 ], _T("STL"), _T("Stl") ); - toolBar->AddSeparator( ); - - - -//EED toolBar->AddTool( ID_TOOLBAR_QUANT, toolBarBitmaps[ 11 ], "Quant", "Quant" ); -//EED toolBar->AddSeparator( ); - //The following has been commented out temporarlily - /* - toolBar->AddTool( ID_TOOLBAR_ROTATE, toolBarBitmaps[ 12 ], "Rotate", "Rotate" ); - toolBar->AddSeparator( ); - toolBar->AddTool( ID_TOOLBAR_BRIGHT, toolBarBitmaps[ 13 ], "Bright", "Bright" ); - toolBar->AddSeparator( ); - toolBar->AddTool( ID_TOOLBAR_PAN, toolBarBitmaps[ 14 ], "Pan", "Pan" ); - toolBar->AddSeparator( ); - toolBar->AddTool( ID_TOOLBAR_ZOOM, toolBarBitmaps[ 15 ], "Zoom", "Zoom" ); - toolBar->AddSeparator( ); - toolBar->AddTool( ID_TOOLBAR_CLEAR, toolBarBitmaps[ 16 ], "Clear", "Clear" ); - toolBar->AddSeparator( ); - toolBar->AddTool( ID_TOOLBAR_INTENSITY, toolBarBitmaps[ 17 ], "Intensity", "Intensity" ); - toolBar->AddSeparator( );*/ - toolBar->AddTool( ID_TOOLBAR_PARAMETERS , toolBarBitmaps[ 4 ] , _T("Parameters"), _T("Load parameters for modifying") ); - toolBar->AddTool( ID_TOOLBAR_HELP , toolBarBitmaps[ 20 ] , _T("Help"), _T("Help") ); - - toolBar->AddSeparator( ); - toolBar->AddTool( ID_TOOLBAR_MPR , toolBarBitmaps[ 23 ], _T("MPR"), _T("MPR") ); - toolBar->AddTool( ID_TOOLBAR_PROCESSING_CT , toolBarBitmaps[ 27 ], _T("ProcessingCT"), _T("ProcessingCT") ); - toolBar->AddTool( ID_TOOLBAR_QUANTIFICATION_CT , toolBarBitmaps[ 28 ], _T("QuantificationCT"), _T("QuantificationCT") ); - toolBar->AddSeparator( ); - toolBar->AddTool( ID_TOOLBAR_EMPTY_PANEL , toolBarBitmaps[ 24 ], _T("EmptyPanel"), _T("EmptyPanel") ); - toolBar->AddTool( ID_TOOLBAR_EMPTY_PANEL_2 , toolBarBitmaps[ 26 ], _T("EmptyPanel_2"), _T("EmptyPanel_2") ); - toolBar->AddSeparator( ); - - - wxBitmapButton *btnCreatisLogo = new wxBitmapButton(toolBar,-1/*ID_BUTTON_ABOUTCREATIS*/,toolBarBitmaps[ 22 ] ); - btnCreatisLogo->SetSize(81+10,20+10); - btnCreatisLogo->SetBackgroundColour(wxColour(0,0,153)); - Connect(btnCreatisLogo->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxMaracasFrame02::OnAboutCreatis ); - - toolBar->AddControl(btnCreatisLogo); - - toolBar->Realize( ); - toolBar->SetRows( 1 ); - -} - -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnAboutCreatis( wxCommandEvent& event ){ - - wxMaracasHelpDialog *dlg = new wxMaracasHelpDialog(this, -1, "Creatis", wxPoint(200,200), wxDefaultSize, wxDEFAULT_DIALOG_STYLE); - dlg->ShowModal(); - dlg->Close(); - -} - -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnQuit( wxCloseEvent& event ){ - - if( _actual_panel != NULL ) delete _actual_panel; - - - this->Destroy(); - - -} -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnLoadPatientData( wxCommandEvent& event ) -{ - wxBusyCursor wait; - wxToolBar* toolBar = this->GetToolBar( ); - //Disabling tool - //wxToolBar::EnableTool This function should only be called after Realize. - toolBar->EnableTool(ID_TOOLBAR_IMAGE_BROWSER , true); - toolBar->EnableTool(ID_TOOLBAR_3D_BROWSER , false); - toolBar->EnableTool(ID_TOOLBAR_PLANS , false); - toolBar->EnableTool(ID_TOOLBAR_QUANT , false); - toolBar->EnableTool(ID_TOOLBAR_STL , false); - - toolBar->EnableTool(ID_TOOLBAR_MPR , false); - toolBar->EnableTool(ID_TOOLBAR_PROCESSING_CT , false); - toolBar->EnableTool(ID_TOOLBAR_QUANTIFICATION_CT , false); - toolBar->EnableTool(ID_TOOLBAR_EMPTY_PANEL , false); - toolBar->EnableTool(ID_TOOLBAR_EMPTY_PANEL_2 , false ); - - - // Create panel - if( _actual_panel != NULL ) delete _actual_panel; - - - -/* -ver esto para reconectar ILPD -wxMaracasFrame02::OnLoadPatientData -wxMaracasFrame02::OnLoadImageData02 -wxMaracasApp02::OnInit -*/ - -// EED ILPD - wxILPD* pnl = new wxILPD( this ); - ILPDViewListPatient* _ilpdViewListPatient = new ILPDViewListPatient( new ILPDViewWxWindow(pnl) ); - -// wxMaracasDataBrowser* pnl = new wxMaracasDataBrowser( this, _mar, -1 ); - - - _actual_panel = pnl; - - // cf.: http://www.wxwindows.org/manuals/2.4.0/wx490.htm - // Force a resize. This should probably be replaced by a call to a wxFrame - // function that lays out default decorations and the remaining content window. - wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); - this->OnSize(myevent); - this->Show(true); - - // Load panel data -// pnl->LoadData( ); - - -} - - -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnParameters( wxCommandEvent& event ) -{ - wxMaracasParametersDialog *d = new wxMaracasParametersDialog( this, _mar ); - d->ShowModal( ); - d->Close( true ); -} - -// EED Borrme not used -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnLoadImageData( wxListEvent& event ){ - wxBusyCursor wait; - - // Create panel - if( _actual_panel != NULL ) delete _actual_panel; - wxMaracasImageBrowser* pnl = new wxMaracasImageBrowser( this, _mar, -1 ); - - // Resize - _actual_panel = pnl; - - // Load panel data - wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); - this->OnSize(myevent); - //this->Show(true); - - //wxDialog dialog(this, -1, "coucou"); - //dialog.ShowModal(); - //dialog.Show(true); - //wxGauge gauge( this, -1, 50); - - /** - AS a first step I'll pass a wxGauge as parameter this doesn't - sound very good, should use EVT_TIMER instead... - */ - _mar->_dicom->loadActualSerie( this->_progressGauge ); - vtkImageData *dummy = _mar->_dicom->getVolume( )->castVtk(); - //float range[2]; - //dummy->GetScalarRange( range ); - - pnl->LoadData( dummy ); - //_view_image->ConstructVTK( (vtkImageData *)_mar->_dicom->getVolume( )); - //^ this is not working ??? I don't understand why, some VTK pipeline mystery - - this->GetToolBar()->EnableTool(ID_TOOLBAR_IMAGE_BROWSER, false); - this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER, true); - - this->GetToolBar()->EnableTool(ID_TOOLBAR_PLANS, false); - this->GetToolBar()->EnableTool(ID_TOOLBAR_STL, false); - - //Add patient name to the frame title - this->SetTitle( _T("Patient Name : ") + _mar->_dicom->GetPatientName() ); -} - - -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnLoadImageData02( wxCommandEvent& event ){ - wxBusyCursor wait; - - -// EED ILPD - wxILPD *wxilpd=(wxILPD*)_actual_panel; - vector lstStringFileName; - wxilpd->GetLstImageFiles(&lstStringFileName); - if (lstStringFileName.size()!=0) - { - marGdcmDicomILPD *margdcmdicomILPD = (marGdcmDicomILPD*)_mar->_dicom; - marGdcmDicomILPD *margdcmdicomILPD2 = (marGdcmDicomILPD*)_marCT->_dicom; -// margdcmdicomILPD->SetListImages( &lstStringFileName ); -// margdcmdicomILPD2->SetListImages( &lstStringFileName ); - - - // Create panel - if( _actual_panel != NULL ) delete _actual_panel; - wxMaracasImageBrowser02* pnl = new wxMaracasImageBrowser02( this, _mar->_dicom, _mar->_parameters ); - - // Resize - _actual_panel = pnl; - - // Load panel data - wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); - this->OnSize(myevent); - - _mar->_dicom->loadActualSerie( this->_progressGauge ); - _marCT->_dicom->loadActualSerie( this->_progressGauge); - vtkImageData *dummy = _mar->_dicom->getVolume( )->castVtk(); - pnl->LoadData( new marImageData(dummy) ); - pnl->Start(); - - this->GetToolBar()->EnableTool(ID_TOOLBAR_IMAGE_BROWSER , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_PLANS , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_STL , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_MPR , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL_2 , true ); - - } // if lstStringFileName.size - - - -//Add patient name to the frame title -// EED attention -// this->SetTitle( "Patient Name : " + _mar->_dicom->GetPatientName() ); - -} - - -//---------------------------------------------------------------------------- - -void wxMaracasFrame02::OnStartExperiment( wxCommandEvent& event ) -{ - wxBusyCursor wait; - int voi[ 6 ]; - if (((wxMaracasImageBrowser02*)_actual_panel )->GetRoiSelected()){ - ((wxMaracasImageBrowser02*)_actual_panel )->ForceToFinisReadActiveImages( ); - ((wxMaracasImageBrowser02*)_actual_panel )->GetROI( voi ); - - _mar->_experiment->setVOI( voi ); - _mar->initExperiment( ); - - // Create panel - if( _actual_panel != NULL ) { delete _actual_panel; } - _wxmaracas3dbrowser = new wxMaracas3DBrowser( this, _mar, -1,ID_TOOLBAR_PLANS ); - _actual_panel = _wxmaracas3dbrowser; - - wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); - this->OnSize(myevent); - //this->Show(true); - - // Load panel data - _wxmaracas3dbrowser->LoadData( ); - - //this->GetToolBar()->EnableTool(ID_TOOLBAR_DATA_BROWSER, false); - this->GetToolBar()->EnableTool(ID_TOOLBAR_IMAGE_BROWSER , true); - this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER , false); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_MPR , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL_2 , false ); - } else { - wxMessageDialog *msg =new wxMessageDialog(this, _T("VOI not selected"), _T("Warning"), wxOK ); - msg->ShowModal(); - msg->Destroy(); - } -} -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnHelp (wxCommandEvent& event ) -{ - wxMaracasHelpDialog* help = new wxMaracasHelpDialog(this, -1); - help->ShowModal(); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnStl(wxCommandEvent& event ){ - - DeletePanels(); - - _wxmaracassurfaceSTLwidget = new wxSurfaceSTLWidget(this); - _wxmaracassurfaceSTLwidget->ShowMARACASData( _mar ); - _actual_panel = _wxmaracassurfaceSTLwidget; - - wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); - this->OnSize(myevent); - this->Show(true); - - // Load panel data - this->GetToolBar()->EnableTool(ID_TOOLBAR_PLANS , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_STL , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_IMAGE_BROWSER , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_MPR , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL_2 , false ); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnQuant (wxCommandEvent& event ) -{ - DeletePanels(); - _wxmaracasquantification = new wxMaracasQuantification( this, _mar, -1 ); - _actual_panel = _wxmaracasquantification; - - - wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); - this->OnSize(myevent); - this->Show(true); - - // Load panel data - _wxmaracasquantification->LoadData( ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_PLANS, false); - this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER, false); -} - -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnQuantificationCT (wxCommandEvent& event ) -{ - DeletePanels(); - _wxmaracasquantification_ct = new wxMaracasQuantificationCT( this, _marCT, -1 ); - _actual_panel = _wxmaracasquantification; - - - wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); - this->OnSize(myevent); - this->Show(true); - - // Load panel data - _wxmaracasquantification_ct->LoadData( ); -// this->GetToolBar()->EnableTool(ID_TOOLBAR_PLANS, false); -// this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER, false); -} - - - -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnMPR(wxCommandEvent& event ){ -printf("EED wxMaracasFrame02::OnMPR A\n"); - wxBusyCursor wait; - - int voi[ 6 ]; - if (((wxMaracasImageBrowser02*)_actual_panel )->GetRoiSelected()){ - ((wxMaracasImageBrowser02*)_actual_panel )->ForceToFinisReadActiveImages( ); - ((wxMaracasImageBrowser02*)_actual_panel )->GetROI( voi ); - - _mar->_experiment->setVOI( voi ); - _mar->initExperiment( ); - _marCT->setVOI(voi); - _marCT->SetDicom(_mar->_dicom); - _marCT->initExperiment(); - - - vtkImageData *imagedata; - imagedata = _marCT->getDynData( )->getVolume( )->castVtk(); - marImageData *marimagedata = new marImageData(imagedata); - - // Create panel - if( _actual_panel != NULL ) { delete _actual_panel; } - _wxMaracasMPR = new wxMaracasMPR( this, marimagedata ,_mar->_parameters->getVoxelSize() ); - _wxMaracasMPR->ConfigureVTK(); - // Resize - _actual_panel = _wxMaracasMPR; - - wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); - this->OnSize(myevent); - //this->Show(true); - - //this->GetToolBar()->EnableTool(ID_TOOLBAR_DATA_BROWSER, false); - this->GetToolBar()->EnableTool(ID_TOOLBAR_IMAGE_BROWSER , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_MPR , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_PROCESSING_CT , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL_2 , false ); - } else { - wxMessageDialog *msg =new wxMessageDialog(this, _T("VOI not selected"), _T("Warning"), wxOK ); - msg->ShowModal(); - msg->Destroy(); - } - - -printf("EED wxMaracasFrame02::OnMPR B\n"); - -} - -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnEmptyPanel(wxCommandEvent& event ) -{ - - wxBusyCursor wait; - - vtkMPRBaseData *vtkmpr2DData = ((wxMaracasMPR*)_actual_panel )->GetVtkMPRBaseData(); - vtkImageData *imagedata = vtkmpr2DData->GetImageData(); - - int x = (int)vtkmpr2DData->GetX(); - int y = (int)vtkmpr2DData->GetY(); - int z = (int)vtkmpr2DData->GetZ(); - // Create panel - if( _actual_panel != NULL ) { delete _actual_panel; } - _wxMaracasEmptyPanel = new wxMaracasEmptyPanel(this); - _wxMaracasEmptyPanel->ConfigureVTK(imagedata, x , y , z ); - - _actual_panel = _wxMaracasEmptyPanel; - - wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); - this->OnSize(myevent); - //this->Show(true); - - //this->GetToolBar()->EnableTool(ID_TOOLBAR_DATA_BROWSER, false); - this->GetToolBar()->EnableTool(ID_TOOLBAR_IMAGE_BROWSER , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_MPR , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL_2 , false ); - - -/* - wxBusyCursor wait; - vtkMPRBaseData *vtkmprbaseData = ((wxMaracasMPR*)_actual_panel )->GetVtkMPRBaseData(); - - vtkImageData *imagedata = vtkmprbaseData->GetImageData(); - - _mar->initExperiment( ); - - int x = vtkmprbaseData->GetX(); - int y = vtkmprbaseData->GetY(); - int z = vtkmprbaseData->GetZ(); - // Create panel - if( _actual_panel != NULL ) { delete _actual_panel; } - _wxMaracasEmptyPanel = new wxMaracasEmptyPanel(this, _mar); - _wxMaracasEmptyPanel->ConfigureVTK(imagedata, x , y , z ); - - _actual_panel = _wxMaracasEmptyPanel; - - wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); - this->OnSize(myevent); - //this->Show(true); - - //this->GetToolBar()->EnableTool(ID_TOOLBAR_DATA_BROWSER, false); - this->GetToolBar()->EnableTool(ID_TOOLBAR_IMAGE_BROWSER , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_MPR , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_PLANS , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL_2 , false ); -*/ -} - -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnProcessingCT(wxCommandEvent& event ) -{ -printf("EED wxMaracasFrame02::OnProcessingCT \n"); - wxBusyCursor wait; - vtkMPRBaseData *vtkmprbaseData = ((wxMaracasMPR*)_actual_panel )->GetVtkMPRBaseData(); - - marImageData *marimagedata = vtkmprbaseData->GetMarImageData(); - - _marCT->initExperiment( ); - - int x = (int)vtkmprbaseData->GetX(); - int y = (int)vtkmprbaseData->GetY(); - int z = (int)vtkmprbaseData->GetZ(); - // Create panel - if( _actual_panel != NULL ) { delete _actual_panel; } - _wxMaracasProcessingCT = new wxMaracasProcessingCT(this, _marCT); - _wxMaracasProcessingCT->ConfigureVTK(marimagedata, x , y , z ); - - _actual_panel = _wxMaracasProcessingCT; - - wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); - this->OnSize(myevent); - //this->Show(true); - - //this->GetToolBar()->EnableTool(ID_TOOLBAR_DATA_BROWSER, false); - this->GetToolBar()->EnableTool(ID_TOOLBAR_IMAGE_BROWSER , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_MPR , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_PLANS , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_QUANTIFICATION_CT , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL_2 , false ); -} - - - -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnEmptyPanel_2(wxCommandEvent& event ) -{ - wxBusyCursor wait; - int voi[ 6 ]; - - if (((wxMaracasImageBrowser02*)_actual_panel )->GetRoiSelected()){ - ((wxMaracasImageBrowser02*)_actual_panel )->ForceToFinisReadActiveImages( ); - ((wxMaracasImageBrowser02*)_actual_panel )->GetROI( voi ); - - _mar->_experiment->setVOI( voi ); - _mar->initExperiment( ); - - // Create panel - if( _actual_panel != NULL ) { delete _actual_panel; } - _wxMaracasEmptyPanel_2 = new wxMaracasEmptyPanel_2(this,_mar); - _wxMaracasEmptyPanel_2->ConfigureVTK(); - - _actual_panel = _wxMaracasEmptyPanel_2; - - wxSizeEvent myevent(wxSize(-1, -1), this->GetId()); - this->OnSize(myevent); - //this->Show(true); - - //this->GetToolBar()->EnableTool(ID_TOOLBAR_DATA_BROWSER, false); - this->GetToolBar()->EnableTool(ID_TOOLBAR_IMAGE_BROWSER , true ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_3D_BROWSER , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_MPR , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL , false ); - this->GetToolBar()->EnableTool(ID_TOOLBAR_EMPTY_PANEL_2 , false ); - } else { - wxMessageDialog *msg =new wxMessageDialog(this, _T("VOI not selected"), _T("Warning"), wxOK ); - msg->ShowModal(); - msg->Destroy(); - } -} - - -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnNewAxis(wxCommandEvent &WXUNUSED(event)) -{ - this->GetToolBar()->EnableTool(ID_TOOLBAR_PLANS, true); - this->GetToolBar()->EnableTool(ID_TOOLBAR_STL, true); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnDeleteAxis(wxCommandEvent &WXUNUSED(event)){ - this->GetToolBar()->EnableTool(ID_TOOLBAR_PLANS , false); - this->GetToolBar()->EnableTool(ID_TOOLBAR_STL , false); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnRegenerateAll( wxCommandEvent& event ){ - if (_wxmaracas3dbrowser!=NULL) { _wxmaracas3dbrowser->RegenerateAll(true); } - if (_wxmaracasquantification!=NULL) { _wxmaracasquantification->RegenerateAll(true); } -} -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnRegenerateSplineAxe( wxCommandEvent& event ){ - if (_wxmaracas3dbrowser!=NULL) { _wxmaracas3dbrowser->RegenerateAll(false); } - if (_wxmaracasquantification!=NULL) { _wxmaracasquantification->RegenerateAll(false); } -} -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnCleanContours( wxCommandEvent& event ){ - if (_wxmaracasquantification!=NULL) { _wxmaracasquantification->CleanContours(); } -} -//---------------------------------------------------------------------------- -void wxMaracasFrame02::OnRegenerateSignal( wxCommandEvent& event ){ - if (_wxmaracasquantification!=NULL) { _wxmaracasquantification->RegenerateSignal(); } -} -//---------------------------------------------------------------------------- -void wxMaracasFrame02::DeletePanels ( ){ - delete _actual_panel; - _wxmaracasquantification = NULL; - _wxmaracas3dbrowser = NULL; -} - - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -wxProcessingImagesControl::wxProcessingImagesControl(wxWindow *parent) -: wxPanel (parent,-1) -{ - wxBitmapButton *btnIRMQuant; - wxBitmapButton *btnCTQuant; - wxBitmapButton *btnSTL; - wxBitmapButton *btnManualRegistration; - wxBitmapButton *btnVascularTree; - wxBitmapButton *btnTests; - - wxBitmap bitmapMask =wxBITMAP( TOOLBAR_V2_bi_mask ); - - wxBitmap toolBarBitmapsA[ 5+1 ]; - wxBitmap toolBarBitmapsB[ 5+1 ]; - - toolBarBitmapsA[ 0 ] = wxBITMAP( TOOLBAR_V2_bi_bl_IRMQuantification ); - toolBarBitmapsA[ 1 ] = wxBITMAP( TOOLBAR_V2_bi_bl_CTQuantification ); - toolBarBitmapsA[ 2 ] = wxBITMAP( TOOLBAR_V2_bi_bl_VascularTree ); - toolBarBitmapsA[ 3 ] = wxBITMAP( TOOLBAR_V2_bi_bl_STLFormat ); - toolBarBitmapsA[ 4 ] = wxBITMAP( TOOLBAR_V2_bi_bl_Tests ); - toolBarBitmapsA[ 5 ] = wxBITMAP( TOOLBAR_V2_bi_bl_ManualRegistration); - - toolBarBitmapsA[0].SetMask( new wxMask(bitmapMask) ); - toolBarBitmapsA[1].SetMask( new wxMask(bitmapMask) ); - toolBarBitmapsA[2].SetMask( new wxMask(bitmapMask) ); - toolBarBitmapsA[3].SetMask( new wxMask(bitmapMask) ); - toolBarBitmapsA[4].SetMask( new wxMask(bitmapMask) ); - toolBarBitmapsA[5].SetMask( new wxMask(bitmapMask) ); - - - toolBarBitmapsB[ 0 ] = wxBITMAP( TOOLBAR_V2_bi_re_IRMQuantification ); - toolBarBitmapsB[ 1 ] = wxBITMAP( TOOLBAR_V2_bi_re_CTQuantification ); - toolBarBitmapsB[ 2 ] = wxBITMAP( TOOLBAR_V2_bi_re_VascularTree ); - toolBarBitmapsB[ 3 ] = wxBITMAP( TOOLBAR_V2_bi_re_STLFormat ); - toolBarBitmapsB[ 4 ] = wxBITMAP( TOOLBAR_V2_bi_re_Tests ); - toolBarBitmapsB[ 5 ] = wxBITMAP( TOOLBAR_V2_bi_re_ManualRegistration); - - toolBarBitmapsB[0].SetMask( new wxMask(bitmapMask) ); - toolBarBitmapsB[1].SetMask( new wxMask(bitmapMask) ); - toolBarBitmapsB[2].SetMask( new wxMask(bitmapMask) ); - toolBarBitmapsB[3].SetMask( new wxMask(bitmapMask) ); - toolBarBitmapsB[4].SetMask( new wxMask(bitmapMask) ); - toolBarBitmapsB[5].SetMask( new wxMask(bitmapMask) ); - - - // IRM Quantification - btnIRMQuant = new wxBitmapButton( this, -1, toolBarBitmapsA[ 0 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - btnIRMQuant->SetBitmapSelected(toolBarBitmapsB[ 0 ]); - - // CT Quantification - btnCTQuant = new wxBitmapButton( this, -1, toolBarBitmapsA[ 1 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - btnCTQuant->SetBitmapSelected(toolBarBitmapsB[ 1 ]); - - // Vascular Tree - btnVascularTree = new wxBitmapButton( this, -1, toolBarBitmapsA[ 2 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - btnVascularTree->SetBitmapSelected(toolBarBitmapsB[ 2 ]); - - // STL - btnSTL = new wxBitmapButton( this, -1, toolBarBitmapsA[ 3 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - btnSTL->SetBitmapSelected(toolBarBitmapsB[ 3 ]); - - // Tests - btnTests = new wxBitmapButton( this, -1, toolBarBitmapsA[ 4 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - btnTests->SetBitmapSelected(toolBarBitmapsB[ 4 ]); - - // Tests2 - btnManualRegistration = new wxBitmapButton( this, -1, toolBarBitmapsA[ 5 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - btnManualRegistration->SetBitmapSelected(toolBarBitmapsB[ 5 ]); - - wxBoxSizer *sizer= new wxBoxSizer(wxHORIZONTAL); - sizer->Add( btnIRMQuant , 1, wxALL, 0); - sizer->Add( btnCTQuant , 1, wxALL, 0); - sizer->Add( btnVascularTree , 1, wxALL, 0); - sizer->Add( btnSTL , 1, wxALL, 0); - sizer->Add( btnManualRegistration , 1, wxALL, 0); - sizer->Add( btnTests , 1, wxALL, 0); - - this->SetAutoLayout(true); - this->SetSizer(sizer); - this->Layout(); - - Connect(btnIRMQuant->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxProcessingImagesControl::OnActiveIRMQuantificationFrame ); - Connect(btnCTQuant->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxProcessingImagesControl::OnActiveCTQuantificationFrame ); - Connect(btnVascularTree->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxProcessingImagesControl::OnActiveVascularTreeExtractionFrame ); - Connect(btnSTL->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxProcessingImagesControl::OnActiveSTLFormatFrame ); - Connect(btnManualRegistration->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxProcessingImagesControl::OnActiveTests2Frame ); - Connect(btnTests->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxProcessingImagesControl::OnActiveTestsFrame ); -} - -//---------------------------------------------------------------------------- - -wxProcessingImagesControl::~wxProcessingImagesControl() -{ -} - -//---------------------------------------------------------------------------- -void wxProcessingImagesControl::OnActiveIRMQuantificationFrame(wxCommandEvent& event) -{ - wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,11112); - this->GetParent()->ProcessEvent(newevent); -// _wxmaracasframe03->CreateWindowMDI(20); -} -//---------------------------------------------------------------------------- -void wxProcessingImagesControl::OnActiveCTQuantificationFrame(wxCommandEvent& event) -{ - wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,11113); - this->GetParent()->ProcessEvent(newevent); -// _wxmaracasframe03->CreateWindowMDI(30); -} -//---------------------------------------------------------------------------- -void wxProcessingImagesControl::OnActiveVascularTreeExtractionFrame(wxCommandEvent& event) -{ - wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,11114); - this->GetParent()->ProcessEvent(newevent); -// _wxmaracasframe03->CreateWindowMDI(40); -} -//---------------------------------------------------------------------------- -void wxProcessingImagesControl::OnActiveSTLFormatFrame(wxCommandEvent& event) -{ - wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,11115); - this->GetParent()->ProcessEvent(newevent); -// _wxmaracasframe03->CreateWindowMDI(50); -} -//---------------------------------------------------------------------------- -void wxProcessingImagesControl::OnActiveTestsFrame(wxCommandEvent& event) -{ - wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,11116); - this->GetParent()->ProcessEvent(newevent); -// _wxmaracasframe03->CreateWindowMDI(60); -} -//---------------------------------------------------------------------------- -void wxProcessingImagesControl::OnActiveTests2Frame(wxCommandEvent& event) -{ - wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,11117); - this->GetParent()->ProcessEvent(newevent); -// _wxmaracasframe03->CreateWindowMDI(60); -} - - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -wxProcessingImagesTabControl::wxProcessingImagesTabControl(wxWindow *parent,marInterface *mar,wxMaracasNoteBookPatientLstVoi *patientlstvoi) -: wxPanel (parent,-1) -{ - - _mar = mar; - _patientlstvoi = patientlstvoi; - _irmQuantification = NULL; - _ctQuantification = NULL; - _vascularTreeExtraction = NULL; - _stlFormat = NULL; - - _noteBook = new wxNotebook(this, -1); - _noteBook->SetSize(750,300); - - wxBitmap bitmapMask = wxBITMAP( TOOLBAR_V2_bi_mask ); - - wxBitmap bitmap0 = wxBITMAP( TOOLBAR_V2_bi_bl_Information); - wxBitmap bitmap1 = wxBITMAP( TOOLBAR_V2_bi_bl_IRMQuantification); - wxBitmap bitmap2 = wxBITMAP( TOOLBAR_V2_bi_bl_CTQuantification); - wxBitmap bitmap3 = wxBITMAP( TOOLBAR_V2_bi_bl_VascularTree); - wxBitmap bitmap4 = wxBITMAP( TOOLBAR_V2_bi_bl_STLFormat); - - bitmap0.SetMask( new wxMask(bitmapMask) ); - bitmap1.SetMask( new wxMask(bitmapMask) ); - bitmap2.SetMask( new wxMask(bitmapMask) ); - bitmap3.SetMask( new wxMask(bitmapMask) ); - bitmap4.SetMask( new wxMask(bitmapMask) ); - - wxImageList *imageList = new wxImageList(100,100); - imageList->Add( bitmap0 ); // 0 - imageList->Add( bitmap1 ); // 1 - imageList->Add( bitmap2 ); // 2 - imageList->Add( bitmap3 ); // 3 - imageList->Add( bitmap4 ); // 4 - _noteBook->SetImageList(imageList); - - _noteBook->AddPage(new wxPanel(this,-1),_T("Information ") , true, 0 ); - _noteBook->AddPage(new wxPanel(this,-1),_T("IRM Quantification") , true, 1 ); - _noteBook->AddPage(new wxPanel(this,-1),_T("CT Quantification") , true, 2 ); - _noteBook->AddPage(new wxPanel(this,-1),_T("Vascular Tree") , true, 3 ); - _noteBook->AddPage(new wxPanel(this,-1),_T("STL Format") , true, 4 ); - _noteBook->SetSelection(0); - - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , (wxObjectEventFunction) &wxProcessingImagesTabControl::OnChangingPage ); - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , (wxObjectEventFunction) &wxProcessingImagesTabControl::OnChangePage ); - - wxBoxSizer *sizer= new wxBoxSizer(wxVERTICAL); - sizer->Add( _noteBook , 1, wxALL|wxEXPAND, 0); - - this->SetAutoLayout(true); - this->SetSizer(sizer); - this->Layout(); -} - -//---------------------------------------------------------------------------- - -wxProcessingImagesTabControl::~wxProcessingImagesTabControl() -{ -} - -//---------------------------------------------------------------------------- -void wxProcessingImagesTabControl::OnChangingPage(wxNotebookEvent& event) -{ -} -//---------------------------------------------------------------------------- -void wxProcessingImagesTabControl::OnChangePage(wxNotebookEvent& event) -{ - wxBusyCursor wait; - if (_noteBook->GetSelection()==1) - { - if (_irmQuantification==NULL){ - int page=1; - int voi[ 6 ]; - wxMaracasImageBrowser02 *imageBrowser= _patientlstvoi->GetWxMaracasImageBrowser02(); - imageBrowser->ForceToFinisReadActiveImages( ); - imageBrowser->GetROI( voi ); - _mar->_experiment->setVOI( voi ); - _irmQuantification = new wxMaracasNoteBookIRMQuantification(_noteBook->GetPage(page),_mar); - wxBoxSizer *sizer= new wxBoxSizer(wxHORIZONTAL); - sizer->Add( _irmQuantification , 1, wxALL|wxEXPAND, 0); - _noteBook->GetPage(page)->SetAutoLayout(true); - _noteBook->GetPage(page)->SetSizer(sizer); - _noteBook->GetPage(page)->Layout(); - } - } - if (_noteBook->GetSelection()==2) - { - if (_ctQuantification==NULL){ - int page=2; - int voi[ 6 ]; - wxMaracasImageBrowser02 *imageBrowser= _patientlstvoi->GetWxMaracasImageBrowser02(); - imageBrowser->ForceToFinisReadActiveImages( ); - imageBrowser->GetROI( voi ); - _mar->_experiment->setVOI( voi ); - string namefileParent=_patientlstvoi->GetRWCM_namefileVOI(); - _ctQuantification = new wxMaracasNoteBookCTQuantification(_noteBook->GetPage(page),_mar,namefileParent); - wxBoxSizer *sizer= new wxBoxSizer(wxHORIZONTAL); - sizer->Add( _ctQuantification , 1, wxALL|wxGROW, 0); - _noteBook->GetPage(page)->SetAutoLayout(true); - _noteBook->GetPage(page)->SetSizer(sizer); - _noteBook->GetPage(page)->Layout(); - } - } - - if (_noteBook->GetSelection()==3) - { - if (_vascularTreeExtraction==NULL){ - int page=3; - int voi[ 6 ]; - wxMaracasImageBrowser02 *imageBrowser= _patientlstvoi->GetWxMaracasImageBrowser02(); - imageBrowser->ForceToFinisReadActiveImages( ); - imageBrowser->GetROI( voi ); - _mar->_experiment->setVOI( voi ); - _vascularTreeExtraction = new wxMaracasNoteBookVascularTreeExtraction(_noteBook->GetPage(page),_mar); - wxBoxSizer *sizer= new wxBoxSizer(wxHORIZONTAL); - sizer->Add( _vascularTreeExtraction , 1, wxALL|wxGROW, 0); - _noteBook->GetPage(page)->SetAutoLayout(true); - _noteBook->GetPage(page)->SetSizer(sizer); - _noteBook->GetPage(page)->Layout(); - } - } - - if (_noteBook->GetSelection()==4) - { - if (_stlFormat==NULL){ - int page=4; - int voi[ 6 ]; - wxMaracasImageBrowser02 *imageBrowser= _patientlstvoi->GetWxMaracasImageBrowser02(); - imageBrowser->ForceToFinisReadActiveImages( ); - imageBrowser->GetROI( voi ); - _mar->_experiment->setVOI( voi ); - _stlFormat = new wxMaracasNoteBookSTLFormat(_noteBook->GetPage(page),_mar); - wxBoxSizer *sizer= new wxBoxSizer(wxHORIZONTAL); - sizer->Add( _stlFormat , 1, wxALL|wxGROW, 0); - _noteBook->GetPage(page)->SetAutoLayout(true); - _noteBook->GetPage(page)->SetSizer(sizer); - _noteBook->GetPage(page)->Layout(); - } - } - Refresh(); -} - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxMaracasFrame03, wxMDIParentFrame) -// Borrame -// EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit) -// EVT_MENU(MDI_REFRESH, MyChild::OnRefresh) -// EVT_MENU(MDI_CHANGE_TITLE, MyChild::OnChangeTitle) -// EVT_MENU(MDI_CHANGE_POSITION, MyChild::OnChangePosition) -// EVT_MENU(MDI_CHANGE_SIZE, MyChild::OnChangeSize) - EVT_MENU(20002, wxMaracasFrame03::OnActiveProcessingModules) - - EVT_MENU(ID_WXILPD_BUTTON_DELETE_ALL_DB , wxMaracasFrame03::eventMenuDeleteAllPatientInDB) - EVT_MENU(ID_WXILPD_BUTTON_DELETE_DB , wxMaracasFrame03::eventMenuDeletePatientInDB) - - EVT_MENU(ID_WXILPD_BUTTON_FILTER_DB , wxMaracasFrame03::OnFilterInDB) - EVT_MENU(ID_WXILPD_BUTTON_ORDERING_DB , wxMaracasFrame03::OnOrderingInDB) - EVT_MENU(ID_WXILPD_BUTTON_EDIT_COLUMN , wxMaracasFrame03::OnEditColumnsInDB) - - -// EVT_SIZE(wxMaracasFrame03::OnSize) -// EVT_MOVE(MyChild::OnMove) - -// EVT_CLOSE(wxMaracasPatientLstVoiChiFra::OnClose) - - - EVT_MENU(11110 , wxMaracasFrame03::OnActivePatientListVoiFrame ) - EVT_MENU(11111 , wxMaracasFrame03::OnActiveProcessingFrame ) - EVT_MENU(11112 , wxMaracasFrame03::OnActiveIRMQuantificationFrame ) - EVT_MENU(11113 , wxMaracasFrame03::OnActiveCTQuantificationFrame ) - EVT_MENU(11114 , wxMaracasFrame03::OnActiveVascularTreeExtractionFrame ) - EVT_MENU(11115 , wxMaracasFrame03::OnActiveSTLFormatFrame ) - EVT_MENU(11116 , wxMaracasFrame03::OnActiveTestsFrame ) - EVT_MENU(11117 , wxMaracasFrame03::OnActiveTests2Frame ) - - EVT_MENU(MDI_PARAMETERS , wxMaracasFrame03::OnActiveParams ) - EVT_MENU(MDI_ABOUT , wxMaracasFrame03::OnActiveAbout ) - EVT_MENU(MDI_QUIT , wxMaracasFrame03::OnActiveQuit ) -END_EVENT_TABLE() - - - - -wxMaracasFrame03::wxMaracasFrame03( wxFrame *parent, wxWindowID id, - marInterface *mar, char *dictionaryFileName, - const wxString& title, const wxPoint& pos, - const wxSize& size, long style) - : wxMDIParentFrame(parent, id, title, pos, size, - style | wxNO_FULL_REPAINT_ON_RESIZE) -{ - - wxFont font=wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT ); - - _mar = mar; - _option_menu = NULL; - _manualRegistrationPanel = NULL; - - marDictionary marDict; -// marDict.LoadDictionary_French(); - marDict.LoadDictionary_English(); -// marDict.LoadDictionary_Japanese(); - -// CreateToolBar(wxNO_BORDER | wxTB_FLAT | wxTB_HORIZONTAL); -// InitToolBar(GetToolBar()); - - CreateWindowMDI(0); - Configure_WindowMDI(0); -} -//---------------------------------------------------------------------------- -wxMaracasFrame03::~wxMaracasFrame03() -{ -} - - -//---------------------------------------------------------------------------- - -void wxMaracasFrame03::eventMenuDeleteAllPatientInDB(wxCommandEvent& event) -{ - if (_patientlstvoi->GetNoteBook()->GetSelection()==0) - { - if (_patientlstvoi->GetWxILPD()->GetNotebook()->GetSelection()==0) - { - _patientlstvoi->GetWxILPD()->eventBtnDeleteAllPatientInDB(event); - } - } -} - -//---------------------------------------------------------------------------- - -void wxMaracasFrame03::eventMenuDeletePatientInDB(wxCommandEvent& event) -{ - if (_patientlstvoi->GetNoteBook()->GetSelection()==0) - { - if (_patientlstvoi->GetWxILPD()->GetNotebook()->GetSelection()==0) - { - _patientlstvoi->GetWxILPD()->eventBtnDeletePatientInDB(event); - } - } -} - -//---------------------------------------------------------------------------- - -void wxMaracasFrame03::OnFilterInDB(wxCommandEvent& event) -{ - if (_patientlstvoi->GetNoteBook()->GetSelection()==0) - { - if (_patientlstvoi->GetWxILPD()->GetNotebook()->GetSelection()==0) - { - _patientlstvoi->GetWxILPD()->OnFilter(event); - } - } -} -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnOrderingInDB(wxCommandEvent& event) -{ - if (_patientlstvoi->GetNoteBook()->GetSelection()==0) - { - if (_patientlstvoi->GetWxILPD()->GetNotebook()->GetSelection()==0) - { - _patientlstvoi->GetWxILPD()->OnOrdering(event); - } - } -} -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnEditColumnsInDB(wxCommandEvent& event) -{ - if (_patientlstvoi->GetNoteBook()->GetSelection()==0) - { - if (_patientlstvoi->GetWxILPD()->GetNotebook()->GetSelection()==0) - { - _patientlstvoi->GetWxILPD()->OnEditColumns(event); - } - } -} - - - -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnActiveProcessingModules(wxCommandEvent& event) -{ -/* - _btnProcessingData -> Enable(); - _btnCTQuant -> Enable(); - _btnIRMQuant -> Enable(); - _btnTreeExtrac -> Enable(); - _btnSTLFormat -> Enable(); -*/ - if (_option_menu!=NULL) - { - _option_menu->Enable(11111, true ); - _option_menu->Enable(11112, true ); - _option_menu->Enable(11113, true ); - _option_menu->Enable(11114, true ); - _option_menu->Enable(11115, true ); - _option_menu->Enable(11116, true ); - } -} - -//---------------------------------------------------------------------------- -void wxMaracasFrame03::InitToolBar(wxToolBar* toolBar) -{ - - // Set up toolbar - wxBitmap toolBarBitmapsA[ 8+1 ]; - wxBitmap toolBarBitmapsB[ 8+1 ]; - - toolBarBitmapsA[ 0 ] = wxBITMAP( TOOLBAR_V2_bi_bl_ListPatient_Voi ); - toolBarBitmapsA[ 1 ] = wxBITMAP( TOOLBAR_V2_bi_bl_Processing ); - toolBarBitmapsA[ 2 ] = wxBITMAP( TOOLBAR_V2_bi_bl_Params ); - toolBarBitmapsA[ 3 ] = wxBITMAP( TOOLBAR_V2_bi_bl_Logo ); - toolBarBitmapsA[ 4 ] = wxBITMAP( TOOLBAR_V2_bi_bl_IRMQuantification ); - toolBarBitmapsA[ 5 ] = wxBITMAP( TOOLBAR_V2_bi_bl_CTQuantification ); - toolBarBitmapsA[ 6 ] = wxBITMAP( TOOLBAR_V2_bi_bl_VascularTree ); - toolBarBitmapsA[ 7 ] = wxBITMAP( TOOLBAR_V2_bi_bl_STLFormat ); - toolBarBitmapsA[ 8 ] = wxBITMAP( TOOLBAR_V2_bi_bl_ManualRegistration); - - toolBarBitmapsB[ 0 ] = wxBITMAP( TOOLBAR_V2_bi_re_ListPatient_Voi ); - toolBarBitmapsB[ 1 ] = wxBITMAP( TOOLBAR_V2_bi_re_Processing ); - toolBarBitmapsB[ 2 ] = wxBITMAP( TOOLBAR_V2_bi_re_Params ); - toolBarBitmapsB[ 3 ] = wxBITMAP( TOOLBAR_V2_bi_re_Logo ); - toolBarBitmapsB[ 4 ] = wxBITMAP( TOOLBAR_V2_bi_re_IRMQuantification ); - toolBarBitmapsB[ 5 ] = wxBITMAP( TOOLBAR_V2_bi_re_CTQuantification ); - toolBarBitmapsB[ 6 ] = wxBITMAP( TOOLBAR_V2_bi_re_VascularTree ); - toolBarBitmapsB[ 7 ] = wxBITMAP( TOOLBAR_V2_bi_re_STLFormat ); - toolBarBitmapsB[ 8 ] = wxBITMAP( TOOLBAR_V2_bi_re_ManualRegistration); - - // Set size & margins - toolBar->SetMargins( 5, 5 ); - toolBar->SetToolBitmapSize( wxSize( toolBarBitmapsA[0].GetWidth()+20, toolBarBitmapsA[0].GetHeight()+20 ) ); - - // List Patient - wxBitmapButton *btn0 = new wxBitmapButton( toolBar, -1, toolBarBitmapsA[ 0 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - btn0->SetBitmapSelected(toolBarBitmapsB[ 0 ]); - - // Processing data - _btnProcessingData = new wxBitmapButton( toolBar, -1, toolBarBitmapsA[ 1 ]); - _btnProcessingData->SetBitmapSelected(toolBarBitmapsB[ 1 ]); - _btnProcessingData->Disable(); - - // Params - wxBitmapButton *btn2 = new wxBitmapButton( toolBar, -1, toolBarBitmapsA[ 2 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - btn2->SetBitmapSelected(toolBarBitmapsB[ 2 ]); - - // Logo Creatis - wxBitmapButton *btn3 = new wxBitmapButton( toolBar, -1, toolBarBitmapsA[ 3 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - btn3->SetBitmapSelected(toolBarBitmapsB[ 3 ]); - - // IRM Quantification - _btnIRMQuant = new wxBitmapButton( toolBar, -1, toolBarBitmapsA[ 4 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - _btnIRMQuant->SetBitmapSelected(toolBarBitmapsB[ 4 ]); - _btnIRMQuant->Disable(); - - // CT Quantification - _btnCTQuant = new wxBitmapButton( toolBar, -1, toolBarBitmapsA[ 5 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - _btnCTQuant->SetBitmapSelected(toolBarBitmapsB[ 5 ]); - _btnCTQuant->Disable(); - - // Vascular Tree Extraction - _btnTreeExtrac = new wxBitmapButton( toolBar, -1, toolBarBitmapsA[ 6 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - _btnTreeExtrac->SetBitmapSelected(toolBarBitmapsB[ 6 ]); - _btnTreeExtrac->Disable(); - - // STL Format - _btnSTLFormat = new wxBitmapButton( toolBar, -1, toolBarBitmapsA[ 7 ],wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|wxBU_BOTTOM ); - _btnSTLFormat->SetBitmapSelected(toolBarBitmapsB[ 7 ]); - _btnSTLFormat->Disable(); - - toolBar->AddControl( btn0 ); - toolBar->AddControl( _btnProcessingData ); - toolBar->AddSeparator( ); - toolBar->AddControl( _btnIRMQuant ); - toolBar->AddControl( _btnCTQuant ); - toolBar->AddControl( _btnTreeExtrac ); - toolBar->AddControl( _btnSTLFormat ); - toolBar->AddSeparator( ); - toolBar->AddControl( btn2 ); - toolBar->AddControl( btn3 ); - - toolBar->Realize(); -// toolBar->SetBackgroundColour( wxColour(130,130,130) ); - - Connect(btn0->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxMaracasFrame03::OnActivePatientListVoiFrame ); - Connect(_btnProcessingData->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxMaracasFrame03::OnActiveProcessingFrame ); - Connect(btn2->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxMaracasFrame03::OnActiveParams ); - Connect(btn3->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxMaracasFrame03::OnActiveAbout ); - Connect(_btnIRMQuant->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxMaracasFrame03::OnActiveIRMQuantificationFrame ); - Connect(_btnCTQuant->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxMaracasFrame03::OnActiveCTQuantificationFrame ); - Connect(_btnTreeExtrac->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxMaracasFrame03::OnActiveVascularTreeExtractionFrame ); - Connect(_btnSTLFormat->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxMaracasFrame03::OnActiveSTLFormatFrame ); - - - -} -//---------------------------------------------------------------------------- - -wxMenuBar *wxMaracasFrame03::CreateMenuBarBase(){ - // Make a menubar - wxMenu *file_menu = new wxMenu; - - file_menu->Append(MDI_QUIT, _T("&Exit")); - - wxMenu *help_menu = new wxMenu; - help_menu->Append(MDI_PARAMETERS , _T("Pa&rameters")); - help_menu->Append(MDI_ABOUT , _T("&About")); - - wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu , _T("&File")); - menu_bar->Append(help_menu , _T("&Help")); - - return menu_bar; -} -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnActivePatientListVoiFrame(wxCommandEvent& event) -{ - _frame_ListPatieint_Voi->Maximize(); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnActiveProcessingFrame(wxCommandEvent& event) -{ - CreateWindowMDI(10); - CreateWindowMDI(11); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnActiveParams(wxCommandEvent& event) -{ - wxMaracasParametersDialog *d = new wxMaracasParametersDialog( this, _mar ); - d->ShowModal( ); - d->Close( true ); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnActiveAbout(wxCommandEvent& event) -{ - wxMaracasHelpDialog* help = new wxMaracasHelpDialog(this, -1); - help->ShowModal(); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnActiveQuit(wxCommandEvent& event) -{ - this->Close(); -} - -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnActiveIRMQuantificationFrame(wxCommandEvent& event) -{ - CreateWindowMDI(20); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnActiveCTQuantificationFrame(wxCommandEvent& event) -{ - CreateWindowMDI(30); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnActiveVascularTreeExtractionFrame(wxCommandEvent& event) -{ - CreateWindowMDI(40); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnActiveSTLFormatFrame(wxCommandEvent& event) -{ - CreateWindowMDI(50); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnActiveTestsFrame(wxCommandEvent& event) -{ - CreateWindowMDI(60); -} -//---------------------------------------------------------------------------- -void wxMaracasFrame03::OnActiveTests2Frame(wxCommandEvent& event) -{ - CreateWindowMDI(70); -} - - -//---------------------------------------------------------------------------- -void wxMaracasFrame03::CreateWindowMDI( int type) -{ -// wxMaracasGenericChiFra *subframe=NULL; - wxFrame *subframe=NULL; - wxString title_sf; - - // Patient List - if (type==0){ - wxMaracasGenericChiFra *subframeTMP=NULL; - subframeTMP = new wxMaracasGenericChiFra(this, _T("..."), - wxPoint(50, 50), wxSize(300, 300),wxDEFAULT_FRAME_STYLE ); - subframeTMP->SetBlockCloseEvent(true); - subframe=subframeTMP; - subframe->Maximize(); - _patientlstvoi = new wxMaracasNoteBookPatientLstVoi(subframe); - _patientlstvoi->SetMarInterface(_mar); - _frame_ListPatieint_Voi=subframe; - title_sf=_T("Patient List"); - - wxMenu *database_menu = new wxMenu(); - database_menu->Append( ID_WXILPD_BUTTON_DELETE_ALL_DB , _T("Delete all patients")); - database_menu->Append( ID_WXILPD_BUTTON_DELETE_DB , _T("Delete Patient")); - database_menu->AppendSeparator(); - database_menu->Append( ID_WXILPD_BUTTON_FILTER_DB , _T("Filter")); - database_menu->Append( ID_WXILPD_BUTTON_ORDERING_DB , _T("Ordering")); - database_menu->Append( ID_WXILPD_BUTTON_EDIT_COLUMN , _T("Edit Column")); - - - _option_menu = new wxMenu; - _option_menu->Append(11110, _T("Patient &List - Voi")); - _option_menu->Append(11111, _T("&Processing")); - _option_menu->AppendSeparator(); - _option_menu->Append(11112, _T("&IRM Quantification")); - _option_menu->Append(11113, _T("&CT Quantification")); - _option_menu->AppendSeparator(); - _option_menu->Append(11114, _T("&Vascular Tree Extraction")); - _option_menu->AppendSeparator(); - _option_menu->Append(11115, _T("&STL")); - _option_menu->AppendSeparator(); - _option_menu->Append(11116, _T("&Tests")); - - _option_menu->Enable(11111, false ); - _option_menu->Enable(11112, false ); - _option_menu->Enable(11113, false ); - _option_menu->Enable(11114, false ); - _option_menu->Enable(11115, false ); - _option_menu->Enable(11116, false ); - - wxMenuBar *menu_bar = CreateMenuBarBase(); - - subframe->SetMenuBar(menu_bar); - menu_bar->Insert(2,database_menu,_T("Data Base") ); - menu_bar->Insert(2,_option_menu,_T("Options") ); - } - - // Processing 1 - if (type==10){ -#ifdef WIN32 - subframe = new wxMaracasGenericChiFra(this, _T("..."),wxPoint(-1, -1),wxSize(225, 260),wxDEFAULT_FRAME_STYLE); - wxMenuBar *menu_bar = CreateMenuBarBase(); - subframe->SetMenuBar(menu_bar); -#else - subframe = new wxFrame(this, -1, _T("...")); -#endif - new wxProcessingImagesControl(subframe); - title_sf=_T("Processing Images"); - } - - // Processing 2 - if (type==11){ -#ifdef WIN32 - subframe = new wxMaracasGenericChiFra(this, _T("..."),wxPoint(-1, -1),wxSize(750, 600),wxDEFAULT_FRAME_STYLE); - wxMenuBar *menu_bar = CreateMenuBarBase(); - subframe->SetMenuBar(menu_bar); -#else - subframe = new wxFrame(this, -1, _T("...")); -#endif - subframe->Maximize(); - new wxProcessingImagesTabControl(subframe,_mar,_patientlstvoi); - title_sf=_T("Processing Images"); - } - - // IRM Quantification - if (type==20){ - wxBusyCursor wait; - int voi[ 6 ]; - wxMaracasImageBrowser02 *imageBrowser= _patientlstvoi->GetWxMaracasImageBrowser02(); - imageBrowser->ForceToFinisReadActiveImages( ); - imageBrowser->GetROI( voi ); - _mar->_experiment->setVOI( voi ); - -#ifdef WIN32 - subframe = new wxMaracasGenericChiFra(this, _T("..."),wxPoint(-1, -1),wxSize(750, 600),wxDEFAULT_FRAME_STYLE); - wxMenuBar *menu_bar = CreateMenuBarBase(); - subframe->SetMenuBar(menu_bar); -#else - subframe = new wxFrame(this, -1, _T("...")); -#endif - - subframe->Maximize(); - wxMaracasNoteBookIRMQuantification *irmQuantification = new wxMaracasNoteBookIRMQuantification(subframe,_mar); - title_sf=_T("IRM Quantification"); - } - - // CT Quantification - if (type==30){ - wxBusyCursor wait; - int voi[ 6 ]; - -//EEDx11 - wxMaracasImageBrowser02 *imageBrowser= _patientlstvoi->GetWxMaracasImageBrowser02(); - imageBrowser->ForceToFinisReadActiveImages( ); - imageBrowser->GetROI( voi ); - _mar->_experiment->setVOI( voi ); - -#ifdef WIN32 - subframe = new wxMaracasGenericChiFra(this, _T("..."),wxPoint(-1, -1),wxSize(750, 600),wxDEFAULT_FRAME_STYLE); - wxMenuBar *menu_bar = CreateMenuBarBase(); - subframe->SetMenuBar(menu_bar); -#else - subframe = new wxFrame(this, -1, _T("...")); -#endif - - subframe->Maximize(); - -//EEDx11 - string namefileParent=_patientlstvoi->GetRWCM_namefileVOI(); - wxMaracasNoteBookCTQuantification *ctQuantification = new wxMaracasNoteBookCTQuantification(subframe,_mar,namefileParent); - title_sf=_T("CT Quantification"); - } - - // Vascular Tree Extraction - if (type==40){ - wxBusyCursor wait; - int voi[ 6 ]; -//EEDx11 - wxMaracasImageBrowser02 *imageBrowser= _patientlstvoi->GetWxMaracasImageBrowser02(); - imageBrowser->ForceToFinisReadActiveImages( ); - imageBrowser->GetROI( voi ); - _mar->_experiment->setVOI( voi ); - - -#ifdef WIN32 - subframe = new wxMaracasGenericChiFra(this, _T("..."),wxPoint(-1, -1),wxSize(750, 600),wxDEFAULT_FRAME_STYLE); - wxMenuBar *menu_bar = CreateMenuBarBase(); - subframe->SetMenuBar(menu_bar); -#else - subframe = new wxFrame(this, -1, _T("...")); -#endif - subframe->Maximize(); -//EEDx11 - wxMaracasNoteBookVascularTreeExtraction *vascularTreeExtraction = new wxMaracasNoteBookVascularTreeExtraction(subframe,_mar); - title_sf=_T("Vascular Tree Extraction"); - - } - - // STL Format - if (type==50){ - wxBusyCursor wait; - int voi[ 6 ]; - -//EEDx11 - wxMaracasImageBrowser02 *imageBrowser= _patientlstvoi->GetWxMaracasImageBrowser02(); - imageBrowser->ForceToFinisReadActiveImages( ); - imageBrowser->GetROI( voi ); - _mar->_experiment->setVOI( voi ); - - - -#ifdef WIN32 - subframe = new wxMaracasGenericChiFra(this, _T("..."),wxPoint(-1, -1),wxSize(750, 600),wxDEFAULT_FRAME_STYLE); - wxMenuBar *menu_bar = CreateMenuBarBase(); - subframe->SetMenuBar(menu_bar); -#else - subframe = new wxFrame(this, -1, _T("...")); -#endif - - subframe->Maximize(); -//EEDx11 - wxMaracasNoteBookSTLFormat *stlFormat = new wxMaracasNoteBookSTLFormat(subframe,_mar); - - title_sf=_T("STL Format"); - } - - - // Test Format - if (type==60){ - wxBusyCursor wait; - int voi[ 6 ]; - wxMaracasImageBrowser02 *imageBrowser= _patientlstvoi->GetWxMaracasImageBrowser02(); - imageBrowser->ForceToFinisReadActiveImages( ); - imageBrowser->GetROI( voi ); - _mar->_experiment->setVOI( voi ); - -#ifdef WIN32 - subframe = new wxMaracasGenericChiFra(this, _T("..."),wxPoint(-1, -1),wxSize(750, 600),wxDEFAULT_FRAME_STYLE); - wxMenuBar *menu_bar = CreateMenuBarBase(); - subframe->SetMenuBar(menu_bar); -#else - subframe = new wxFrame(this, -1, _T("...")); -#endif - - subframe->Maximize(); - wxMaracasNoteBookTests *testsPanel = new wxMaracasNoteBookTests(subframe,_mar); - title_sf=_T("Tests"); - } - -// EED 7 Nov 2006 - // Test2 Format - if (type==70){ - bool ok=false; - - if (_manualRegistrationPanel==NULL) - { - ok=true; - } else { - if ( _manualRegistrationPanel->GetIfSecondVolumeExist()==true ) - { - ok=true; - } else { - _manualRegistrationPanel->GenerateSecondVolume(_mar); - _manualRegistrationPanel=NULL; - } - } - - if (ok==true){ - wxBusyCursor wait; - int voi[ 6 ]; - wxMaracasImageBrowser02 *imageBrowser= _patientlstvoi->GetWxMaracasImageBrowser02(); - imageBrowser->ForceToFinisReadActiveImages( ); - imageBrowser->GetROI( voi ); - _mar->_experiment->setVOI( voi ); - -#ifdef WIN32 - subframe = new wxMaracasGenericChiFra(this, _T("..."),wxPoint(-1, -1),wxSize(750, 600),wxDEFAULT_FRAME_STYLE); - wxMenuBar *menu_bar = CreateMenuBarBase(); - subframe->SetMenuBar(menu_bar); -#else - subframe = new wxFrame(this, -1, _T("...")); -#endif - - subframe->Maximize(); - _manualRegistrationPanel = new wxMaracasNoteBookManualRegistration(subframe,_mar); - title_sf=_T("Manual registration"); - } - } - - - - if (subframe!=NULL) - { - subframe->SetTitle(title_sf); - subframe->CreateStatusBar(); - subframe->SetStatusText(title_sf); - subframe->Show(TRUE); - } - - -} - -//---------------------------------------------------------------------------- - -void wxMaracasFrame03::Configure_WindowMDI( int type) -{ - if (type==0) - { -// _patientlstvoi->Configure(); - } -} - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxMaracasGenericChiFra, wxMDIChildFrame) -// Borrame -// EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit) -// EVT_MENU(MDI_REFRESH, MyChild::OnRefresh) -// EVT_MENU(MDI_CHANGE_TITLE, MyChild::OnChangeTitle) -// EVT_MENU(MDI_CHANGE_POSITION, MyChild::OnChangePosition) -// EVT_MENU(MDI_CHANGE_SIZE, MyChild::OnChangeSize) - -// EVT_SIZE(MyChild::OnSize) -// EVT_MOVE(MyChild::OnMove) - - EVT_CLOSE(wxMaracasGenericChiFra::OnClose) -END_EVENT_TABLE() - - -wxMaracasGenericChiFra::wxMaracasGenericChiFra(wxMDIParentFrame *parent, const wxString& title, - const wxPoint& pos, const wxSize& size, - const long style) - : wxMDIChildFrame(parent, -1, title, pos, size, - style | wxNO_FULL_REPAINT_ON_RESIZE) -{ - _blockClose=false; -} -//---------------------------------------------------------------------------- -wxMaracasGenericChiFra::~wxMaracasGenericChiFra() -{ - wxMDIParentFrame *parent = (wxMDIParentFrame*)GetParent(); - parent->ActivateNext(); -} - - -//---------------------------------------------------------------------------- -void wxMaracasGenericChiFra::OnClose(wxCloseEvent& event) -{ - if (_blockClose==true){ - wxMessageDialog msg(this, _T("You can't close this window.."), _T("Message box"), wxOK ); - msg.ShowModal(); - event.Veto(); - return; - } else { - event.Skip(); - } -} -//---------------------------------------------------------------------------- -void wxMaracasGenericChiFra::SetBlockCloseEvent(bool blockClose) -{ - _blockClose=blockClose; -} - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -// EED 3 Nov 2006 - - -FileInfoNode::FileInfoNode(string filename, string dirfile) -{ - _filename = filename; - _filenameParent = ""; - _dirfile = dirfile; -} -//---------------------------------------------------------------------------- -FileInfoNode::~FileInfoNode() -{ -} -//---------------------------------------------------------------------------- -string FileInfoNode::GetFileName() -{ - return _filename; -} -//---------------------------------------------------------------------------- -string FileInfoNode::GetFileNameParent() -{ - return _filenameParent; -} -//---------------------------------------------------------------------------- -void FileInfoNode::SetFileNameParent(string parent) -{ - _filenameParent=parent; -} -//---------------------------------------------------------------------------- -string FileInfoNode::GetDirFile() -{ - return _dirfile; -} - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -FileInformationModel::FileInformationModel() -{ -} -//---------------------------------------------------------------------------- -FileInformationModel::~FileInformationModel() -{ -} -//---------------------------------------------------------------------------- -int FileInformationModel::GetSizeLstFile_filter() -{ - int count=0; - int i,size = _lstFileInfoNodes.size(); - for ( i=0 ; iGetFileNameParent()==_filtre_1) - { - count++; - } - } - return count; -} -//---------------------------------------------------------------------------- -string FileInformationModel::GetFileName_filter(int i) -{ - string result; - int count=0; - int ii,size = _lstFileInfoNodes.size(); - for ( ii=0 ; iiGetFileNameParent()==_filtre_1) && (count==i) ) - { - result=_lstFileInfoNodes[ii]->GetFileName(); - break; - } - - if (_lstFileInfoNodes[ii]->GetFileNameParent()==_filtre_1) - { - count++; - } - } - return result; -} -//---------------------------------------------------------------------------- -int FileInformationModel::GetSizeLstFile() -{ - return _lstFileInfoNodes.size(); -} -//---------------------------------------------------------------------------- -string FileInformationModel::GetFileName(int i) -{ - return _lstFileInfoNodes[i]->GetFileName(); -} -//---------------------------------------------------------------------------- -void FileInformationModel::ResetModel() -{ - int i,size=_lstFileInfoNodes.size(); - for(i=0;iGetFileName(); - dirfile = _lstFileInfoNodes[i]->GetDirFile(); - name=dirfile+"/"; - name=name+filename; - ff=fopen(name.c_str(),"r+"); - fscanf(ff,"%s",tmp); - fscanf(ff,"%s",tmp); - fscanf(ff,"%s",tmp); - _lstFileInfoNodes[i]->SetFileNameParent(tmp); - fclose(ff); - } -} - - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -string wxReadWriteConf::_workDirectory = "c:/Maracas_configuration/"; - - -wxReadWriteConf::wxReadWriteConf(wxWindow *parent,string parentFile) -: wxDialog(parent, -1, wxString(_T("Read-Write Configuration")) ,wxDefaultPosition,wxSize(800,400), wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE ) -{ - _parentFile = parentFile; - wxButton *btnDirectory = new wxButton(this,-1,_T("Directory")); - _directoryTXT = new wxStaticText(this , -1 , wxString(_workDirectory.c_str(), wxConvUTF8) ); - - wxString tempTXT(_T("Parent File: ")); - tempTXT=tempTXT + wxString(_parentFile.c_str(), wxConvUTF8); - wxStaticText *parentFileTXT = new wxStaticText(this , -1 , tempTXT ); - Connect(btnDirectory->GetId(),wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction) &wxReadWriteConf::eventBtnWorkDirectory); - wxWindow *wxwindow = CreateReadModule(this); - wxBoxSizer *sizerA = new wxBoxSizer(wxHORIZONTAL); - sizerA->Add(parentFileTXT,1,wxALL,5); - wxBoxSizer *sizerB = new wxBoxSizer(wxHORIZONTAL); - sizerB->Add(btnDirectory,1,wxALL,5); - sizerB->Add(_directoryTXT,1,wxALL,10); - - wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); - sizer->Add(sizerA,0,wxALL,0); - sizer->Add(sizerB,0,wxALL,5); - sizer->Add(wxwindow,1,wxGROW|wxEXPAND,0); - this->SetSizer(sizer); - this->Layout(); - - _nameReadFile=""; - _fim = new FileInformationModel(); - ResetView(); -} -//---------------------------------------------------------------------------- -wxReadWriteConf::~wxReadWriteConf() -{ -} -//---------------------------------------------------------------------------- -void wxReadWriteConf::ResetView() -{ - _fim->Filtre_1(_parentFile); - _fim->ReadModel(_workDirectory); - RefreshReadFilesList(); - RefreshAllFilesList(); -} -//---------------------------------------------------------------------------- -wxWindow *wxReadWriteConf::CreateReadModule(wxWindow *parent) -{ - wxPanel *panel = new wxPanel(parent,-1); - - _wxviewinfo= new wxTextCtrl(panel,-1,_T(""),wxDefaultPosition,wxDefaultSize,wxTE_MULTILINE|wxHSCROLL ); - - wxBoxSizer * sizer = new wxBoxSizer(wxHORIZONTAL); - sizer->Add( CreateListFilesModule(panel), 1,wxGROW|wxEXPAND,0 ); - sizer->Add( _wxviewinfo , 1,wxEXPAND,0 ); - - panel->SetSizer(sizer); - panel->Layout(); - - return panel; -} - -//---------------------------------------------------------------------------- -wxWindow *wxReadWriteConf::CreateListFilesModule(wxWindow *parent) -{ - wxPanel *panel = new wxPanel(parent,-1); - wxNotebook *notebook = new wxNotebook(panel,-1); - notebook->AddPage( CreateReadFileModule(notebook) ,wxString(_T("Read File"))); - notebook->AddPage( CreateListAllFilesModule(notebook) ,wxString(_T("All files"))); - notebook->AddPage( new wxPanel(notebook,-1) ,wxString(_T("Files Relation"))); - wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); - sizer->Add(notebook,1,wxEXPAND|wxGROW,0); - panel->SetSizer(sizer); - panel->Layout(); - return panel; -} -//---------------------------------------------------------------------------- -wxWindow *wxReadWriteConf::CreateReadFileModule(wxWindow *parent) -{ - wxPanel *panel = new wxPanel(parent,-1); - _wxlstFiles = new wxListBox( panel , -1 , wxDefaultPosition , wxSize(900,900) ); - wxButton *btnReadFile = new wxButton(panel, -1, _T(" Read \n information file") ); - wxButton *btnWriteFile = new wxButton(panel, -1, _T(" Create \n new file information")); - wxButton *btnReWriteFile = new wxButton(panel, -1, _T(" ReWrite \n file information")); - - - Connect(_wxlstFiles->GetId(),wxEVT_COMMAND_LISTBOX_SELECTED ,(wxObjectEventFunction) &wxReadWriteConf::OnShowFile01); - Connect(_wxlstFiles->GetId(),wxEVT_COMMAND_LISTBOX_DOUBLECLICKED ,(wxObjectEventFunction) &wxReadWriteConf::eventBtnReadFile); - - Connect(btnReadFile->GetId(),wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction) &wxReadWriteConf::eventBtnReadFile); - Connect(btnWriteFile->GetId(),wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction) &wxReadWriteConf::eventBtnWriteFile); - Connect(btnReWriteFile->GetId(),wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction) &wxReadWriteConf::eventBtnReWriteFile); - - wxBoxSizer *sizerB = new wxBoxSizer(wxHORIZONTAL); - sizerB->Add( btnReadFile , 1 , wxALL|wxALIGN_CENTER|wxEXPAND , 5 ); - sizerB->Add( btnWriteFile , 1 , wxALL|wxALIGN_CENTER|wxEXPAND , 5 ); - sizerB->Add( btnReWriteFile , 1 , wxALL|wxALIGN_CENTER|wxEXPAND , 5 ); - wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); - sizer->Add( _wxlstFiles , 1 , wxGROW | wxEXPAND , 0 ); - sizer->Add( sizerB , 0 , wxALIGN_CENTER , 5 ); - panel->SetSizer(sizer); - panel->Layout(); - return panel; -} - -//---------------------------------------------------------------------------- -wxWindow *wxReadWriteConf::CreateListAllFilesModule(wxWindow *parent) -{ - wxPanel *panel = new wxPanel(parent,-1); - _wxlstAllFiles = new wxListBox( panel , -1 , wxDefaultPosition , wxSize(900,900) ); - - Connect(_wxlstAllFiles->GetId(),wxEVT_COMMAND_LISTBOX_SELECTED ,(wxObjectEventFunction) &wxReadWriteConf::OnShowFile02); - - wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); - sizer->Add( _wxlstAllFiles , 1 , wxGROW | wxEXPAND , 0 ); - panel->SetSizer(sizer); - panel->Layout(); - return panel; -} - -//---------------------------------------------------------------------------- -void wxReadWriteConf::eventBtnReadFile(wxCommandEvent &event) -{ - if (_nameReadFile!="") - { - wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,30002); - this->GetParent()->ProcessEvent(newevent); - this->Close(); - } -} -//---------------------------------------------------------------------------- -void wxReadWriteConf::eventBtnReWriteFile(wxCommandEvent &event) -{ - _nameWriteFile=_nameReadFile; - int sizeStr=_nameWriteFile.length() - string(".MaracasInfo").length(); - _nameWriteFile = _nameWriteFile.substr(0,sizeStr); - - if (_nameWriteFile!="") - { - wxString msg(_nameReadFile.c_str(), wxConvUTF8); - msg = msg+_T("\n\n\nYou really want to modify this file ?"); - int result = wxMessageDialog(this,msg,_T("Warning.."),wxOK | wxCANCEL).ShowModal(); - if (result==wxID_OK){ - wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,30001); - this->GetParent()->ProcessEvent(newevent); - this->ResetView(); - this->Close(); - } - } else { - wxMessageDialog(this,_T("First, you have to select a file."),_T("Warning.."), wxOK).ShowModal(); - } -} -//---------------------------------------------------------------------------- -void wxReadWriteConf::eventBtnWriteFile(wxCommandEvent &event) -{ - wxTextEntryDialog *filedlg = new wxTextEntryDialog(this, _T("Write MaracaInfo")); - if(filedlg->ShowModal() == wxID_OK) - { - wxBusyCursor wait; - string nameFile( (const char*)(filedlg->GetValue().mb_str()) ); - if (nameFile!=""){ - - string name = _workDirectory+"/"+nameFile+".MaracasInfo"; - FILE *ff=fopen( name.c_str() , "r+" ); - if (ff!=NULL) - { - fclose(ff); - wxMessageDialog(this,_T("...Error... \n\nThis file already exists."),_T("Error.."), wxOK).ShowModal(); - } else { - _nameWriteFile=nameFile; - wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,30001); - this->GetParent()->ProcessEvent(newevent); - this->ResetView(); - this->Close(); - } - } - } - -} -//---------------------------------------------------------------------------- -void wxReadWriteConf::OnShowFile01(wxCommandEvent &event) -{ - int id=_wxlstFiles->GetSelection(); - if (id!=-1){ - _nameReadFile = (const char*)(_wxlstFiles->GetString(id).mb_str()); - ShowInformation(_wxlstFiles,_wxviewinfo); - } -} -//---------------------------------------------------------------------------- -void wxReadWriteConf::OnShowFile02(wxCommandEvent &event) -{ - ShowInformation(_wxlstAllFiles,_wxviewinfo); -} -//---------------------------------------------------------------------------- -void wxReadWriteConf::ShowInformation(wxListBox *wxlistbox , wxTextCtrl* wxtextctrl ) -{ - int id=wxlistbox->GetSelection(); - if (id!=-1){ - string namefile = (const char*)(wxlistbox->GetString(id).mb_str()); - if (namefile!=""){ - wxString text; - char tmp[255]; - FILE *ff; - string nf(this->_workDirectory); - nf=nf+"/"; - nf=nf+namefile.c_str(); - - text = wxString(nf.c_str(), wxConvUTF8); - text = text + _T("\n--------------------------------------------\n"); - - ff=fopen(nf.c_str(),"r+"); - while (!feof(ff)){ - strcpy(tmp,""); - fgets(tmp,255,ff); - text = text + wxString(tmp, wxConvUTF8); - } - fclose(ff); - - wxtextctrl->SetValue(text); - } - } -} -//---------------------------------------------------------------------------- -void wxReadWriteConf::eventBtnWorkDirectory(wxCommandEvent &event) -{ - - - wxDirDialog *filedlg = new wxDirDialog(this, _T("Work Directory"), wxString(_workDirectory.c_str(), wxConvUTF8) ); - if(filedlg->ShowModal() == wxID_OK) - { - wxBusyCursor wait; - _workDirectory = (const char*)(filedlg->GetPath().mb_str()); - _directoryTXT->SetLabel( wxString(_workDirectory.c_str(), wxConvUTF8) ); - ResetView(); - } -} -//---------------------------------------------------------------------------- -void wxReadWriteConf::RefreshReadFilesList() -{ - _wxlstFiles->Clear(); - wxString wxfilename; - int i,size = _fim->GetSizeLstFile_filter(); - for (i=0; iAppend( wxString(_fim->GetFileName_filter(i).c_str(), wxConvUTF8) ); - } -} -//---------------------------------------------------------------------------- -void wxReadWriteConf::RefreshAllFilesList() -{ - _wxlstAllFiles->Clear(); - wxString wxfilename; - int i,size = _fim->GetSizeLstFile(); - for (i=0; iAppend( wxString(_fim->GetFileName(i).c_str(), wxConvUTF8) ); - } -} -//---------------------------------------------------------------------------- -string wxReadWriteConf::GetNameWriteFile() -{ - return _nameWriteFile; -} -//---------------------------------------------------------------------------- -string wxReadWriteConf::GetNameReadFile() -{ - return _nameReadFile; -} - -//---------------------------------------------------------------------------- -string wxReadWriteConf::GetWorkDirectory() -{ - return _workDirectory; -} - -string wxReadWriteConf::GetParentFile() -{ - return _parentFile; -} - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxMaracasNoteBookPatientLstVoi , wxPanel) -// Borrame -// EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit) -// EVT_MENU(MDI_REFRESH, MyChild::OnRefresh) -// EVT_MENU(MDI_CHANGE_TITLE, MyChild::OnChangeTitle) -// EVT_MENU(MDI_CHANGE_POSITION, MyChild::OnChangePosition) -// EVT_MENU(MDI_CHANGE_SIZE, MyChild::OnChangeSize) -// EVT_MENU(20001, wxMaracasNoteBookPatientLstVoi::OnSelectPatientStudySerieImage) - -// EVT_SIZE(MyChild::OnSize) -// EVT_MOVE(MyChild::OnMove) - -// EVT_CLOSE(wxMaracasPatientLstVoiChiFra::OnClose) - - EVT_MENU(30001, wxMaracasNoteBookPatientLstVoi::OnPersistence_Write) - EVT_MENU(30002, wxMaracasNoteBookPatientLstVoi::OnPersistence_Read) - - -END_EVENT_TABLE() - - -wxMaracasNoteBookPatientLstVoi::wxMaracasNoteBookPatientLstVoi(wxWindow *parent) - : wxPanel(parent, -1) -{ - - this->SetAutoLayout(true); - - -//EED 4 oct 2006 - _marRAWFiles = NULL; - _marRAW2Files = NULL; - _marRAW2AsciiFiles = NULL; - _marGdcmDicomILPD = NULL; - - -// EED 14 Nov 2006 - _wxreadwriteconf=NULL; - - - _wxMaracasMPR = NULL; - _wxMaracasImageBrowser02 = NULL; - _mar2 = NULL; - - _widgetMesure = NULL; -//EED 15Avril2008 _wxvtk2Dbaseview = NULL; -//EED 15Avril2008 _vtkbasedata = NULL; - - _backStringFirstFile = ""; - _backStringFirstFile2 = ""; - - _voiBack[0]=_voiBack[1]=_voiBack[2]=_voiBack[3]=_voiBack[4]=_voiBack[5]=-1; - - _noteBook = new wxNotebook(this, -1); - - _noteBook->SetSize(750,300); - wxImageList *imageList = new wxImageList(50,50); - - wxBitmap mask= wxBITMAP( TOOLBAR_V2_sm_mask ); - - wxBitmap bitmap0 = wxBITMAP( TOOLBAR_V2_sm_bl_ListPatient ); - wxBitmap bitmap1 = wxBITMAP( TOOLBAR_V2_sm_re_ListPatient ); - wxBitmap bitmap2 = wxBITMAP( TOOLBAR_V2_sm_re_ListPatient ); - wxBitmap bitmap3 = wxBITMAP( TOOLBAR_V2_sm_bl_voi ); - wxBitmap bitmap4 = wxBITMAP( TOOLBAR_V2_sm_re_voi ); - wxBitmap bitmap5 = wxBITMAP( TOOLBAR_V2_sm_tr_VOI ); - wxBitmap bitmap6 = wxBITMAP( TOOLBAR_V2_sm_bl_Processing ); - wxBitmap bitmap7 = wxBITMAP( TOOLBAR_V2_sm_bl_Processing ); - wxBitmap bitmap8 = wxBITMAP( TOOLBAR_V2_sm_tr_Processing ); - wxBitmap bitmap9 = wxBITMAP( TOOLBAR_V2_sm_bl_MPR ); - wxBitmap bitmap10 = wxBITMAP( TOOLBAR_V2_sm_bl_MPR ); - wxBitmap bitmap11 = wxBITMAP( TOOLBAR_V2_sm_tr_MPR ); - - bitmap0.SetMask(new wxMask( mask )); - bitmap1.SetMask(new wxMask( mask )); - bitmap2.SetMask(new wxMask( mask )); - bitmap3.SetMask(new wxMask( mask )); - bitmap4.SetMask(new wxMask( mask )); - bitmap5.SetMask(new wxMask( mask )); - bitmap6.SetMask(new wxMask( mask )); - bitmap7.SetMask(new wxMask( mask )); - bitmap8.SetMask(new wxMask( mask )); - bitmap9.SetMask(new wxMask( mask )); - bitmap10.SetMask(new wxMask( mask )); - bitmap11.SetMask(new wxMask( mask )); - - imageList->Add( bitmap0 ); // 0 - imageList->Add( bitmap1 ); // 1 - imageList->Add( bitmap2 ); // 2 - imageList->Add( bitmap3 ); // 3 - imageList->Add( bitmap4 ); // 4 - imageList->Add( bitmap4 ); // 5 - imageList->Add( bitmap6 ); // 6 - imageList->Add( bitmap7 ); // 7 - imageList->Add( bitmap8 ); // 8 - imageList->Add( bitmap9 ); // 9 - imageList->Add( bitmap10 ); // 10 - imageList->Add( bitmap11 ); // 11 - _noteBook->SetImageList(imageList); - - -//EED 15Avril2008 wxPanel *panel_with_wxILPD = CreatePanel_WxILPD( _noteBook ); -//EED 15Avril2008 ILPDViewListPatient* _ilpdViewListPatient = new ILPDViewListPatient( new ILPDViewWxWindow(_wxILPD) ); - - wxILPDwithImage *panel_with_wxILPD = new wxILPDwithImage( _noteBook ); - panel_with_wxILPD->Configure(); - _wxILPD = panel_with_wxILPD->GetWxILPD(); - - wxProcessingImagesControl *processingCtrl = new wxProcessingImagesControl(_noteBook); - - _noteBook->AddPage( panel_with_wxILPD , _T("Patient List >> ") , true, 0 ); - _noteBook->AddPage(new wxPanel(_noteBook,-1) , _T(" View Image >> ") , true, 5 ); - _noteBook->AddPage(new wxPanel(_noteBook,-1) , _T(" MPR ") , true, 11 ); - _noteBook->AddPage(processingCtrl , _T(" Processing ") , true, 8 ); - _noteBook->SetSelection(0); - - - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , (wxObjectEventFunction) &wxMaracasNoteBookPatientLstVoi::OnChangePageToVOI ); - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , (wxObjectEventFunction) &wxMaracasNoteBookPatientLstVoi::OnChangePage ); - - wxStaticText *title=new wxStaticText(this,-1,_T("Load Patient Image ")); - -// It doesn't works in linux -// wxFont font(18,wxDEFAULT , wxITALIC, wxBOLD); -// title->SetFont(font); - -//EEDxx2.6 -// wxNotebookSizer *nbs = new wxNotebookSizer( _noteBook ); - -// -- - wxButton *btnReadWriteConfig = new wxButton(this,-1,_T("Read-Write Config")); - Connect(btnReadWriteConfig->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxMaracasNoteBookPatientLstVoi::OnReadWriteConf_Maracas ); - wxButton *btnHelp = new wxButton(this,-1,_T("Help")); - wxButton *btnClose = new wxButton(this,-1,_T("Close")) - ; - wxBoxSizer *sizerB = new wxBoxSizer(wxHORIZONTAL); - sizerB->Add( btnReadWriteConfig , 0, wxALIGN_RIGHT, 10); - sizerB->Add( btnHelp , 0, wxALIGN_RIGHT, 10); - sizerB->Add( btnClose , 0, wxALIGN_RIGHT, 10); - - - wxBoxSizer *sizer= new wxBoxSizer(wxVERTICAL); - sizer->Add( sizerB , 0, wxALIGN_RIGHT, 10); - sizer->Add( title , 0, wxEXPAND | wxALIGN_RIGHT, 10); - - sizer->Add( _noteBook , 3, wxGROW|wxALL, 10 ); - - this->SetSizer(sizer); - this->Layout(); - -//EEDxx2.6 -// FitInside(); - - -// ConfigureVTK(); -} -//---------------------------------------------------------------------------- -wxMaracasNoteBookPatientLstVoi::~wxMaracasNoteBookPatientLstVoi() -{ - -//EED 15Avril2008 if (_vtkbasedata!=NULL) { delete _vtkbasedata; } -//EED 15Avril2008 if (_wxvtk2Dbaseview!=NULL) { delete _wxvtk2Dbaseview; } - - if (_mar2!=NULL) - { -// delete _mar2; - } - -} - - - - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookPatientLstVoi::SetMarInterface(marInterface *mar) -{ - _mar=mar; -} - - - -//---------------------------------------------------------------------------- - -void wxMaracasNoteBookPatientLstVoi::CreateMPRPanel() -{ - wxBusyCursor wait; - // Create panel - if (_wxMaracasMPR!=NULL) - { - delete _wxMaracasMPR; -// delete _mar2; - } - - int voi[ 6 ]; - _wxMaracasImageBrowser02->ForceToFinisReadActiveImages( ); - _wxMaracasImageBrowser02->GetROI( voi ); - _mar->_experiment->setVOI( voi ); - _mar2=new marInterface(); - - _mar2->_parameters->setRescaleSlope( _mar->_parameters->getRescaleSlope() ); - _mar2->_parameters->setRescaleIntercept( _mar->_parameters->getRescaleIntercept() ); - - - double spcOriginalImage[3]; - spcOriginalImage[0]=_mar->_parameters->getDoubleParam(marParameters::e_voxel_x_dimension); - spcOriginalImage[1]=_mar->_parameters->getDoubleParam(marParameters::e_voxel_y_dimension); - spcOriginalImage[2]=_mar->_parameters->getDoubleParam(marParameters::e_voxel_z_dimension); - -//EEDx1 -// _mar2->_parameters->setDoubleParam( marParameters::e_voxel_x_dimension, _mar->_parameters->getDoubleParam(marParameters::e_voxel_x_dimension) ); - _mar2->_parameters->setIntParam( marParameters::e_voxel_type, marParameters::VOX_TYPE_MINIMUM ); - _mar2->_parameters->setDoubleParam( marParameters::e_voxel_x_dimension, spcOriginalImage[0] ); - _mar2->_parameters->setDoubleParam( marParameters::e_voxel_y_dimension, spcOriginalImage[1] ); - _mar2->_parameters->setDoubleParam( marParameters::e_voxel_z_dimension, spcOriginalImage[2] ); - - _mar->_experiment->getVOI( voi ); - _mar2->_experiment->setVOI( voi ); - _mar2->SetDicom(_mar->_dicom); - _mar2->initExperiment( ); - - vtkImageData *imagedata; - imagedata = _mar2->_experiment->getDynData( )->getVolume( )->castVtk(); - imagedata->Update(); - - marImageData *marimagedata = new marImageData(imagedata); - marimagedata->SetSpcOriginal(spcOriginalImage); - marimagedata->SetVoiOriginal(voi); - - _wxMaracasMPR = new wxMaracasMPR( _noteBook->GetPage(2), marimagedata , _mar2->_parameters->getVoxelSize( ) ); - _wxMaracasMPR->ConfigureVTK(); - - wxBoxSizer *sizer= new wxBoxSizer(wxHORIZONTAL); - sizer->Add( _wxMaracasMPR , 1, wxALL|wxGROW, 0); - _noteBook->GetPage(2)->SetAutoLayout(true); - _noteBook->GetPage(2)->SetSizer(sizer); - _noteBook->GetPage(2)->Layout(); -} - - - - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookPatientLstVoi::OnChangePage(wxNotebookEvent& event) -{ - vector lstStringFileName; - if ( (_noteBook->GetSelection()==2) && event.GetOldSelection()==1 ) - { - _wxILPD->GetLstImageFiles(&lstStringFileName); - if (lstStringFileName.size()!=0) - { - int voi[6]; - _wxMaracasImageBrowser02->GetROI( voi ); - if ( (_backStringFirstFile2!=*(lstStringFileName[0])) || - ( _voiBack[0]!=voi[0]) || ( _voiBack[1]!=voi[1]) || ( _voiBack[2]!=voi[2]) || - ( _voiBack[3]!=voi[3]) || ( _voiBack[4]!=voi[4]) || ( _voiBack[5]!=voi[5]) ) - { - _backStringFirstFile2=*(lstStringFileName[0]); - _wxMaracasImageBrowser02->GetROI( _voiBack ); - CreateMPRPanel(); - } - } - - } else { - if ( (_noteBook->GetSelection()==2) && event.GetOldSelection()!=1 ) - { - wxMessageDialog msg(this, _T("Before this, you have to select the VOI in View image module.."), _T("Message box"), wxOK ); - msg.ShowModal(); - _noteBook->SetSelection(1); - } - - } - -// Refresh(); - _wxILPD->Refresh(); -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookPatientLstVoi::OnChangePageToVOI(wxNotebookEvent& event) -{ - //event.Skip(); - - if (_noteBook->GetSelection()==0){ - - FILE *ff; - bool okFirst=true; - // bool okAllFileExists = true; - // int i; - string msgLstFile=""; - - - // - //EED 4 Oct 2006 - if (_wxILPD->GetTypeOfReadFiles()==0) - { - if (_marGdcmDicomILPD==NULL) - { - _marGdcmDicomILPD = new marGdcmDicomILPD( _mar->_parameters ); - } - _mar->SetDicom(_marGdcmDicomILPD); - } - - // - //EED 4 Oct 2006 - if (_wxILPD->GetTypeOfReadFiles()==2) - { - - if ((_wxILPD->GetSubTypeOfReadFiles()==0) &&(_marRAWFiles==NULL)) - { - _marRAWFiles = new marRAWFiles( _mar->_parameters ); - _mar->SetDicom(_marRAWFiles); - } - - if ((_wxILPD->GetSubTypeOfReadFiles()==100) &&(_marGdcmDicomILPD==NULL)) - { - _marGdcmDicomILPD = new marGdcmDicomILPD( _mar->_parameters ); - _mar->SetDicom(_marGdcmDicomILPD); - } - - if ((_wxILPD->GetSubTypeOfReadFiles()==200) &&(_marRAW2Files==NULL)) - { - _marRAW2Files = new marRAW2Files( _mar->_parameters ); - _mar->SetDicom(_marRAW2Files); - } - if ((_wxILPD->GetSubTypeOfReadFiles()==300) &&(_marRAW2AsciiFiles==NULL)) - { - _marRAW2AsciiFiles = new marRAW2AsciiFiles( _mar->_parameters ); - _mar->SetDicom(_marRAW2AsciiFiles); - } - - } - - // - - if (_wxILPD->GetTypeOfSelection() == 3) - { - wxBusyCursor wait; - vector *lstStringFileName; - _mar->_dicom->CleanListImages(); - lstStringFileName = _mar->_dicom->GetListImages( ); - _wxILPD->GetLstImageFiles(lstStringFileName); - if (lstStringFileName->size()!=0) - { - - //EED 9 oct 2006 - // marGdcmDicomILPD *margdcmdicomILPD = (marGdcmDicomILPD*)_mar->_dicom; - // margdcmdicomILPD->SetListImages( &lstStringFileName ); - - - std::string *tmpStr=(*lstStringFileName)[0]; - if ( _backStringFirstFile!=*tmpStr ) - { - if (_wxILPD->GetTypeOfReadFiles()==0) - { - _backStringFirstFile=*tmpStr; - } else { - _backStringFirstFile="-1"; - } - _noteBook->SetPageImage(1, 4); // VOI Button Blue - _noteBook->SetPageImage(2, 9); // MPR Button Blue - _noteBook->SetPageImage(3, 6); // Processing Button Blue - - /* - // Verifying that the list of files exist - for( i=0 ; ic_str(),"r"); - if (ff!=NULL) - { - fclose(ff); - } else { - if (i==0) - { - okFirst=false; - break; - } - okAllFileExists = false; - msgLstFile = msgLstFile + lstStringFileName[i]->c_str()+ "\n"; - } - } - if ((okAllFileExists == false) && (okFirst==true)) - { - wxDialog *dialog = new wxDialog( this , -1, wxString("The following files doesn't exist:"), wxDefaultPosition, wxSize(550,300), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ); - - wxTextCtrl *textCtrl = new wxTextCtrl(dialog, -1, msgLstFile.c_str() ,wxDefaultPosition , wxSize(100,100) , wxTE_MULTILINE | wxTE_READONLY ); - textCtrl->SetSelection(0,0); - - wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL ); - sizer->Add( textCtrl , 1, wxALL|wxEXPAND, 0); - dialog->SetAutoLayout(true); - dialog->SetSizer( sizer ); // use the sizer for layout - dialog->Layout(); - dialog->FitInside(); - dialog->ShowModal(); - } - */ - - ff = fopen((*lstStringFileName)[0]->c_str(),"r"); - if (ff!=NULL) - { - fclose(ff); - } else { - okFirst=false; - msgLstFile = msgLstFile + (*lstStringFileName)[0]->c_str()+ "\n"; - } - - if (okFirst == false) - { - msgLstFile = "The series is incomplete or does not exists."; - wxMessageDialog msgBox(this, wxString(msgLstFile.c_str(), wxConvUTF8), _T("Read file ERROR"), wxOK); - msgBox.ShowModal(); - _backStringFirstFile=""; - event.Veto(); - } else { - - // Create panel - if (_wxMaracasImageBrowser02!=NULL) - { - delete _wxMaracasImageBrowser02; - } - _wxMaracasImageBrowser02 = new wxMaracasImageBrowser02( _noteBook->GetPage(1), _mar->_dicom, _mar->_parameters ); - // _wxMaracasImageBrowser02->SetSize(600,600); - - - _mar->_dicom->loadActualSerie( NULL/*this->_progressGauge*/ ); - vtkImageData *dummy = _mar->_dicom->getVolume( )->castVtk(); - _wxMaracasImageBrowser02->LoadData( new marImageData(dummy) ); - _wxMaracasImageBrowser02->Start(); - - wxBoxSizer *sizer= new wxBoxSizer(wxHORIZONTAL); - sizer->Add( _wxMaracasImageBrowser02 , 1, wxALL|wxGROW, 0); - // _noteBook->GetPage(1)->SetAutoLayout(true); - _noteBook->GetPage(1)->SetSizer(sizer); - _noteBook->GetPage(1)->Layout(); - // _wxMaracasImageBrowser02->Refresh(); - // _wxMaracasImageBrowser02->Update(); - //EEDxx2.4 - // _noteBook->GetPage(1)->FitInside(); - - - wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED,20002); - this->ProcessEvent( ev ); - - } - - } // _backStringFirstFile - - } // if lstStringFileName.size - } else { - if (_wxMaracasImageBrowser02==NULL) - { - wxMessageDialog msg(this, _T("You have to select a serie befor run this option.."), _T("Message box"), wxOK ); - msg.ShowModal(); - event.Veto(); - } - } - } //_noteBook->GetSelection()==0 -} - -//---------------------------------------------------------------------------- -wxMaracasImageBrowser02* wxMaracasNoteBookPatientLstVoi::GetWxMaracasImageBrowser02() -{ - return _wxMaracasImageBrowser02; -} - -//---------------------------------------------------------------------------- - -wxILPD *wxMaracasNoteBookPatientLstVoi::GetWxILPD() -{ - return _wxILPD; -} - -//---------------------------------------------------------------------------- -wxNotebook *wxMaracasNoteBookPatientLstVoi::GetNoteBook() -{ - return this->_noteBook; -} - -//---------------------------------------------------------------------------- - -void wxMaracasNoteBookPatientLstVoi::OnReadWriteConf_Maracas(wxCommandEvent& event) -{ - string parentFile; - if (this->_noteBook->GetSelection()==0) // Read DICOM images - { - parentFile="NULL"; - } - if (this->_noteBook->GetSelection()==1) // VOI - { - parentFile=_RWCM_namefileReadImages; - } - if (parentFile!="") - { - _wxreadwriteconf = new wxReadWriteConf(this,parentFile); - _wxreadwriteconf->ShowModal(); - _wxreadwriteconf=NULL; - } else { - wxMessageDialog(this,_T("No parent file defined..."),_T("Warning.."), wxOK).ShowModal(); - } -} - - - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookPatientLstVoi::Persistence_Read_Images() -{ - string name; - char tmp[255]; - _RWCM_namefileReadImages = _wxreadwriteconf->GetNameReadFile(); - string directory = _wxreadwriteconf->GetWorkDirectory(); - string file=directory + "/" + _RWCM_namefileReadImages; - if (_RWCM_namefileReadImages!=""){ - FILE *ff; - ff=fopen(file.c_str(),"r"); - fscanf(ff,"%s ",tmp); // MaracasInfo - fscanf(ff,"%s ",tmp); // NameFileParent - fscanf(ff,"%s ",tmp); // xxxxxxxx - fscanf(ff,"%s ",tmp); // TypeOfReadFile - fscanf(ff,"%s ",tmp); // xxxx - int typeOfReadFile = atoi(tmp); - fscanf(ff,"%s ",tmp); // SubTypeOfReadFile - fscanf(ff,"%s ",tmp); // xxxx - int subTypeOfReadFile = atoi(tmp); - fscanf(ff,"%s ",tmp); // DirectoryManualFiles - fscanf(ff,"%s ",tmp); // xxxx - string directory= tmp; - fscanf(ff,"%s ",tmp); // NameManualFileList - fscanf(ff,"%s ",tmp); // xxxx - string namefilelist= tmp; - - _wxILPD->SetTypeOfReadFiles(typeOfReadFile); - _wxILPD->SetSubTypeOfReadFiles(subTypeOfReadFile); - _wxILPD->SetNameManualFileList(namefilelist); - _wxILPD->SetDirectoryManualFileList(directory); - - _wxILPD->RefreshManualListFile(true); - _noteBook->SetSelection(0); - } -} - -//---------------------------------------------------------------------------- - -string wxMaracasNoteBookPatientLstVoi::GetRWCM_namefileVOI() -{ - return _RWCM_namefileVOI; -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookPatientLstVoi::Persistence_Read_VOI() -{ - int voi[6]; - string name; - char tmp[255]; - _RWCM_namefileVOI = _wxreadwriteconf->GetNameReadFile(); - string directory = _wxreadwriteconf->GetWorkDirectory(); - string file=directory + "/" + _RWCM_namefileVOI; - if (_RWCM_namefileVOI!=""){ - FILE *ff; - ff=fopen(file.c_str(),"r"); - fscanf(ff,"%s ",tmp); // MaracasInfo - fscanf(ff,"%s ",tmp); // NameFileParent - fscanf(ff,"%s ",tmp); // xxxxxxxx - - fscanf(ff,"%s ",tmp); // voi_x - fscanf(ff,"%s ",tmp); // xMin - voi[0] = atoi(tmp); - fscanf(ff,"%s ",tmp); // xMax - voi[1] = atoi(tmp); - - fscanf(ff,"%s ",tmp); // voi_y - fscanf(ff,"%s ",tmp); // yMin - voi[2] = atoi(tmp); - fscanf(ff,"%s ",tmp); // yMax - voi[3] = atoi(tmp); - - fscanf(ff,"%s ",tmp); // voi_z - fscanf(ff,"%s ",tmp); // zMin - voi[4] = atoi(tmp); - fscanf(ff,"%s ",tmp); // zMax - voi[5] = atoi(tmp); - fclose(ff); - - _wxMaracasImageBrowser02->SetROI(voi); - _wxMaracasImageBrowser02->Refresh(); - - - } -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookPatientLstVoi::OnPersistence_Read(wxCommandEvent& event) -{ - if (_wxreadwriteconf!=NULL) - { - if (this->_noteBook->GetSelection()==0) // Read Configuration Images - { - Persistence_Read_Images(); - } - if (this->_noteBook->GetSelection()==1) // Read Configuration Images - { - Persistence_Read_VOI(); - } - } -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookPatientLstVoi::Persistence_Write_Images_ManualReadFileList() -{ - if (_wxreadwriteconf!=NULL) - { - _RWCM_namefileReadImages = _wxreadwriteconf->GetNameWriteFile(); - if (_RWCM_namefileReadImages!=""){ - string name,namedir; - _RWCM_namefileReadImages = _RWCM_namefileReadImages + ".MaracasInfo"; - namedir = _wxreadwriteconf->GetWorkDirectory(); - name = namedir + "/" + _RWCM_namefileReadImages ; - FILE *ff=fopen(name.c_str(),"w"); - fprintf(ff,"MaracasInfo \n"); - fprintf(ff,"NameFileParent %s \n",_wxreadwriteconf->GetParentFile().c_str() ); - - int typefile; - int subtypefile; - string directory; - string namefilelist; - - typefile = _wxILPD->GetTypeOfReadFiles(); - subtypefile = _wxILPD->GetSubTypeOfReadFiles(); - namefilelist = _wxILPD->GetNameManualFileList(); - directory = _wxILPD->GetDirectoryManualFileList(); - - if (namefilelist=="") - { - namefilelist=""; - } - if (directory=="") - { - directory=""; - } - - fprintf(ff,"TypeOfReadFiles %d\n", typefile ); - fprintf(ff,"SubTypeOfReadFiles %d\n", subtypefile ); - fprintf(ff,"DirectoryManualFileList %s\n", directory.c_str() ); - fprintf(ff,"NameManualFileList %s\n", namefilelist.c_str() ); - - fclose(ff); - } - } -} - - -void wxMaracasNoteBookPatientLstVoi::Persistence_Write_Images_Database() -{ - std::string nameDirectory = _wxreadwriteconf->GetWorkDirectory(); - std::string nameFile = _wxreadwriteconf->GetNameWriteFile(); - if (_wxreadwriteconf!=NULL) - { - // Create .maracas file (list of DICOM files) - std::string nameFileMaracas = nameDirectory+"/"+nameFile+".maracas"; - FILE *ff =fopen(nameFileMaracas.c_str(),"w+"); - fprintf(ff,"MaracasType 100\n"); - fprintf(ff,"Directory --\n"); - std::vector lst; - this->_wxILPD->GetLstImageFiles( &lst ); - int i,size=lst.size(); - for (i=0;ic_str()); - } - fclose(ff); - - // Creating .MaracasInfo - std::string nameFileMaracasInfo = nameDirectory+"/"+nameFile+".MaracasInfo"; - FILE *fileInfo =fopen(nameFileMaracasInfo.c_str(),"w+"); - fprintf(fileInfo,"MaracasInfo\n"); - fprintf(fileInfo,"NameFileParent NULL\n"); - fprintf(fileInfo,"TypeOfReadFiles 2\n"); - fprintf(fileInfo,"SubTypeOfReadFiles 100\n"); - fprintf(fileInfo,"DirectoryManualFileList %s\n",nameDirectory.c_str()); - fprintf(fileInfo,"NameManualFileList %s\n",nameFileMaracas.c_str()); - fclose(fileInfo); - - } -} - - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookPatientLstVoi::Persistence_Write_VOI() -{ - if (_wxreadwriteconf!=NULL) - { - string name,namedir; - _RWCM_namefileVOI = _wxreadwriteconf->GetNameWriteFile(); - if (_RWCM_namefileVOI!=""){ - _RWCM_namefileVOI = _RWCM_namefileVOI + ".MaracasInfo" ; - namedir = _wxreadwriteconf->GetWorkDirectory(); - name = namedir + "/" + _RWCM_namefileVOI ; - FILE *ff=fopen(name.c_str(),"w"); - fprintf(ff,"MaracasInfo \n"); - fprintf(ff,"NameFileParent %s \n",_wxreadwriteconf->GetParentFile().c_str() ); - - int voi[6]; - _wxMaracasImageBrowser02->GetROI(voi); - - fprintf(ff,"VOI_X %d %d\n", voi[0],voi[1] ); - fprintf(ff,"VOI_Y %d %d\n", voi[2],voi[3] ); - fprintf(ff,"VOI_Z %d %d\n", voi[4],voi[5] ); - fclose(ff); - } - } -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookPatientLstVoi::OnPersistence_Write(wxCommandEvent& event) -{ - if (_wxreadwriteconf!=NULL) - { - if (this->_noteBook->GetSelection()==0) // Write Configuration Images - { -// EED 09 nov 2007 - if (this->_wxILPD->GetNotebook()->GetSelection()==0) - { - Persistence_Write_Images_Database(); - } - if (this->_wxILPD->GetNotebook()->GetSelection()==1) - { - Persistence_Write_Images_Database(); - } - if (this->_wxILPD->GetNotebook()->GetSelection()==2) - { - Persistence_Write_Images_ManualReadFileList(); - } - } - if (this->_noteBook->GetSelection()==1) // Write ConfigurationImages - { - Persistence_Write_VOI(); - } - } -} - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxMaracasNoteBookIRMQuantification , wxPanel) -// Borrame -// EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit) -// EVT_MENU(MDI_REFRESH, MyChild::OnRefresh) -// EVT_MENU(MDI_CHANGE_TITLE, MyChild::OnChangeTitle) -// EVT_MENU(MDI_CHANGE_POSITION, MyChild::OnChangePosition) -// EVT_MENU(MDI_CHANGE_SIZE, MyChild::OnChangeSize) -// EVT_MENU(20001, wxMaracasNoteBookIRMQuantification::OnSelectPatientStudySerieImage) - -// EVT_SIZE(MyChild::OnSize) -// EVT_MOVE(MyChild::OnMove) - -// EVT_CLOSE(wxMaracasPatientLstVoiChiFra::OnClose) - EVT_TOOL(wxSurfaceWidget::ID_BUTTON_NEW_AXIS , wxMaracasNoteBookIRMQuantification::OnNewAxis ) - EVT_TOOL(wxSurfaceWidget::ID_BUTTON_DELETE_AXIS , wxMaracasNoteBookIRMQuantification::OnDeleteAxis ) - EVT_TOOL(ID_TOOLBAR_PLANS , wxMaracasNoteBookIRMQuantification::OnQuantification ) -END_EVENT_TABLE() - -wxMaracasNoteBookIRMQuantification::wxMaracasNoteBookIRMQuantification(wxWindow *parent,marInterface *mar) - : wxPanel(parent, -1) -{ -printf("EED wxMaracasNoteBookIRMQuantification::wxMaracasNoteBookIRMQuantification 1 \n"); - _existAxis = false; - _wxmaracasquantification = NULL; - - _noteBook = new wxNotebook(this, -1); - _noteBook->SetSize(750,300); - - wxBitmap mask= wxBITMAP( TOOLBAR_V2_sm_mask ); - - wxBitmap bitmap0 = wxBITMAP( TOOLBAR_V2_sm_bl_AxisExtraction ); - wxBitmap bitmap1 = wxBITMAP( TOOLBAR_V2_sm_bl_Quantification ); - wxBitmap bitmap2 = wxBITMAP( TOOLBAR_V2_sm_tr_Quantification ); - - bitmap0.SetMask(new wxMask( mask )); - bitmap1.SetMask(new wxMask( mask )); - bitmap2.SetMask(new wxMask( mask )); - - - wxImageList *imageList = new wxImageList(50,50); - imageList->Add( bitmap0 ); // 0 - imageList->Add( bitmap1 ); // 1 - imageList->Add( bitmap2 ); // 2 - _noteBook->SetImageList(imageList); - -printf("EED wxMaracasNoteBookIRMQuantification::wxMaracasNoteBookIRMQuantification 2 \n"); - -// _mar=mar -// _mar->initExperiment( ); - - _mar=new marInterface(); - _mar->_parameters->setRescaleSlope( mar->_parameters->getRescaleSlope() ); - _mar->_parameters->setRescaleIntercept( mar->_parameters->getRescaleIntercept() ); - _mar->_parameters->setIntParam( marParameters::e_voxel_type, marParameters::VOX_TYPE_MINIMUM ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_x_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_x_dimension) ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_y_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_y_dimension) ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_z_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_z_dimension) ); - int voi[6]; - mar->_experiment->getVOI( voi ); - _mar->_experiment->setVOI( voi ); - _mar->SetDicom(mar->_dicom); - _mar->initExperiment( ); - -printf("EED wxMaracasNoteBookIRMQuantification::wxMaracasNoteBookIRMQuantification 2.1 \n"); - _wxmaracas3dbrowser = new wxMaracas3DBrowser( _noteBook, _mar, -1,ID_TOOLBAR_PLANS ); -printf("EED wxMaracasNoteBookIRMQuantification::wxMaracasNoteBookIRMQuantification 2.2 \n"); - _wxmaracas3dbrowser->LoadData( ); - -// _wxmaracasquantification = new wxMaracasQuantification( _noteBook , _mar , -1 ); - - wxPanel *ttt = new wxPanel(_noteBook,-1); -// _wxmaracasquantification = new wxMaracasQuantification( ttt , _mar , -1 ); - - -printf("EED wxMaracasNoteBookIRMQuantification::wxMaracasNoteBookIRMQuantification 3 \n"); - - _noteBook->AddPage(_wxmaracas3dbrowser,_T("Axis Extraction IRM >> ") , true , 0 ); - _noteBook->AddPage(ttt,_T("Quantification IRM ") , true , 2 ); - - - _noteBook->SetSelection(0); - - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , (wxObjectEventFunction) &wxMaracasNoteBookIRMQuantification::OnChangePageQuantification ); - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , (wxObjectEventFunction) &wxMaracasNoteBookIRMQuantification::OnChangePage ); - - - wxStaticText *title=new wxStaticText(this,-1,_T("IRM Quantification")); - -// It doesn't works in linux -// wxFont font(18,wxDEFAULT , wxITALIC, wxBOLD); -// title->SetFont(font); - - wxBoxSizer *sizer= new wxBoxSizer(wxVERTICAL); - sizer->Add( title , 0, wxEXPAND | wxALIGN_RIGHT, 10); - sizer->Add( _noteBook , 1, wxGROW, 10 ); - - sizer->SetSizeHints( this ); // set size hints to honour minimum size - this->SetAutoLayout(true); - this->SetSizer(sizer); - this->Layout(); - -//EEDxx2.4 -// FitInside(); -printf("EED wxMaracasNoteBookIRMQuantification::wxMaracasNoteBookIRMQuantification 4 \n"); - -} -//---------------------------------------------------------------------------- -wxMaracasNoteBookIRMQuantification::~wxMaracasNoteBookIRMQuantification() -{ -//EEDx15 -// delete _wxmaracas3dbrowser; -// delete _wxmaracasquantification; -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookIRMQuantification::OnQuantification(wxCommandEvent & event) -{ - _noteBook->SetSelection(1); -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookIRMQuantification::OnChangePage(wxNotebookEvent& event) -{ - if (_noteBook->GetSelection()==1){ - if (_wxmaracasquantification!=NULL) - { -//EEDx12 - delete _wxmaracasquantification; -// _wxmaracasquantification->Close(); - } - _wxmaracasquantification = new wxMaracasQuantification( _noteBook->GetPage(1) , _mar , -1 ); - _wxmaracasquantification->LoadData( ); - wxBoxSizer *sizer= new wxBoxSizer(wxHORIZONTAL); - sizer->Add( _wxmaracasquantification , 1, wxALL|wxEXPAND, 0); - _noteBook->GetPage(1)->SetAutoLayout(true); - _noteBook->GetPage(1)->SetSizer(sizer); - _noteBook->GetPage(1)->Layout(); - } -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookIRMQuantification::OnChangePageQuantification(wxNotebookEvent& event) -{ - if (_noteBook->GetSelection()==0){ - if (_existAxis == false ) - { - wxMessageDialog msg(this, _T("You have to extract the axis befor run this option.."), _T("Message box"), wxOK ); - msg.ShowModal(); - event.Veto(); - } - } - Refresh(); -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookIRMQuantification::OnNewAxis(wxCommandEvent &WXUNUSED(event)) -{ - _existAxis=true; - _noteBook->SetPageImage(1, 1); -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookIRMQuantification::OnDeleteAxis(wxCommandEvent &WXUNUSED(event)) -{ - _existAxis=false; - _noteBook->SetPageImage(1, 2); -} - - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxMaracasNoteBookCTQuantification , wxPanel) -// Borrame -// EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit) -// EVT_MENU(MDI_REFRESH, MyChild::OnRefresh) -// EVT_MENU(MDI_CHANGE_TITLE, MyChild::OnChangeTitle) -// EVT_MENU(MDI_CHANGE_POSITION, MyChild::OnChangePosition) -// EVT_MENU(MDI_CHANGE_SIZE, MyChild::OnChangeSize) -// EVT_MENU(20001, wxMaracasNoteBookIRMQuantification::OnSelectPatientStudySerieImage) - -// EVT_SIZE(MyChild::OnSize) -// EVT_MOVE(MyChild::OnMove) - -// EVT_CLOSE(wxMaracasPatientLstVoiChiFra::OnClose) -// EVT_TOOL(wxSurfaceWidget::ID_BUTTON_NEW_AXIS, wxMaracasNoteBookIRMQuantification::OnNewAxis ) -// EVT_TOOL(wxSurfaceWidget::ID_BUTTON_DELETE_AXIS,wxMaracasNoteBookIRMQuantification::OnDeleteAxis ) - EVT_TOOL(20005,wxMaracasNoteBookCTQuantification::OnQuantification) - - EVT_MENU(30001, wxMaracasNoteBookCTQuantification::OnPersistence_Write) - EVT_MENU(30002, wxMaracasNoteBookCTQuantification::OnPersistence_Read) - - -END_EVENT_TABLE() - - -wxMaracasNoteBookCTQuantification::wxMaracasNoteBookCTQuantification(wxWindow *parent, - marInterface *mar, - string namefileParentRWCM) - : wxPanel(parent, -1) -{ -printf(" EED wxMaracasNoteBookCTQuantification::wxMaracasNoteBookCTQuantification 01\n "); - _namefileParentRWCM = namefileParentRWCM; - _readyQuantification=false; - _wxMaracasProcessingCT=NULL; - _wxmaracasquantification_ct=NULL; - - _noteBook = new wxNotebook(this, -1); -// _noteBook->SetSize(550,300); - - wxBitmap mask= wxBITMAP( TOOLBAR_V2_sm_mask ); - - wxBitmap bitmap0 = wxBITMAP( TOOLBAR_V2_sm_bl_MPR ); - wxBitmap bitmap1 = wxBITMAP( TOOLBAR_V2_sm_bl_ProcessingCT ); - wxBitmap bitmap2 = wxBITMAP( TOOLBAR_V2_sm_bl_Quantification ); - wxBitmap bitmap3 = wxBITMAP( TOOLBAR_V2_sm_tr_Quantification ); - - bitmap0.SetMask(new wxMask( mask )); - bitmap1.SetMask(new wxMask( mask )); - bitmap2.SetMask(new wxMask( mask )); - bitmap3.SetMask(new wxMask( mask )); - - wxImageList *imageList = new wxImageList(50,50); - imageList->Add( bitmap0 ); // 0 - imageList->Add( bitmap1 ); // 1 - imageList->Add( bitmap2 ); // 2 - imageList->Add( bitmap3 ); // 3 - _noteBook->SetImageList(imageList); - - - double spcOriginalImage[3]; - spcOriginalImage[0]=mar->_parameters->getDoubleParam(marParameters::e_voxel_x_dimension); - spcOriginalImage[1]=mar->_parameters->getDoubleParam(marParameters::e_voxel_y_dimension); - spcOriginalImage[2]=mar->_parameters->getDoubleParam(marParameters::e_voxel_z_dimension); - - -// _mar=mar; - _mar=new marInterfaceCT(); - - _mar->_parameters->setRescaleSlope( mar->_parameters->getRescaleSlope() ); - _mar->_parameters->setRescaleIntercept( mar->_parameters->getRescaleIntercept() ); - _mar->_parameters->setIntParam( marParameters::e_voxel_type, marParameters::VOX_TYPE_MINIMUM ); - - - _mar->_parameters->setDoubleParam( marParameters::e_voxel_x_dimension, spcOriginalImage[0] ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_y_dimension, spcOriginalImage[1] ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_z_dimension, spcOriginalImage[2] ); -//EEDx4 - - int voi[6]; - mar->_experiment->getVOI( voi ); - _mar->setVOI( voi ); - _mar->SetDicom(mar->_dicom); - - _mar->initExperiment( ); - - vtkImageData *imagedata; - imagedata = _mar->GetExperiment()->getDynData( )->getVolume( )->castVtk(); - imagedata->Update(); - marImageData *marimagedata = new marImageData(imagedata); - marimagedata->SetSpcOriginal(spcOriginalImage); - marimagedata->SetVoiOriginal(voi); - - _wxMaracasMPR = new wxMaracasMPR( _noteBook, marimagedata ,_mar->_parameters->getVoxelSize() ); - _wxMaracasMPR->ConfigureVTK(); - - _noteBook->AddPage(_wxMaracasMPR,_T("Choose a position >> "), true, 0 ); - - _noteBook->AddPage(new wxPanel(_noteBook,-1),_T("Processing CT >> "), true, 1 ); - _noteBook->AddPage(new wxPanel(_noteBook,-1),_T("Quantification CT "), true, 3 ); - _noteBook->SetSelection(0); - - - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , (wxObjectEventFunction) &wxMaracasNoteBookCTQuantification::OnChangePageQuantification ); - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , (wxObjectEventFunction) &wxMaracasNoteBookCTQuantification::OnChangePage ); - - wxButton *btnReadWriteConfig = new wxButton(this,-1,_T("Read-Write Config")); - Connect(btnReadWriteConfig->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxMaracasNoteBookCTQuantification::OnReadWriteConf_Maracas ); - wxButton *btnHelp = new wxButton(this,-1,_T("Help")); - wxButton *btnClose = new wxButton(this,-1,_T("Close")); - - wxBoxSizer *sizerB = new wxBoxSizer(wxHORIZONTAL); - sizerB->Add( btnReadWriteConfig , 0, wxALIGN_RIGHT, 10); - sizerB->Add( btnHelp , 0, wxALIGN_RIGHT, 10); - sizerB->Add( btnClose , 0, wxALIGN_RIGHT, 10); - - - - - - wxStaticText *title=new wxStaticText(this,-1,_T("CT Quantification")); - -// It doesn't works in linux -// wxFont font(18,wxDEFAULT , wxITALIC, wxBOLD); -// title->SetFont(font); - - wxBoxSizer *sizer= new wxBoxSizer(wxVERTICAL); - sizer->Add( sizerB , 0, wxALIGN_RIGHT, 10); - sizer->Add( title , 0, wxGROW | wxALIGN_RIGHT, 10); - sizer->Add( _noteBook , 1, wxALL | wxGROW, 10 ); - -//EEDxx2.4 -// FitInside(); - -// sizer->SetSizeHints( this ); // set size hints to honour minimum size - this->SetSizer(sizer); - this->SetAutoLayout(true); - this->Layout(); -// EED 29 Juin 2007 -/* -*/ -printf(" EED wxMaracasNoteBookCTQuantification::wxMaracasNoteBookCTQuantification 02\n "); -} - -//---------------------------------------------------------------------------- - -wxMaracasNoteBookCTQuantification::~wxMaracasNoteBookCTQuantification() -{ -} - - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookCTQuantification::OnChangePage(wxNotebookEvent& event) -{ - if (_noteBook->GetSelection()==1){ - wxBusyCursor wait; - if (_wxMaracasProcessingCT!=NULL) - { - delete _wxMaracasProcessingCT; - } - vtkMPRBaseData *vtkmprbaseData = _wxMaracasMPR->GetVtkMPRBaseData(); - marImageData *marimagedata = vtkmprbaseData->GetMarImageData(); - // _mar->initExperiment( ); - int x = (int)vtkmprbaseData->GetX(); - int y = (int)vtkmprbaseData->GetY(); - int z = (int)vtkmprbaseData->GetZ(); -printf("EED wxMaracasNoteBookCTQuantification::OnChangePage \n "); - _wxMaracasProcessingCT = new wxMaracasProcessingCT(_noteBook->GetPage(1), _mar); - _wxMaracasProcessingCT->ConfigureVTK(marimagedata, x , y , z ); - wxBoxSizer *sizer= new wxBoxSizer(wxHORIZONTAL); - sizer->Add( _wxMaracasProcessingCT , 1, wxALL|wxGROW, 0); - _noteBook->GetPage(1)->SetAutoLayout(true); - _noteBook->GetPage(1)->SetSizer(sizer); - _noteBook->GetPage(1)->Layout(); - } - if (_noteBook->GetSelection()==2) { - if (_readyQuantification==true) - { - if (_wxmaracasquantification_ct!=NULL) - { - delete _wxmaracasquantification_ct; - } - _wxmaracasquantification_ct = new wxMaracasQuantificationCT(_noteBook->GetPage(2), _mar, -1 ); - _wxmaracasquantification_ct->LoadData( ); - wxBoxSizer *sizer= new wxBoxSizer(wxHORIZONTAL); - sizer->Add( _wxmaracasquantification_ct , 1, wxALL|wxGROW, 0); - _noteBook->GetPage(2)->SetAutoLayout(true); - _noteBook->GetPage(2)->SetSizer(sizer); - _noteBook->GetPage(2)->Layout(); - } else { - wxMessageDialog msg(this, _T("You have to extract the axis befor run this option.."), _T("Message box"), wxOK ); - msg.ShowModal(); - } - } - - if ((_noteBook->GetSelection()==0) || (_noteBook->GetSelection()==1) ) { - _readyQuantification=false; - _noteBook->SetPageImage(2, 3); - } - - Refresh(); -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookCTQuantification::OnChangePageQuantification(wxNotebookEvent& event) -{ -/* - if (event.GetSelection()==1) { - if (_readyQuantification==false) - { - wxMessageDialog msg(this, "You have to extract the axis befor run this option..", "Message box", wxOK ); - msg.ShowModal(); - event.Veto(); - } - } -*/ -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookCTQuantification::OnQuantification(wxCommandEvent& event) -{ - _readyQuantification=true; - _noteBook->SetPageImage(2, 2); -} - -//---------------------------------------------------------------------------- - -void wxMaracasNoteBookCTQuantification::OnReadWriteConf_Maracas(wxCommandEvent& event) -{ - string parentFile; - if (this->_noteBook->GetSelection()==0) // Read 3D Point MPR - { - parentFile=_namefileParentRWCM; - } - if (this->_noteBook->GetSelection()==1) // Read Preprocessing - { - parentFile=_RWCM_namefileMPR; - } - if (this->_noteBook->GetSelection()==2) // Read Contour Quantification - { - parentFile=_RWCM_namefileProcessingCT; - } - - - if (parentFile!="") - { - _wxreadwriteconf = new wxReadWriteConf(this,parentFile); - _wxreadwriteconf->ShowModal(); - _wxreadwriteconf=NULL; - } else { - wxMessageDialog(this,_T("No parent file defined..."),_T("Warning.."), wxOK).ShowModal(); - } - -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookCTQuantification::Persistence_Read_MPR() -{ - _RWCM_namefileMPR = _wxreadwriteconf->GetNameReadFile(); - if (_RWCM_namefileMPR!=""){ - double x,y,z; - string name; - char tmp[255]; - string directory = _wxreadwriteconf->GetWorkDirectory(); - string file=directory + "/" + _RWCM_namefileMPR; - FILE *ff; - ff=fopen(file.c_str(),"r"); - fscanf(ff,"%s ",tmp); // MaracasInfo - fscanf(ff,"%s ",tmp); // NameFileParent - fscanf(ff,"%s ",tmp); // xxxxxxxx - - fscanf(ff,"%s ",tmp); // positionX - fscanf(ff,"%s ",tmp); // x - x = atof(tmp); - - fscanf(ff,"%s ",tmp); // positionY - fscanf(ff,"%s ",tmp); // y - y = atof(tmp); - - fscanf(ff,"%s ",tmp); // positionZ - fscanf(ff,"%s ",tmp); // z - z = atof(tmp); - - fclose(ff); - - _wxMaracasMPR->GetVtkMPRBaseData()->SetX(x); - _wxMaracasMPR->GetVtkMPRBaseData()->SetY(y); - _wxMaracasMPR->GetVtkMPRBaseData()->SetZ(z); - _wxMaracasMPR->RefreshView(); - } - -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookCTQuantification::Persistence_Read_ProcessingCT() -{ - _RWCM_namefileProcessingCT = _wxreadwriteconf->GetNameReadFile(); - if (_RWCM_namefileProcessingCT!=""){ - int min,max; - string name; - char tmp[255]; - string directory = _wxreadwriteconf->GetWorkDirectory(); - string file=directory + "/" + _RWCM_namefileProcessingCT; - FILE *ff; - ff=fopen(file.c_str(),"r"); - fscanf(ff,"%s ",tmp); // MaracasInfo - fscanf(ff,"%s ",tmp); // NameFileParent - fscanf(ff,"%s ",tmp); // xxxxxxxx - - fscanf(ff,"%s ",tmp); // Threshold_min - fscanf(ff,"%s ",tmp); // min - min = atoi(tmp); - - fscanf(ff,"%s ",tmp); // Threshold_max - fscanf(ff,"%s ",tmp); // max - max = atoi(tmp); - - _wxMaracasProcessingCT->SetThreshold(min,max); - _wxMaracasProcessingCT->Refresh(); - - fclose(ff); - - } - -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookCTQuantification::Persistence_Read_ContourQauntificationCT() -{ - _RWCM_namefileContourQuantificationCT = _wxreadwriteconf->GetNameReadFile(); - if (_RWCM_namefileContourQuantificationCT!=""){ - string name; - char tmp[255]; - string directory = _wxreadwriteconf->GetWorkDirectory(); - string file=directory + "/" + _RWCM_namefileContourQuantificationCT; - FILE *ff; - ff=fopen(file.c_str(),"r"); - fscanf(ff,"%s ",tmp); // MaracasInfo - fscanf(ff,"%s ",tmp); // NameFileParent - fscanf(ff,"%s ",tmp); // xxxxxxxx - - - // Read Data - // Set Data - fscanf(ff,"%s ",tmp); // Slice - fscanf(ff,"%s ",tmp); // xxxxxxxx - int slice = atoi(tmp); - this->_wxmaracasquantification_ct->SetActualSlice(slice); - // Refresh - - fclose(ff); - - } -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookCTQuantification::OnPersistence_Read(wxCommandEvent& event) -{ - if (this->_noteBook->GetSelection()==0) // Read 3D Point MPR - { - Persistence_Read_MPR(); - } - if (this->_noteBook->GetSelection()==1) // Read Preprocessing - { - Persistence_Read_ProcessingCT(); - } - if (this->_noteBook->GetSelection()==2) // Read Contour quantification - { - Persistence_Read_ContourQauntificationCT(); - } -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookCTQuantification::Persistence_Write_MPR() -{ - - if (_wxreadwriteconf!=NULL) - { - _RWCM_namefileMPR = _wxreadwriteconf->GetNameWriteFile(); - if (_RWCM_namefileMPR!=""){ - string name,namedir; - _RWCM_namefileMPR =_RWCM_namefileMPR + ".MaracasInfo"; - namedir = _wxreadwriteconf->GetWorkDirectory(); - name = namedir + "/" + _RWCM_namefileMPR ; - FILE *ff=fopen(name.c_str(),"w"); - fprintf(ff,"MaracasInfo \n"); - fprintf(ff,"NameFileParent %s \n",_wxreadwriteconf->GetParentFile().c_str() ); - - - double x = _wxMaracasMPR->GetVtkMPRBaseData()->GetX(); - double y = _wxMaracasMPR->GetVtkMPRBaseData()->GetY(); - double z = _wxMaracasMPR->GetVtkMPRBaseData()->GetZ(); - - fprintf(ff,"positionX %f\n", x); - fprintf(ff,"positionY %f\n", y); - fprintf(ff,"positionZ %f\n", z); - fclose(ff); - } - } - - - -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookCTQuantification::Persistence_Write_ProcessingCT() -{ - if (_wxreadwriteconf!=NULL) - { - _RWCM_namefileProcessingCT = _wxreadwriteconf->GetNameWriteFile(); - if (_RWCM_namefileProcessingCT!=""){ - string name,namedir; - _RWCM_namefileProcessingCT = _RWCM_namefileProcessingCT + ".MaracasInfo"; - namedir = _wxreadwriteconf->GetWorkDirectory(); - name = namedir + "/" + _RWCM_namefileProcessingCT ; - FILE *ff=fopen(name.c_str(),"w"); - fprintf(ff,"MaracasInfo \n"); - fprintf(ff,"NameFileParent %s \n",_wxreadwriteconf->GetParentFile().c_str() ); - - int min,max; - _wxMaracasProcessingCT->GetThreshold(&min,&max); - - fprintf(ff,"Threshold_Min %d\n", min); - fprintf(ff,"Threshold_Max %d\n", max); - - fclose(ff); - } - } - -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookCTQuantification::Persistence_Write_ContourQuantificationCT() -{ - if (_wxreadwriteconf!=NULL) - { - _RWCM_namefileContourQuantificationCT = _wxreadwriteconf->GetNameWriteFile(); - if (_RWCM_namefileContourQuantificationCT!=""){ - string name,namedir; - _RWCM_namefileContourQuantificationCT = _RWCM_namefileContourQuantificationCT + ".MaracasInfo"; - namedir = _wxreadwriteconf->GetWorkDirectory(); - name = namedir + "/" + _RWCM_namefileContourQuantificationCT ; - FILE *ff=fopen(name.c_str(),"w"); - fprintf(ff,"MaracasInfo \n"); - fprintf(ff,"NameFileParent %s \n",_wxreadwriteconf->GetParentFile().c_str() ); - - // Get Data information - // Write Data - fprintf(ff,"Slice %d\n", this->_wxmaracasquantification_ct->GetActualSlice() ); - - fclose(ff); - } - } - -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookCTQuantification::OnPersistence_Write(wxCommandEvent& event) -{ - if (this->_noteBook->GetSelection()==0) // Write 3D Point MPR - { - Persistence_Write_MPR(); - } - if (this->_noteBook->GetSelection()==1) // Write Preprocessing - { - Persistence_Write_ProcessingCT(); - } - if (this->_noteBook->GetSelection()==2) // Write Contour Quantification - { - Persistence_Write_ContourQuantificationCT(); - } -} - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxMaracasNoteBookVascularTreeExtraction , wxPanel) -// Borrame -// EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit) -// EVT_MENU(MDI_REFRESH, MyChild::OnRefresh) -// EVT_MENU(MDI_CHANGE_TITLE, MyChild::OnChangeTitle) -// EVT_MENU(MDI_CHANGE_POSITION, MyChild::OnChangePosition) -// EVT_MENU(MDI_CHANGE_SIZE, MyChild::OnChangeSize) -// EVT_MENU(20001, wxMaracasNoteBookIRMQuantification::OnSelectPatientStudySerieImage) - -// EVT_SIZE(MyChild::OnSize) -// EVT_MOVE(MyChild::OnMove) - -// EVT_CLOSE(wxMaracasPatientLstVoiChiFra::OnClose) -// EVT_TOOL(wxSurfaceWidget::ID_BUTTON_NEW_AXIS, wxMaracasNoteBookIRMQuantification::OnNewAxis ) -// EVT_TOOL(wxSurfaceWidget::ID_BUTTON_DELETE_AXIS,wxMaracasNoteBookIRMQuantification::OnDeleteAxis ) -// EVT_TOOL(20005,wxMaracasNoteBookVascularTreeExtraction::OnQuantification) - -END_EVENT_TABLE() - - -wxMaracasNoteBookVascularTreeExtraction::wxMaracasNoteBookVascularTreeExtraction(wxWindow *parent,marInterface *mar) - : wxPanel(parent, -1) -{ - - _noteBook = new wxNotebook(this, -1); - _noteBook->SetSize(550,300); - - wxBitmap mask= wxBITMAP( TOOLBAR_V2_sm_mask ); - wxBitmap bitmap0 = wxBITMAP( TOOLBAR_V2_sm_bl_TreeExtraction_JF_MH ); - bitmap0.SetMask(new wxMask( mask )); - - - wxImageList *imageList = new wxImageList(50,50); - imageList->Add( bitmap0 ); // 0 - _noteBook->SetImageList(imageList); - -// _mar=mar; - - _mar=new marInterface(); - _mar->_parameters->setRescaleSlope( mar->_parameters->getRescaleSlope() ); - _mar->_parameters->setRescaleIntercept( mar->_parameters->getRescaleIntercept() ); - _mar->_parameters->setIntParam( marParameters::e_voxel_type, marParameters::VOX_TYPE_MINIMUM ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_x_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_x_dimension) ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_y_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_y_dimension) ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_z_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_z_dimension) ); - - int voi[6]; - mar->_experiment->getVOI( voi ); - _mar->_experiment->setVOI( voi ); - _mar->SetDicom(mar->_dicom); - - _mar->initExperiment( ); - - vtkImageData *marImageData; - marImageData = _mar->_experiment->getDynData( )->getVolume( )->castVtk(); - marImageData->Update(); - - _wxMaracasEmptyPanel_2 = new wxMaracasEmptyPanel_2(_noteBook,_mar); - _wxMaracasEmptyPanel_2->ConfigureVTK(); - - - _wxMaracasPathology_01 = new wxMaracasPathology_01(_noteBook,_mar); - _wxMaracasPathology_01->ConfigureVTK(); - - - _noteBook->AddPage(_wxMaracasEmptyPanel_2,_T("Tree Extraction "), true, 0 ); - _noteBook->AddPage(_wxMaracasPathology_01,_T("Pathology "), true, 0 ); - _noteBook->SetSelection(0); - - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , (wxObjectEventFunction) &wxMaracasNoteBookVascularTreeExtraction::OnChangePageQuantification ); - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , (wxObjectEventFunction) &wxMaracasNoteBookVascularTreeExtraction::OnChangePage ); - - wxStaticText *title=new wxStaticText(this,-1,_T("Vascular Tree Extraction")); - -// It doesn't works in linux -// wxFont font(18,wxDEFAULT , wxITALIC, wxBOLD); -// title->SetFont(font); - - wxBoxSizer *sizer= new wxBoxSizer(wxVERTICAL); - sizer->Add( title , 0, wxEXPAND | wxALIGN_RIGHT, 10); - sizer->Add( _noteBook , 1, wxGROW, 10 ); - -//EEDxx2.4 -// FitInside(); - - sizer->SetSizeHints( this ); // set size hints to honour minimum size - this->SetSizer(sizer); - this->SetAutoLayout(true); - this->Layout(); - -} -//---------------------------------------------------------------------------- -wxMaracasNoteBookVascularTreeExtraction::~wxMaracasNoteBookVascularTreeExtraction() -{ -} - - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookVascularTreeExtraction::OnChangePage(wxNotebookEvent& event) -{ - Refresh(); -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookVascularTreeExtraction::OnChangePageQuantification(wxNotebookEvent& event) -{ -} - - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxMaracasNoteBookSTLFormat , wxPanel) -// Borrame -// EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit) -// EVT_MENU(MDI_REFRESH, MyChild::OnRefresh) -// EVT_MENU(MDI_CHANGE_TITLE, MyChild::OnChangeTitle) -// EVT_MENU(MDI_CHANGE_POSITION, MyChild::OnChangePosition) -// EVT_MENU(MDI_CHANGE_SIZE, MyChild::OnChangeSize) -// EVT_MENU(20001, wxMaracasNoteBookIRMQuantification::OnSelectPatientStudySerieImage) - -// EVT_SIZE(MyChild::OnSize) -// EVT_MOVE(MyChild::OnMove) - -// EVT_CLOSE(wxMaracasPatientLstVoiChiFra::OnClose) - EVT_TOOL(wxSurfaceWidget::ID_BUTTON_NEW_AXIS, wxMaracasNoteBookSTLFormat::OnNewAxis ) - EVT_TOOL(wxSurfaceWidget::ID_BUTTON_DELETE_AXIS,wxMaracasNoteBookSTLFormat::OnDeleteAxis ) -// EVT_TOOL(20005,wxMaracasNoteBookVascularTreeExtraction::OnQuantification) - - - -END_EVENT_TABLE() - - -wxMaracasNoteBookSTLFormat::wxMaracasNoteBookSTLFormat(wxWindow *parent,marInterface *mar) - : wxPanel(parent, -1) -{ -printf("EED wxMaracasNoteBookSTLFormat::wxMaracasNoteBookSTLFormat 01 \n"); - _noteBook_general = new wxNotebook(this, -1); - _noteBook_general->SetSize(550,300); - wxImageList *imageList = new wxImageList(50,50); - - wxBitmap mask= wxBITMAP( TOOLBAR_V2_sm_mask ); - - wxBitmap bitmap0 = wxBITMAP( TOOLBAR_V2_sm_bl_STLFormat ); - bitmap0.SetMask(new wxMask( mask )); - - - imageList->Add( bitmap0 ); // 0 - _noteBook_general->SetImageList(imageList); - -// wxPanel *panel01 = CreateSTLFormat_01( _noteBook_general , mar ); -// wxPanel *panel02 = CreateSTLFormat_02( _noteBook_general , mar ); - wxPanel *panel03 = CreateSTLFormat_03( _noteBook_general , mar ); - -// _noteBook_general->AddPage( panel01 , _T("STL Format 01 "), true, 0 ); -// _noteBook_general->AddPage( panel02 , _T("STL Format 02 " ), true, 0 ); - _noteBook_general->AddPage( panel03 , _T("STL Format 03 ") , true, 0 ); - _noteBook_general->SetSelection(0); - - - wxStaticText *title=new wxStaticText(this,-1,_T("STL Format")); - -// It doesn't works in linux -// wxFont font(18,wxDEFAULT , wxITALIC, wxBOLD); -// title->SetFont(font); - - wxBoxSizer *sizer= new wxBoxSizer(wxVERTICAL); - sizer->Add( title , 0, wxEXPAND | wxALIGN_RIGHT, 10); - sizer->Add( _noteBook_general , 1, wxGROW, 10 ); - -//EEDxx2.4 -// FitInside(); - - sizer->SetSizeHints( this ); // set size hints to honour minimum size - this->SetSizer(sizer); - this->SetAutoLayout(true); - this->Layout(); -printf("EED wxMaracasNoteBookSTLFormat::wxMaracasNoteBookSTLFormat 02 \n"); -} - - -//---------------------------------------------------------------------------- - -wxMaracasNoteBookSTLFormat::~wxMaracasNoteBookSTLFormat() -{ -} - - -//---------------------------------------------------------------------------- - -wxPanel *wxMaracasNoteBookSTLFormat::CreateSTLFormat_01(wxWindow *parent,marInterface *mar) -{ - - wxSTLWidget_02 *stlWidget = new wxSTLWidget_02(parent,mar); - stlWidget->ConfigureVTK(); - - return stlWidget; -} - - -//---------------------------------------------------------------------------- - -wxPanel *wxMaracasNoteBookSTLFormat::CreateSTLFormat_02(wxWindow *parent,marInterface *mar) -{ - wxPanel *panel = new wxPanel(parent,-1); - - _existAxis=false; - _wxmaracassurfaceSTLwidget=NULL; - - _noteBook_01 = new wxNotebook(panel, -1); - _noteBook_01->SetSize(550,300); - - wxImageList *imageList = new wxImageList(50,50); - imageList->Add( wxBITMAP( TOOLBAR_V2_sm_bl_AxisExtraction ) ); // 0 - imageList->Add( wxBITMAP( TOOLBAR_V2_sm_bl_STLFormat ) ); // 1 - imageList->Add( wxBITMAP( TOOLBAR_V2_sm_tr_STLFormat ) ); // 2 - _noteBook_01->SetImageList(imageList); - -// _mar=mar; - - _mar=new marInterface(); - _mar->_parameters->setRescaleSlope( mar->_parameters->getRescaleSlope() ); - _mar->_parameters->setRescaleIntercept( mar->_parameters->getRescaleIntercept() ); - _mar->_parameters->setIntParam( marParameters::e_voxel_type, marParameters::VOX_TYPE_MINIMUM ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_x_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_x_dimension) ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_y_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_y_dimension) ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_z_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_z_dimension) ); - int voi[6]; - mar->_experiment->getVOI( voi ); - _mar->_experiment->setVOI( voi ); - _mar->SetDicom(mar->_dicom); - - _mar->initExperiment( ); - - vtkImageData *marImageData; - marImageData = _mar->_experiment->getDynData( )->getVolume( )->castVtk(); - marImageData->Update(); - - _wxmaracas3dbrowser = new wxMaracas3DBrowser( _noteBook_01, _mar, -1,ID_TOOLBAR_PLANS ); - _wxmaracas3dbrowser->LoadData( ); - - _noteBook_01->AddPage(_wxmaracas3dbrowser,_T("Axis Extraction >> "), true, 0 ); - _noteBook_01->AddPage(new wxPanel(_noteBook_01,-1),_T("STL"), true, 2 ); - _noteBook_01->SetSelection(0); - - Connect(_noteBook_01->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , (wxObjectEventFunction) &wxMaracasNoteBookSTLFormat::OnChangePageSTLFormat ); - Connect(_noteBook_01->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , (wxObjectEventFunction) &wxMaracasNoteBookSTLFormat::OnChangePage ); - - wxStaticText *title=new wxStaticText(panel,-1,_T(" STL - 01 (MATHIEU) ")); - -// It doesn't works in linux -// wxFont font(18,wxDEFAULT , wxITALIC, wxBOLD); -// title->SetFont(font); - - wxBoxSizer *sizer= new wxBoxSizer(wxVERTICAL); - sizer->Add( title , 0, wxEXPAND | wxALIGN_RIGHT, 10); - sizer->Add( _noteBook_01 , 1, wxGROW , 10 ); - -//EEDxx2.4 -// FitInside(); - - sizer->SetSizeHints( panel ); // set size hints to honour minimum size - panel->SetSizer(sizer); - panel->SetAutoLayout(true); - panel->Layout(); - - return panel; -} - -//---------------------------------------------------------------------------- - -wxPanel *wxMaracasNoteBookSTLFormat::CreateSTLFormat_03(wxWindow *parent,marInterface *mar) -{ - - wxSTLWidget_03 *stlWidget = new wxSTLWidget_03(parent,mar); - stlWidget->ConfigureVTK(); - - return stlWidget; -} - - -//---------------------------------------------------------------------------- - -void wxMaracasNoteBookSTLFormat::OnChangePage(wxNotebookEvent& event) -{ - if (_noteBook_01->GetSelection()==1){ - if (_wxmaracassurfaceSTLwidget!=NULL) - { - delete _wxmaracassurfaceSTLwidget; - } - _wxmaracassurfaceSTLwidget = new wxSurfaceSTLWidget( _noteBook_01->GetPage(1) ); - _wxmaracassurfaceSTLwidget->ShowMARACASData( _mar ); - wxBoxSizer *sizer= new wxBoxSizer(wxHORIZONTAL); - sizer->Add( _wxmaracassurfaceSTLwidget , 1, wxALL|wxEXPAND, 0); - _noteBook_01->GetPage(1)->SetAutoLayout(true); - _noteBook_01->GetPage(1)->SetSizer(sizer); - _noteBook_01->GetPage(1)->Layout(); - } - Refresh(); -} - -//---------------------------------------------------------------------------- - -void wxMaracasNoteBookSTLFormat::OnChangePageSTLFormat(wxNotebookEvent& event) -{ - if (_noteBook_01->GetSelection()==0){ - if (_existAxis == false ) - { - wxMessageDialog msg(this, _T("You have to extract the axis befor run this option.."), _T("Message box"), wxOK ); - msg.ShowModal(); - event.Veto(); - } - } - Refresh(); -} - -//---------------------------------------------------------------------------- - -void wxMaracasNoteBookSTLFormat::OnNewAxis(wxCommandEvent &WXUNUSED(event)) -{ - _existAxis=true; - _noteBook_01->SetPageImage(1, 1); -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookSTLFormat::OnDeleteAxis(wxCommandEvent &WXUNUSED(event)) -{ - _existAxis=false; - _noteBook_01->SetPageImage(1, 2); -} - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxMaracasNoteBookTests , wxPanel) -// Borrame -// EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit) -// EVT_MENU(MDI_REFRESH, MyChild::OnRefresh) -// EVT_MENU(MDI_CHANGE_TITLE, MyChild::OnChangeTitle) -// EVT_MENU(MDI_CHANGE_POSITION, MyChild::OnChangePosition) -// EVT_MENU(MDI_CHANGE_SIZE, MyChild::OnChangeSize) -// EVT_MENU(20001, wxMaracasNoteBookIRMQuantification::OnSelectPatientStudySerieImage) - -// EVT_SIZE(MyChild::OnSize) -// EVT_MOVE(MyChild::OnMove) - -// EVT_CLOSE(wxMaracasPatientLstVoiChiFra::OnClose) -// EVT_TOOL(wxSurfaceWidget::ID_BUTTON_NEW_AXIS, wxMaracasNoteBookTests::OnNewAxis ) -// EVT_TOOL(wxSurfaceWidget::ID_BUTTON_DELETE_AXIS,wxMaracasNoteBookTests::OnDeleteAxis ) -// EVT_TOOL(20005,wxMaracasNoteBookVascularTreeExtraction::OnQuantification) - - - -END_EVENT_TABLE() - - -wxMaracasNoteBookTests::wxMaracasNoteBookTests(wxWindow *parent,marInterface *mar) - : wxPanel(parent, -1) -{ - wxBusyCursor wait; - - _noteBook = new wxNotebook(this, -1); - _noteBook->SetSize(550,300); - - - wxBitmap mask= wxBITMAP( TOOLBAR_V2_sm_mask ); - - wxBitmap bitmap0 = wxBITMAP( TOOLBAR_V2_sm_bl_Processing ); - wxBitmap bitmap1 = wxBITMAP( TOOLBAR_V2_sm_bl_Processing ); - - bitmap0.SetMask(new wxMask( mask )); - bitmap1.SetMask(new wxMask( mask )); - - wxImageList *imageList = new wxImageList(50,50); - imageList->Add( bitmap0 ); // 0 - imageList->Add( bitmap1 ); // 1 - _noteBook->SetImageList(imageList); - - - _mar=new marInterface(); - _mar->_parameters->setRescaleSlope( mar->_parameters->getRescaleSlope() ); - _mar->_parameters->setRescaleIntercept( mar->_parameters->getRescaleIntercept() ); - _mar->_parameters->setIntParam( marParameters::e_voxel_type, marParameters::VOX_TYPE_MINIMUM ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_x_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_x_dimension) ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_y_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_y_dimension) ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_z_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_z_dimension) ); - int voi[6]; - mar->_experiment->getVOI( voi ); - _mar->_experiment->setVOI( voi ); - _mar->SetDicom(mar->_dicom); - - _mar->initExperiment( ); - - vtkImageData *vtkimagedata; - vtkimagedata = _mar->_experiment->getDynData( )->getVolume( )->castVtk(); - vtkimagedata->Update(); - marImageData *marimagedata = new marImageData(vtkimagedata); - - // -- -// _wxmanualcontourpanel = new wxMaracas_ManualContour_Panel( _noteBook ); -// _wxmanualcontourpanel->ConfigureVTK( marimagedata ); -// _noteBook->AddPage(_wxmanualcontourpanel,_T(" Manual Contour "), true, 0 ); - - - // -- - _wxMaracasEmptyPanel_3 = new wxMaracasEmptyPanel_3( _noteBook ); - _wxMaracasEmptyPanel_3->ConfigureVTK( marimagedata ); - _noteBook->AddPage(_wxMaracasEmptyPanel_3,_T(" 2 contornos Maria Alejandra "), true, 0 ); - - // -- - _noteBook->AddPage(new wxPanel(_noteBook,-1),_T("?? "), true, 1 ); - - // -- - _wxMaracas_ManualTree_MPR = new wxMaracas_ManualTree_MPR( _noteBook, marimagedata , _mar->_parameters->getVoxelSize()); - _wxMaracas_ManualTree_MPR->ConfigureVTK(); - _noteBook->AddPage(_wxMaracas_ManualTree_MPR,_T("Manual Tree E.Davila "), true, 1 ); - - - // -- - _wxMaracas_ManualSegmentation_MPR = new wxMaracas_ManualSegmentation_MPR( _noteBook, marimagedata , _mar->_parameters->getVoxelSize()); - _wxMaracas_ManualSegmentation_MPR->ConfigureVTK(); - _noteBook->AddPage(_wxMaracas_ManualSegmentation_MPR,_T("Manual Segmentation Diego "), true, 1 ); - - // -- - _wxMaracas_SegmentationFM3D = new wxMaracas_SegmentationFM3D( _noteBook, marimagedata , _mar->_parameters->getVoxelSize()); - _wxMaracas_SegmentationFM3D->ConfigureVTK(); - _noteBook->AddPage(_wxMaracas_SegmentationFM3D,_T("Segmentation FM3D Diego "), true, 1 ); - - - - // -- -//EED 4 oct 2006 information pour Loic -// _wxMaracasEmptyPanel_4 = new wxMaracasEmptyPanel_4( _noteBook ); -// _wxMaracasEmptyPanel_4->ConfigureVTK( ); -// _noteBook->AddPage(_wxMaracasEmptyPanel_4,"Loic", true, 1 ); - - _noteBook->SetSelection(0); - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , (wxObjectEventFunction) &wxMaracasNoteBookTests::OnChangePageTests ); - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , (wxObjectEventFunction) &wxMaracasNoteBookTests::OnChangePage ); - - wxStaticText *title=new wxStaticText(this,-1,_T("Tests...")); - -// It doesn't works in linux -// wxFont font(18,wxDEFAULT , wxITALIC, wxBOLD); -// title->SetFont(font); - - wxBoxSizer *sizer= new wxBoxSizer(wxVERTICAL); - sizer->Add( title , 0, wxEXPAND | wxALIGN_RIGHT, 10); - sizer->Add( _noteBook , 1, wxGROW, 10 ); - -//EEDxx2.4 -// FitInside(); - - sizer->SetSizeHints( this ); // set size hints to honour minimum size - this->SetSizer(sizer); - this->SetAutoLayout(true); - this->Layout(); - -} -//---------------------------------------------------------------------------- -wxMaracasNoteBookTests::~wxMaracasNoteBookTests() -{ -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookTests::OnChangePage(wxNotebookEvent& event) -{ - Refresh(); -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookTests::OnChangePageTests(wxNotebookEvent& event) -{ - Refresh(); -} - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxMaracasNoteBookManualRegistration , wxPanel) -// -END_EVENT_TABLE() - - -wxMaracasNoteBookManualRegistration::wxMaracasNoteBookManualRegistration(wxWindow *parent,marInterface *mar) - : wxPanel(parent, -1) -{ - wxBusyCursor wait; - - _noteBook = new wxNotebook(this, -1); - _noteBook->SetSize(550,300); - - - wxBitmap mask= wxBITMAP( TOOLBAR_V2_sm_mask ); - - wxBitmap bitmap0 = wxBITMAP( TOOLBAR_V2_sm_bl_Processing ); - wxBitmap bitmap1 = wxBITMAP( TOOLBAR_V2_sm_bl_Processing ); - - bitmap0.SetMask(new wxMask( mask )); - bitmap1.SetMask(new wxMask( mask )); - - wxImageList *imageList = new wxImageList(50,50); - imageList->Add( bitmap0 ); // 0 - imageList->Add( bitmap1 ); // 1 - _noteBook->SetImageList(imageList); - - - _mar=new marInterface(); - _mar->_parameters->setRescaleSlope( mar->_parameters->getRescaleSlope() ); - _mar->_parameters->setRescaleIntercept( mar->_parameters->getRescaleIntercept() ); - _mar->_parameters->setIntParam( marParameters::e_voxel_type, marParameters::VOX_TYPE_MINIMUM ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_x_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_x_dimension) ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_y_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_y_dimension) ); - _mar->_parameters->setDoubleParam( marParameters::e_voxel_z_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_z_dimension) ); - int voi[6]; - mar->_experiment->getVOI( voi ); - _mar->_experiment->setVOI( voi ); - _mar->SetDicom(mar->_dicom); - - _mar->initExperiment( ); - - vtkImageData *imagedata; - imagedata = _mar->_experiment->getDynData( )->getVolume( )->castVtk(); - imagedata->Update(); - marImageData *marimagedata=new marImageData(imagedata); - - _wxmanualregistration3D = new wxManualRegistration3D(_noteBook,marimagedata); - _wxmanualregistration3D->ConfigureVTK(); - _noteBook->AddPage( _wxmanualregistration3D , _T("Manual registration 3D") , true, 0 ); - - _noteBook->SetSelection(0); - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , (wxObjectEventFunction) &wxMaracasNoteBookTests::OnChangePageTests ); - Connect(_noteBook->GetId() , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , (wxObjectEventFunction) &wxMaracasNoteBookTests::OnChangePage ); - - wxStaticText *title=new wxStaticText(this,-1,_T("Manual registration")); - -// It doesn't works in linux -// wxFont font(18,wxDEFAULT , wxITALIC, wxBOLD); -// title->SetFont(font); - - wxBoxSizer *sizer= new wxBoxSizer(wxVERTICAL); - sizer->Add( title , 0, wxEXPAND | wxALIGN_RIGHT, 10); - sizer->Add( _noteBook , 1, wxGROW, 10 ); - - sizer->SetSizeHints( this ); // set size hints to honour minimum size - this->SetSizer(sizer); - this->SetAutoLayout(true); - this->Layout(); - -} -//---------------------------------------------------------------------------- -wxMaracasNoteBookManualRegistration::~wxMaracasNoteBookManualRegistration() -{ -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookManualRegistration::OnChangePage(wxNotebookEvent& event) -{ - Refresh(); -} - -//---------------------------------------------------------------------------- -void wxMaracasNoteBookManualRegistration::OnChangePageTests(wxNotebookEvent& event) -{ - Refresh(); -} - -//---------------------------------------------------------------------------- -bool wxMaracasNoteBookManualRegistration::GetIfSecondVolumeExist() -{ - return _wxmanualregistration3D->GetIfSecondVolumeExist(); -} -//---------------------------------------------------------------------------- -void wxMaracasNoteBookManualRegistration::GenerateSecondVolume(marInterface *mar) -{ - _marB=new marInterface(); - _marB->_parameters->setRescaleSlope( mar->_parameters->getRescaleSlope() ); - _marB->_parameters->setRescaleIntercept( mar->_parameters->getRescaleIntercept() ); - _marB->_parameters->setIntParam( marParameters::e_voxel_type, marParameters::VOX_TYPE_MINIMUM ); - _marB->_parameters->setDoubleParam( marParameters::e_voxel_x_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_x_dimension) ); - _marB->_parameters->setDoubleParam( marParameters::e_voxel_y_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_y_dimension) ); - _marB->_parameters->setDoubleParam( marParameters::e_voxel_z_dimension, mar->_parameters->getDoubleParam(marParameters::e_voxel_z_dimension) ); - int voi[6]; - mar->_experiment->getVOI( voi ); - _marB->_experiment->setVOI( voi ); - _marB->SetDicom(mar->_dicom); - - _marB->initExperiment( ); - - vtkImageData *vtkimagedata; - vtkimagedata = _marB->_experiment->getDynData( )->getVolume( )->castVtk(); - vtkimagedata->Update(); - _wxmanualregistration3D->AddSecondVolume(new marImageData(vtkimagedata)); -} diff --git a/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasFrame02.h b/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasFrame02.h deleted file mode 100644 index fc867c8..0000000 --- a/lib/maracasVisuLib/src/interface/wxWindows/wxMaracasFrame02.h +++ /dev/null @@ -1,661 +0,0 @@ -/*========================================================================= - - Program: wxMaracas - Module: $RCSfile: wxMaracasFrame02.h,v $ - Language: C++ - Date: $Date: 2008/10/31 16:32:10 $ - Version: $Revision: 1.1 $ - - Copyright: (c) 2002, 2003 - License: - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - -#ifndef __WX__MARACAS__FRAME02__HXX__ -#define __WX__MARACAS__FRAME02__HXX__ - - -//#include -//#include - -#include "wxMaracasPathology_01.h" -#include "marTypes.h" -#include "wxMaracas3DBrowser.h" -#include "wxMaracasQuantification.h" -#include "widgets/wxSurfaceSTLWidget.h" -#include "wxMaracasMPR.h" -#include "wxMaracasProcessingCT.h" -#include "wxMaracasEmptyPanel.h" -#include "wxMaracasEmptyPanel_2.h" -#include "wxMaracasEmptyPanel_3.h" -#include "wxMaracasQuantificationCT.h" -#include "wxMaracasImageBrowser02.h" -#include "wxMaracas_ManualTree_MPR.h" -#include "wxMaracas_ManualContour_Panel.h" -#include "widgets/wxManualRegistration3D.h" - -#include "widgets/wxManualRegistration3D.h" -#include "wxMaracas_SegmentationFM3D.h" -#include "wxMaracas_ManualSegmentation_MPR.h" - -//EED 15Avril2008 using namespace std; -//EED 15Avril2008 #include "ILPD/src/wxInterface/wxILPD.h" -#include "wxILPDwithImage.h" - - - -class marInterface; -class marInterfaceCT; - - -// EED 3 nov 2006 - -class FileInfoNode -{ -public: - FileInfoNode(string filename, string dirfile); - ~FileInfoNode(); - - string GetFileName(); - string GetFileNameParent(); - void SetFileNameParent(string parent); - string GetDirFile(); - -private: - std::string _dirfile; - std::string _filename; - std::string _filenameParent; - FileInfoNode *_parentNode; - std::vector _lstFileInfoNodeChildrens; -protected: -}; - - - -class FileInformationModel -{ -public: - FileInformationModel(); - ~FileInformationModel(); - - void ResetModel(); - void ReadModel(string dirFile); - - int GetSizeLstFile(); - string GetFileName(int i); - - int GetSizeLstFile_filter(); - string GetFileName_filter(int i); - - - - void Filtre_1(string filtre); - void LinkRelations(); - -private: - string _filtre_1; - std::vector _lstFileInfoNodes; -protected: -}; - - -class wxReadWriteConf: public wxDialog -{ -public: - wxReadWriteConf(wxWindow *parent,string parentFile); - ~wxReadWriteConf(); - - void eventBtnWorkDirectory(wxCommandEvent &event); - void eventBtnReadFile(wxCommandEvent &event); - void eventBtnWriteFile(wxCommandEvent &event); - void eventBtnReWriteFile(wxCommandEvent &event); - - void OnShowFile01(wxCommandEvent &event); - void OnShowFile02(wxCommandEvent &event); - - string GetNameWriteFile(); - string GetNameReadFile(); - string GetWorkDirectory(); - string GetParentFile(); - -protected: - -private: - - static string _workDirectory; - string _nameWriteFile; - string _nameReadFile; - string _parentFile; - wxStaticText *_directoryTXT; - FileInformationModel *_fim; - - wxListBox *_wxlstFiles; - wxListBox *_wxlstAllFiles; - wxTextCtrl *_wxviewinfo; - - wxWindow *CreateReadModule(wxWindow *parent); - wxWindow *CreateListFilesModule(wxWindow *parent); - wxWindow *CreateReadFileModule(wxWindow *parent); - wxWindow *CreateListAllFilesModule(wxWindow *parent); - - - - void RefreshReadFilesList(); - void RefreshAllFilesList(); - void ShowInformation(wxListBox *wxlistbox , wxTextCtrl* wxtextctrl ); - void ResetView(); - - -}; - - - - - -/** - * \brief Principal Frame of the application - * MARACAS: MAgnetic Resonance Angiography Computer ASsisted analysis - * - */ - - -class MAR_INTERFACEWX_EXPORT wxMaracasFrame02: public wxFrame -{ -public: - wxMaracasFrame02( wxFrame *parent, wxWindowID id = -1, - marInterface* mar = NULL, marInterfaceCT* marCT = NULL, char *dictionaryFileName=NULL, - const wxString& title = wxT("MARACAS: MAgnetic Resonance Angiography Computer ASsisted analysis"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE); - void RecreateToolbar( ); - void OnQuit( wxCloseEvent& event ); - void OnLoadPatientData( wxCommandEvent& event ); - void OnParameters( wxCommandEvent& event ); - -// EED Borrme not used - void OnLoadImageData( wxListEvent& event ); - - void OnLoadImageData02( wxCommandEvent& event ); - void OnStartExperiment( wxCommandEvent& event ); - void OnHelp (wxCommandEvent& event ); - void OnQuant (wxCommandEvent& event ); - void OnQuantificationCT (wxCommandEvent& event ); - void OnAboutCreatis( wxCommandEvent& event ); - - void OnStl (wxCommandEvent& event ); - void OnNewAxis(wxCommandEvent &WXUNUSED(event)); - void OnDeleteAxis(wxCommandEvent &WXUNUSED(event)); - - void OnRegenerateAll( wxCommandEvent& event ); - void OnRegenerateSplineAxe( wxCommandEvent& event ); - void OnCleanContours( wxCommandEvent& event ); - void OnRegenerateSignal( wxCommandEvent& event ); - - void OnMPR(wxCommandEvent& event ); - void OnProcessingCT(wxCommandEvent& event ); - - void OnEmptyPanel(wxCommandEvent& event ); - void OnEmptyPanel_2(wxCommandEvent& event ); - - - -private: - wxMaracas3DBrowser *_wxmaracas3dbrowser; - wxMaracasQuantification *_wxmaracasquantification; - wxMaracasQuantificationCT *_wxmaracasquantification_ct; - wxSurfaceSTLWidget *_wxmaracassurfaceSTLwidget; - wxMaracasMPR *_wxMaracasMPR; - wxMaracasProcessingCT *_wxMaracasProcessingCT; - - wxMaracasEmptyPanel *_wxMaracasEmptyPanel; - wxMaracasEmptyPanel_2 *_wxMaracasEmptyPanel_2; - - wxPanel* _actual_panel; - wxGauge* _progressGauge; - marInterface* _mar; - marInterfaceCT* _marCT; - - DECLARE_EVENT_TABLE( ); - - void DeletePanels(); - -}; - -static const long TOOLBAR_STYLE = wxNO_BORDER | wxTB_FLAT | wxTB_DOCKABLE | wxTB_HORIZONTAL; - -enum -{ - //! Toolbar & menu buttons - ID_TOOLBAR = 200, - ID_TOOLBAR_DATA_BROWSER, - ID_TOOLBAR_PARAMETERS, - ID_TOOLBAR_IMAGE_BROWSER, - ID_TOOLBAR_3D_BROWSER, - ID_TOOLBAR_PLANS, - ID_TOOLBAR_QUANT, - ID_TOOLBAR_MPR, - ID_TOOLBAR_PROCESSING_CT, - ID_TOOLBAR_QUANTIFICATION_CT, - ID_TOOLBAR_EMPTY_PANEL, - ID_TOOLBAR_EMPTY_PANEL_2, - ID_TOOLBAR_ROTATE, - ID_TOOLBAR_BRIGHT, - ID_TOOLBAR_PAN, - ID_TOOLBAR_ZOOM, - ID_TOOLBAR_CLEAR, - ID_TOOLBAR_INTENSITY, - ID_TOOLBAR_HELP, - ID_TOOLBAR_STL, -}; - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -class wxMaracasNoteBookPatientLstVoi: public wxPanel -{ -public: - wxMaracasNoteBookPatientLstVoi(wxWindow *parent); - ~wxMaracasNoteBookPatientLstVoi(); - - void OnChangePageToVOI(wxNotebookEvent& event); - void OnChangePage(wxNotebookEvent& event); - void OnSelectPatientStudySerieImage(wxCommandEvent& event); - void OnReadWriteConf_Maracas(wxCommandEvent& event); - - void SetMarInterface(marInterface *mar); - wxMaracasImageBrowser02* GetWxMaracasImageBrowser02(); - wxILPD *GetWxILPD(); - - void OnPersistence_Read(wxCommandEvent& event); - void OnPersistence_Write(wxCommandEvent& event); - void Persistence_Read_Images(); - void Persistence_Read_VOI(); - - void Persistence_Write_Images_Database(); - void Persistence_Write_Images_ManualReadFileList(); - - void Persistence_Write_VOI(); - - string GetRWCM_namefileVOI(); - - wxNotebook *GetNoteBook(); - - DECLARE_EVENT_TABLE(); - -private: - -//EED 4 oct 2006 - marRAWFiles *_marRAWFiles; - marRAW2Files *_marRAW2Files; - marRAW2AsciiFiles *_marRAW2AsciiFiles; - marGdcmDicomILPD *_marGdcmDicomILPD; - -// EED 14 Nov 2006 - wxReadWriteConf *_wxreadwriteconf; - -// EED 26 Nov 2006 - string _RWCM_namefileReadImages; - string _RWCM_namefileVOI; - - - marInterface *_mar; - marInterface *_mar2; - wxNotebook *_noteBook; - string _backStringFirstFile; - string _backStringFirstFile2; - int _voiBack[ 6 ]; - - wxILPD *_wxILPD; - wxMaracasImageBrowser02 *_wxMaracasImageBrowser02; - wxMaracasMPR *_wxMaracasMPR; - - wxListView *_dicomPanelListView; - - wxWidgetMesure2D *_widgetMesure; - -//EED 15Avril2008 wxVtk2DBaseView *_wxvtk2Dbaseview; -//EED 15Avril2008 vtkBaseData *_vtkbasedata; -//EED 15Avril2008 wxPanel *_panelImage; - -//EED 15Avril2008 wxSplitterWindow *_pnlSplitter_ViewImage_wxILPD; -//EED 15Avril2008 wxSplitterWindow *_pnlSplitter_Image_DicomList; - -//EED 15Avril2008 void SetItem( wxListView *wxlistview, int line, int col, wxString text ) ; - -//EED 15Avril2008 void ResetwxListView(); -//EED 15Avril2008 void SelectedPatient(); -//EED 15Avril2008 void SelectedSerie(); -//EED 15Avril2008 void SelectedImage(); -//EED 15Avril2008 void ShowDicomInformation(string *fileImageName); -//EED 15Avril2008 void ShowDicomImage(string *fileImageName); - - void CreateMPRPanel(); - - -}; - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -class wxMaracasNoteBookIRMQuantification: public wxPanel -{ -public: - wxMaracasNoteBookIRMQuantification(wxWindow *parent, marInterface *mar); - ~wxMaracasNoteBookIRMQuantification(); - void OnChangePageQuantification(wxNotebookEvent& event); - void OnChangePage(wxNotebookEvent& event); - void OnNewAxis(wxCommandEvent &WXUNUSED(event)); - void OnDeleteAxis(wxCommandEvent &WXUNUSED(event)); - void OnQuantification(wxCommandEvent & event); - - DECLARE_EVENT_TABLE(); -private: - bool _existAxis; - marInterface *_mar; - wxMaracas3DBrowser *_wxmaracas3dbrowser; - wxMaracasQuantification *_wxmaracasquantification; - wxNotebook *_noteBook; -}; - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -class wxMaracasNoteBookCTQuantification: public wxPanel -{ -public: - wxMaracasNoteBookCTQuantification(wxWindow *parent, marInterface *mar, string _namefileParentRWCM); - ~wxMaracasNoteBookCTQuantification(); - void OnChangePageQuantification(wxNotebookEvent& event); - void OnChangePage(wxNotebookEvent& event); - void OnQuantification(wxCommandEvent& event); - - void OnReadWriteConf_Maracas(wxCommandEvent& event); - void OnPersistence_Read(wxCommandEvent& event); - void OnPersistence_Write(wxCommandEvent& event); - void Persistence_Read_MPR(); - void Persistence_Read_ProcessingCT(); - void Persistence_Read_ContourQauntificationCT(); - void Persistence_Write_MPR(); - void Persistence_Write_ProcessingCT(); - void Persistence_Write_ContourQuantificationCT(); - - - DECLARE_EVENT_TABLE(); -private: - - string _namefileParentRWCM; - string _RWCM_namefileMPR; - string _RWCM_namefileProcessingCT; - string _RWCM_namefileContourQuantificationCT; - wxReadWriteConf *_wxreadwriteconf; - - bool _readyQuantification; - marInterfaceCT *_mar; - wxMaracasMPR *_wxMaracasMPR; - wxMaracasProcessingCT *_wxMaracasProcessingCT; - wxMaracasQuantificationCT *_wxmaracasquantification_ct; - wxNotebook *_noteBook; -}; - - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -class wxMaracasNoteBookVascularTreeExtraction: public wxPanel -{ -public: - wxMaracasNoteBookVascularTreeExtraction(wxWindow *parent, marInterface *mar); - ~wxMaracasNoteBookVascularTreeExtraction(); - void OnChangePageQuantification(wxNotebookEvent& event); - void OnChangePage(wxNotebookEvent& event); - - DECLARE_EVENT_TABLE(); -private: - marInterface *_mar; - wxMaracasEmptyPanel_2 *_wxMaracasEmptyPanel_2; - wxMaracasPathology_01 *_wxMaracasPathology_01; - wxNotebook *_noteBook; -}; - - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -class wxMaracasNoteBookSTLFormat: public wxPanel -{ -public: - wxMaracasNoteBookSTLFormat(wxWindow *parent, marInterface *mar); - ~wxMaracasNoteBookSTLFormat(); - void OnChangePageSTLFormat(wxNotebookEvent& event); - void OnChangePage(wxNotebookEvent& event); - void OnNewAxis(wxCommandEvent &WXUNUSED(event)); - void OnDeleteAxis(wxCommandEvent &WXUNUSED(event)); - - wxPanel *CreateSTLFormat_01(wxWindow *parent,marInterface *mar); - wxPanel *CreateSTLFormat_02(wxWindow *parent,marInterface *mar); - wxPanel *CreateSTLFormat_03(wxWindow *parent,marInterface *mar); - - DECLARE_EVENT_TABLE(); -private: - - - // STL 01 - bool _existAxis; - marInterface *_mar; - wxMaracas3DBrowser *_wxmaracas3dbrowser; - wxSurfaceSTLWidget *_wxmaracassurfaceSTLwidget; - wxNotebook *_noteBook_01; - - // STL 02 - wxMaracasMPR *_wxMaracasMPR; - - // General - wxNotebook *_noteBook_general; -}; - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -class wxMaracasNoteBookTests: public wxPanel -{ -public: - wxMaracasNoteBookTests(wxWindow *parent, marInterface *mar); - ~wxMaracasNoteBookTests(); - void OnChangePageTests(wxNotebookEvent& event); - void OnChangePage(wxNotebookEvent& event); - - DECLARE_EVENT_TABLE(); -private: - marInterface *_mar; - wxMaracasEmptyPanel_3 *_wxMaracasEmptyPanel_3; - wxMaracasEmptyPanel_4 *_wxMaracasEmptyPanel_4; - - wxMaracas_ManualContour_Panel *_wxmanualcontourpanel; - wxMaracas_ManualTree_MPR *_wxMaracas_ManualTree_MPR; - wxMaracas_ManualSegmentation_MPR *_wxMaracas_ManualSegmentation_MPR; - wxMaracas_SegmentationFM3D *_wxMaracas_SegmentationFM3D; - - wxNotebook *_noteBook; -}; - -class wxMaracasNoteBookManualRegistration: public wxPanel -{ -public: - wxMaracasNoteBookManualRegistration(wxWindow *parent, marInterface *mar); - ~wxMaracasNoteBookManualRegistration(); - void OnChangePageTests(wxNotebookEvent& event); - void OnChangePage(wxNotebookEvent& event); - - bool GetIfSecondVolumeExist(); - void GenerateSecondVolume(marInterface *mar); - - - - DECLARE_EVENT_TABLE(); -private: - marInterface *_mar; - marInterface *_marB; - wxNotebook *_noteBook; - - wxManualRegistration3D *_wxmanualregistration3D; - -}; - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - - -class wxMaracasGenericChiFra: public wxMDIChildFrame -{ -public: - wxMaracasGenericChiFra(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style); - ~wxMaracasGenericChiFra(); - void OnClose(wxCloseEvent& event); - void SetBlockCloseEvent(bool blockClose); - DECLARE_EVENT_TABLE(); -private: - bool _blockClose; -}; - - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -class wxProcessingImagesControl: public wxPanel -{ -public: - wxProcessingImagesControl(wxWindow *parent); - void OnActiveIRMQuantificationFrame(wxCommandEvent& event); - void OnActiveCTQuantificationFrame(wxCommandEvent& event); - void OnActiveVascularTreeExtractionFrame(wxCommandEvent& event); - void OnActiveSTLFormatFrame(wxCommandEvent& event); - void OnActiveTestsFrame(wxCommandEvent& event); - void OnActiveTests2Frame(wxCommandEvent& event); - - ~wxProcessingImagesControl(); -private: -}; -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -class wxProcessingImagesTabControl: public wxPanel -{ -public: - wxProcessingImagesTabControl(wxWindow *parent,marInterface *mar,wxMaracasNoteBookPatientLstVoi *patientlstvoi); - ~wxProcessingImagesTabControl(); - void OnChangingPage(wxNotebookEvent& event); - void OnChangePage(wxNotebookEvent& event); - -private: - marInterface *_mar; - wxMaracasNoteBookPatientLstVoi *_patientlstvoi; - wxMaracasNoteBookIRMQuantification *_irmQuantification; - wxMaracasNoteBookCTQuantification *_ctQuantification; - wxMaracasNoteBookVascularTreeExtraction *_vascularTreeExtraction; - wxMaracasNoteBookSTLFormat *_stlFormat; - - wxNotebook *_noteBook; - -}; - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -class MAR_INTERFACEWX_EXPORT wxMaracasFrame03: public wxMDIParentFrame -{ -public: - wxMaracasFrame03( wxFrame *parent, wxWindowID id = -1, - marInterface* mar = NULL, char *dictionaryFileName=NULL, - const wxString& title = wxT("MARACAS: MAgnetic Resonance Angiography Computer ASsisted analysis"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE); - ~wxMaracasFrame03(); - void OnActivePatientListVoiFrame(wxCommandEvent& event); - void OnActiveProcessingFrame(wxCommandEvent& event); - void OnActiveParams(wxCommandEvent& event); - void OnActiveAbout(wxCommandEvent& event); - void OnActiveProcessingModules(wxCommandEvent& event); - void OnActiveIRMQuantificationFrame(wxCommandEvent& event); - void OnActiveCTQuantificationFrame(wxCommandEvent& event); - void OnActiveVascularTreeExtractionFrame(wxCommandEvent& event); - void OnActiveSTLFormatFrame(wxCommandEvent& event); - void OnActiveTestsFrame(wxCommandEvent& event); - void OnActiveTests2Frame(wxCommandEvent& event); - void OnActiveQuit(wxCommandEvent& event); - void CreateWindowMDI( int type ); - void Configure_WindowMDI( int type ); - - void eventMenuDeleteAllPatientInDB(wxCommandEvent& event); - void eventMenuDeletePatientInDB(wxCommandEvent& event); - void OnFilterInDB(wxCommandEvent& event); - void OnOrderingInDB(wxCommandEvent& event); - void OnEditColumnsInDB(wxCommandEvent& event); - - DECLARE_EVENT_TABLE(); - -private: - marInterface *_mar; -// wxMaracasGenericChiFra *_frame_ListPatieint_Voi; - wxFrame *_frame_ListPatieint_Voi; - wxMaracasNoteBookPatientLstVoi *_patientlstvoi; - wxMaracasNoteBookManualRegistration *_manualRegistrationPanel; - - - wxBitmapButton *_btnProcessingData; - wxBitmapButton *_btnCTQuant; - wxBitmapButton *_btnIRMQuant; - wxBitmapButton *_btnTreeExtrac; - wxBitmapButton *_btnSTLFormat; - - wxMenu *_option_menu; - - wxMenuBar *CreateMenuBarBase(); - void InitToolBar(wxToolBar* toolBar); -}; - - -// menu items ids -enum -{ - MDI_QUIT = 100, - MDI_NEW_WINDOW, - MDI_REFRESH, - MDI_CHANGE_TITLE, - MDI_CHANGE_POSITION, - MDI_CHANGE_SIZE, - MDI_CHILD_QUIT, - MDI_PARAMETERS, - MDI_ABOUT -}; - - - - -#endif // __WX__MARACAS__FRAME02__HXX__