X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2FwxContourGUIExample%2FwxContourGUIExample.cxx;h=9849c424834c19e768a347039e3e57682311a8d8;hb=a654abbc209ed3104e98553cb381ef1c2845937a;hp=9adaee30bea7d2a16e5b597bfff6d7571252f142;hpb=b875b24962d04478a247cc743a453f113e34b3cd;p=creaContours.git diff --git a/appli/wxContourGUIExample/wxContourGUIExample.cxx b/appli/wxContourGUIExample/wxContourGUIExample.cxx index 9adaee3..9849c42 100644 --- a/appli/wxContourGUIExample/wxContourGUIExample.cxx +++ b/appli/wxContourGUIExample/wxContourGUIExample.cxx @@ -5,31 +5,34 @@ #include "wxContourGUIExample.h" #include "wxContourMainFrame.h" -#include "OutlineModelManager.h" -#include "wxContourEventHandler.h" +//#include "OutlineModelManager.h" +//#include "wxContourEventHandler.h" -#include "wxContourMainPanel.h" + +#include + +#include +//#include "wxContourMainPanel.h" #include "vtkMetaImageReader.h" #include #include "vtkImageData.h" -#include "OutlineModelBuilder.h" -#include "ContourThing.h" -#include "AxeThing.h" -#include "ImageSourceThing.h" -#include "ImageSectionThing.h" -#include "SomeEnvironment.h" -#include "ReaderEnvironment.h" #include "wx/artprov.h" #include +//#include "OutlineModelBuilder.h" +//#include "ContourThing.h" +//#include "AxeThing.h" +//#include "ImageSourceThing.h" +//#include "ImageSectionThing.h" +//#include "SomeEnvironment.h" +//#include "ReaderEnvironment.h" -#include "interfMainPanel.h" -#include -#include +//#include "interfMainPanel.h" + wxContourMainFrame* wxTheApplication::frame = 0; //---------------------------------------------------------------------------------------------------------------- @@ -49,24 +52,24 @@ bool wxTheApplication :: OnInit() //------------------------------------------------------------- // Doing what is done by the bbtk boxes - /*vtkMetaImageReader *reader = vtkMetaImageReader::New(); + //vtkMetaImageReader *reader = vtkMetaImageReader::New(); // reader->SetFileName( "data\\hola.mhd" ); // reader->SetFileName( "C:/Program Files/bbtk-1.0/data/vtk/img02.maracas.mhd" ); // reader->SetFileName( "C:/Program Files/bbtk-1.0/data/vtk/test01.maracas.mhd" ); // reader->SetFileName( "C:/download/Elise/Elise_IRM_Helium/A/test01b.maracas.mhd" ); - wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.mhd"), wxOPEN ); - if (dialog.ShowModal() == wxID_OK) - { - std::string filename = (const char *)(dialog.GetPath().mb_str()); - reader->SetFileName( filename.c_str() ); - } else { - reader->SetFileName( "data\\hola.mhd" ); + //wxFileDialog dialog(NULL, _T("Choose a file"), _T(""), _T(""), _T("*.mhd"), wxOPEN ); + //if (dialog.ShowModal() == wxID_OK) + //{ + // std::string filename = (const char *)(dialog.GetPath().mb_str()); + // reader->SetFileName( filename.c_str() ); + //} else { + // reader->SetFileName( "data\\hola.mhd" ); // Halt(0); - } - - reader->Update();*/ + //} + //reader->Update(); +/*JCP 17-10-2008 wxInitAllImageHandlers(); int image_type = GIMMICK_3D_IMAGE_SELECTION; @@ -128,8 +131,8 @@ bool wxTheApplication :: OnInit() //------------------------------------------------------------- - /*frame = new wxContourMainFrame(_builder->getImSourceEnv(), _builder->getImSectionEnv(), _builder->getAxesEnv(), _builder->getContourEnv(),NULL, wxID_ANY, wxT("ROI Application Sample"), wxPoint(50,50), wxSize(800, 600)); - frame->Show(TRUE);*/ + //frame = new wxContourMainFrame(_builder->getImSourceEnv(), _builder->getImSectionEnv(), _builder->getAxesEnv(), _builder->getContourEnv(),NULL, wxID_ANY, wxT("ROI Application Sample"), wxPoint(50,50), wxSize(800, 600)); + //frame->Show(TRUE); //Creating the evtHandler of the panels wxContourEventHandler * eventHandler = new wxContourEventHandler(); @@ -177,11 +180,11 @@ bool wxTheApplication :: OnInit() //frame->Show(TRUE); frame1->Show(TRUE); - /*JCP 17 - 10 - 08 - if ( successConfiuration ) - { - frame->Show(TRUE); - }*/ + //JCP 17 - 10 - 08 + //if ( successConfiuration ) + //{ + // frame->Show(TRUE); + //} // SetTopWindow(frame); @@ -194,6 +197,56 @@ bool wxTheApplication :: OnInit() //pannew->addContourCheckBox("contour4"); //JCP -- new Interface +JCP 17-10-2008*/ + + + wxInitAllImageHandlers(); + + int image_type = GIMMICK_3D_IMAGE_SELECTION; + int threads = 1; + + creaImageIO::WxGimmickDialog w(0, + -1, + _T("WxGimmickDialog test"), + wxDefaultPosition, + wxSize(1200,800), + image_type, + threads); + w.ShowModal(); + + //vtkImageData* selectedimage=NULL; + std::vector images; + if(w.GetReturnCode() == wxID_OK){ + + std::vector s; + w.GetSelectedFiles(s); + std::vector::iterator i; + for (i=s.begin();i!=s.end();++i){ + std::cout << *i << std::endl; + } + + std::cout << "$$$$ "<Delete(); + + }else if (w.GetReturnCode() == wxID_CANCEL){ + vtkMetaImageReader *reader = vtkMetaImageReader::New(); + reader->SetFileName( "D:/CAT08/Datos/Imagenes/image06.mhd"); //"data/hola.mhd" ); + reader->Update(); + images.push_back(reader->GetOutput()); + }else{ + return -1; + } + + + wxFrame* frame1 = new wxFrame(NULL, wxID_ANY, wxT("ROI Application - Evaluation version, 23 Oct 2008 "), wxPoint(400,50), wxSize(800, 600) ); + //frame = new wxContourMainFrame( frame1, wxID_ANY, wxString(_T("")), wxPoint(50,50), wxSize(800, 600), images ); + frame = wxContourMainFrame::getInstance(frame1, wxID_ANY, wxString(_T("")), wxPoint(200,50), wxSize(800, 600), images ); + frame1->CreateStatusBar(); + frame1->Show(TRUE); + return TRUE; }