]> Creatis software - creaContours.git/commitdiff
no message
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 14 Feb 2011 20:41:52 +0000 (20:41 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 14 Feb 2011 20:41:52 +0000 (20:41 +0000)
lib/Interface_Icons_NDimensions/interfToolsPanels.cxx

index 857fa04d9ffd6503058f96fde72aed5e9abe283b..f5f787192061b92bb8ea37e039be997d0e0c5802 100644 (file)
@@ -14,7 +14,7 @@ interfConfigurationPanel::interfConfigurationPanel(wxWindow * parent)
        //wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)this->_theViewPanel->getWxVtkBaseView();
        //vtkImageViewer2 *imageviewer = wxvtk2dbaseview->_imageViewer2XYZ->GetVtkImageViewer2();
        //int colorwindow = (int)imageviewer->GetWindowLevel()->GetLevel();
-       //int windowlevel = (int)imageviewer->GetWindowLevel()->GetWindow();    
+       //int windowlevel = (int)imageviewer->GetWindowLevel()->GetWindow();
 
        int colorwindow = interfMainPanel::getInstance()->getColorWindow();
        int windowlevel = interfMainPanel::getInstance()->getWindowLevel();
@@ -22,20 +22,20 @@ interfConfigurationPanel::interfConfigurationPanel(wxWindow * parent)
        int min = (int)floor (range[0]);
        int max = (int)ceil (range[1]);
 
-       
+
        _brithtnessWindowLevel                                  = new wxSlider(this, -1, windowlevel , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
        _brithtnessColorLevel                                   = new wxSlider(this, -1, colorwindow , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
 
        _interpolationCheckBox = new wxCheckBox(this, -1, _T("Image interpolation") );
-       _interpolationCheckBox->SetValue(true);         
+       _interpolationCheckBox->SetValue(true);
 
-       Connect( _withOfContourLine->GetId(),     wxEVT_SCROLL_CHANGED,           (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour); 
-       Connect( _withOfContourLine->GetId(),     wxEVT_SCROLL_THUMBTRACK,        (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour); 
+       Connect( _withOfContourLine->GetId(),     wxEVT_SCROLL_CHANGED,           (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour);
+       Connect( _withOfContourLine->GetId(),     wxEVT_SCROLL_THUMBTRACK,        (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour);
 
-       Connect( _brithtnessWindowLevel->GetId(), wxEVT_SCROLL_CHANGED,           (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel); 
-       Connect( _brithtnessWindowLevel->GetId(), wxEVT_SCROLL_THUMBTRACK,        (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel); 
-       Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_CHANGED,           (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel); 
-       Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_THUMBTRACK,        (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel); 
+       Connect( _brithtnessWindowLevel->GetId(), wxEVT_SCROLL_CHANGED,           (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel);
+       Connect( _brithtnessWindowLevel->GetId(), wxEVT_SCROLL_THUMBTRACK,        (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel);
+       Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_CHANGED,           (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel);
+       Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_THUMBTRACK,        (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel);
        Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnInterpolation);
 
        wxFlexGridSizer * sizer                                 = new wxFlexGridSizer(1);
@@ -58,7 +58,7 @@ interfConfigurationPanel::interfConfigurationPanel(wxWindow * parent)
        //13-10-08
        this->SetAutoLayout( true );
        this->Layout();
-       
+
 }
 
 
@@ -82,10 +82,10 @@ void interfConfigurationPanel::onBrigthnessColorWindowLevel(wxScrollEvent& event
 
 void interfConfigurationPanel::OnInterpolation(wxCommandEvent& event)
 {
-       
+
        interfMainPanel::getInstance()->onInterpolation(_interpolationCheckBox->GetValue());
-       
-       
+
+
 }
 
 /**
@@ -117,10 +117,10 @@ interfSpreadPanel::interfSpreadPanel(wxWindow* parent)
 
        _wxtextctrlSpread           = new wxTextCtrl(this,-1, _T(""),wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
        _wxtextctrlSpread->SetEditable(false);
-       
-       Connect( spreadResetBtn->GetId(),       wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadReset ); 
-       Connect( spreadAddBtn->GetId(),         wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadAdd ); 
-       Connect( spreadGoBtn->GetId(),          wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadGo ); 
+
+       Connect( spreadResetBtn->GetId(),       wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadReset );
+       Connect( spreadAddBtn->GetId(),         wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadAdd );
+       Connect( spreadGoBtn->GetId(),          wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadGo );
 
        wxFlexGridSizer * sizer         = new wxFlexGridSizer(1);
        sizer -> Add( spreadResetBtn            , 1, wxGROW );
@@ -144,7 +144,7 @@ interfSpreadPanel::~interfSpreadPanel(){
 void interfSpreadPanel::onSpreadReset(wxCommandEvent& event){
        setStringSpread("   ");
        _wxtextctrlSpread->SetValue(wxString("",wxConvUTF8));
-       interfMainPanel::getInstance()->resetAppend();  
+       interfMainPanel::getInstance()->resetAppend();
 }
 void interfSpreadPanel::onSpreadAdd(wxCommandEvent& event){
        interfMainPanel::getInstance()->onSpreadAdd();
@@ -154,7 +154,7 @@ void interfSpreadPanel::onSpreadGo(wxCommandEvent& event){
 
        setStringSpread("   ");
        int typeMethodFindCtrlPoints=_spreadMethodRadiobox->GetSelection();
-
+printf("EED interfSpreadPanel::onSpreadGo %d\n",typeMethodFindCtrlPoints);
        interfMainPanel::getInstance()->onSpreadGo(typeMethodFindCtrlPoints);
 
 }
@@ -188,9 +188,9 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        lstOptions[0]=_T("Current Slice");
        lstOptions[1]=_T("Range Slices");
 //     lstOptions[2]=_T("All Slices");
-       _informationRadiobox     = new wxRadioBox(this, -1, _T("Slice analysis"), wxDefaultPosition, wxSize(270,45), 2 , lstOptions,  2, wxRA_SPECIFY_COLS);    
+       _informationRadiobox     = new wxRadioBox(this, -1, _T("Slice analysis"), wxDefaultPosition, wxSize(270,45), 2 , lstOptions,  2, wxRA_SPECIFY_COLS);
+
 
-       
        wxString lstOptContOperation[5];
        lstOptContOperation[0]=_T("AND");
        lstOptContOperation[1]=_T("OR");
@@ -199,37 +199,37 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        _radiolstboxContourGroup = new wxRadioBox(this, -1, _T("Contour group"), wxDefaultPosition, wxSize(270,45), 4 , lstOptContOperation,  4, wxRA_SPECIFY_COLS);
        _radiolstboxContourGroup->SetSelection(1);
        Connect( _radiolstboxContourGroup->GetId(), wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &interfInformationPanel::onContourGroup );
-       
-       
+
+
        _XYZValues = new wxCheckBox(this, -1, _T("Save Contour Values") );
        _XYZValues->SetValue(true);
 
        _contourImage = new wxCheckBox(this, -1, _T("Extract Contours as Images") );
-       _contourImage->SetValue(true);  
+       _contourImage->SetValue(true);
 
        _statistics = new wxCheckBox(this, -1, _T("Save Statistics") );
        _statistics->SetValue(true);
 
        wxButton *informationContourLabelsBtn           = new wxButton(this,-1,_T("Contour labels"),wxDefaultPosition, wxSize(140,35) );
        informationContourLabelsBtn->SetEventHandler( this );
-       Connect( informationContourLabelsBtn->GetId(),          wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onInformationContourLabels ); 
+       Connect( informationContourLabelsBtn->GetId(),          wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onInformationContourLabels );
 
        wxButton *statisticsContourBtn                  = new wxButton(this,-1,_T("Contour statistics"),wxDefaultPosition, wxSize(140,35) );
        statisticsContourBtn->SetEventHandler( this );
-       Connect( statisticsContourBtn->GetId(),         wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onExtractInformation ); 
+       Connect( statisticsContourBtn->GetId(),         wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onExtractInformation );
 
        wxButton *showResultImagesBtn                   = new wxButton(this,-1,_T("Show result images"),wxDefaultPosition, wxSize(140,35) );
        showResultImagesBtn->SetEventHandler( this );
-       Connect( showResultImagesBtn->GetId(),          wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onShowResultImages ); 
-       
-       
+       Connect( showResultImagesBtn->GetId(),          wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onShowResultImages );
+
+
        wxButton *saveResultsBtn                        = new wxButton(this,-1,_T("Save Results"),wxDefaultPosition, wxSize(140,35) );
        saveResultsBtn->SetEventHandler( this );
-       Connect( saveResultsBtn->GetId(),               wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults ); 
-       
-       
+       Connect( saveResultsBtn->GetId(),               wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults );
+
+
        int sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();
-       //_theViewPanel->getSceneManager()->GetImageDataSizeZ();                        
+       //_theViewPanel->getSceneManager()->GetImageDataSizeZ();
        _mbarrangeSliceInformation                      =  new mBarRange(this,65,65);
        _mbarrangeSliceInformation->SetMin(0);
        _mbarrangeSliceInformation->SetStart(0);
@@ -238,10 +238,10 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        _mbarrangeSliceInformation-> setVisibleLabels( true );
        _mbarrangeSliceInformation-> setDeviceEndMargin(10);
        _mbarrangeSliceInformation-> setRepresentedValues( 0 , sizeZ-1 );
-       _mbarrangeSliceInformation-> setDeviceBlitStart(10,10); 
+       _mbarrangeSliceInformation-> setDeviceBlitStart(10,10);
        _mbarrangeSliceInformation-> setIfWithActualDrawed( false );
        _mbarrangeSliceInformation-> SetStart( 0 );
-       _mbarrangeSliceInformation-> SetEnd( sizeZ-1 );  
+       _mbarrangeSliceInformation-> SetEnd( sizeZ-1 );
 
 
 
@@ -259,18 +259,18 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        _mbarrangeRangeInformation->setVisibleLabels( true );
        _mbarrangeRangeInformation->setDeviceEndMargin(10);
        _mbarrangeRangeInformation->setRepresentedValues( min , max );
-       _mbarrangeRangeInformation->setDeviceBlitStart(10,10); 
+       _mbarrangeRangeInformation->setDeviceBlitStart(10,10);
        _mbarrangeRangeInformation->setIfWithActualDrawed( false );
        _mbarrangeRangeInformation->SetStart( min );
-       _mbarrangeRangeInformation->SetEnd( max );  
+       _mbarrangeRangeInformation->SetEnd( max );
 
 //     _mbarrangeSliceInformation->PushEventHandler(this);
 //     Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation );
 //     Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );
-       Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );             
+       Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_START,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );
        Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );
 //     Connect(_mbarrangeRangeInformation->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );
-       Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );             
+       Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction)  &interfInformationPanel::onRangeSliceInformation );
 
 
        _staticTextInformation  = new wxStaticText(this,-1,_T("    "));
@@ -315,9 +315,9 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        wxFlexGridSizer * sizer         = new wxFlexGridSizer(1,8);
        sizer->Add( sizerA                     , 1, wxALL               , 0 );
        sizer->Add( new wxStaticText(this      ,-1,_T("Slice Range"))   , 1, wxALL , 0 );
-       sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW        , 2 );                  
+       sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW        , 2 );
        sizer->Add( new wxStaticText(this      ,-1,_T("Gray Range"))    , 1, wxALL , 0 );
-       sizer->Add( _mbarrangeRangeInformation , 1, wxALL|wxGROW        , 2 );                  
+       sizer->Add( _mbarrangeRangeInformation , 1, wxALL|wxGROW        , 2 );
        sizer->Add( sizerB                     , 1, wxEXPAND            , 0 );
        sizer->Add( _staticTextInformation     , 1, wxEXPAND            , 0 );
        sizer->Add( _grid                      , 1, wxEXPAND            , 0 );
@@ -336,11 +336,11 @@ interfInformationPanel::~interfInformationPanel()
 
 
 void interfInformationPanel::onRangeSliceInformation(wxCommandEvent& event)
-{      
+{
        int     grayRangeMin    = _mbarrangeRangeInformation->GetStart();
-       int     grayRangeMax    = _mbarrangeRangeInformation->GetEnd(); 
-       interfMainPanel::getInstance()->SetScalarRange(grayRangeMin,grayRangeMax);      
-       interfMainPanel::getInstance()->RefreshInterface();     
+       int     grayRangeMax    = _mbarrangeRangeInformation->GetEnd();
+       interfMainPanel::getInstance()->SetScalarRange(grayRangeMin,grayRangeMax);
+       interfMainPanel::getInstance()->RefreshInterface();
 }
 
 
@@ -357,7 +357,7 @@ void interfInformationPanel::onShowResultImages(wxCommandEvent& event)
        int minZ             = _mbarrangeSliceInformation->GetStart();
        int maxZ             = _mbarrangeSliceInformation->GetEnd();
        int typeContourGroup = _radiolstboxContourGroup->GetSelection();
-       interfMainPanel::getInstance()->ShowResultImages(typeContourGroup, selection, minZ, maxZ);      
+       interfMainPanel::getInstance()->ShowResultImages(typeContourGroup, selection, minZ, maxZ);
 }
 
 
@@ -371,8 +371,8 @@ void interfInformationPanel::onExtractInformation(wxCommandEvent& event){
        int maxZ             = _mbarrangeSliceInformation->GetEnd();
        int grayRangeMin     = _mbarrangeRangeInformation->GetStart();
        int grayRangeMax     = _mbarrangeRangeInformation->GetEnd();
-       
-       interfMainPanel::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ, grayRangeMin, grayRangeMax);        
+
+       interfMainPanel::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ, grayRangeMin, grayRangeMax);
 }
 
 void interfInformationPanel::onSaveResults(wxCommandEvent& event)
@@ -388,7 +388,7 @@ void interfInformationPanel::onSaveResults(wxCommandEvent& event)
                std::string namefile  = (const char *)(dialog.GetFilename().mb_str());
                std::string filename  = (const char *)(dialog.GetPath().mb_str() );
                int typeContourGroup  = _radiolstboxContourGroup->GetSelection();
-               interfMainPanel::getInstance()->onSaveResults(directory, namefile, filename, 
+               interfMainPanel::getInstance()->onSaveResults(directory, namefile, filename,
                        typeContourGroup,
                        selection,minZ,maxZ,
                        _XYZValues->GetValue(), _contourImage->GetValue(), _statistics->GetValue());
@@ -410,10 +410,10 @@ void interfInformationPanel::FillGridWithContoursInformation(){
        int z,sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();//->getSceneManager()->GetImageDataSizeZ();
        int ii,sizeLstContourThings;
        for ( z=0 ; z<sizeZ ; z++)
-       {               
-               
+       {
+
                std::vector<std::string> lstContourThings = interfMainPanel::getInstance()->getOutlinesName(z);
-                       
+
                        //this->_modelManager->getOutlinesAtInstant( &instant );
 
                sizeLstContourThings = lstContourThings.size();
@@ -428,14 +428,14 @@ void interfInformationPanel::FillGridWithContoursInformation(){
                        _grid->SetCellValue( z, ii, tempString );
                } // for ii
        }// for z
-       
+
        // Last line
        _grid->SetRowLabelValue(sizeZ, _T(" ") );
        for (ii=0 ; ii<sizeLstContourThings ; ii++)
        {
                _grid->SetCellValue( sizeZ, ii, _T(" ") );
        } // for ii
-       
+
 }
 
 void interfInformationPanel::setStringInfoPanel(wxString tmpString){
@@ -474,7 +474,7 @@ void interfInformationPanel::onContourGroup(wxCommandEvent& event)
        {
                contourGroup=0;
        }
-       interfMainPanel::getInstance()->SetContourGroup( _radiolstboxContourGroup->GetSelection() );    
+       interfMainPanel::getInstance()->SetContourGroup( _radiolstboxContourGroup->GetSelection() );
 }
 
 //CMRU 29-08-09-----------------------------------------------------------------------------------------------
@@ -492,19 +492,19 @@ interfCalibrationPanel:: interfCalibrationPanel(wxWindow * parent)
 
        _unitsRadiobox = new wxRadioBox(this, -1, _T("Unit of measurement"), wxPoint(2, 25), wxSize(145,45), 3 , options,  3, wxRA_SPECIFY_COLS);
        _unitsRadiobox->SetSelection(0);
-       
+
        //The label
        new wxStaticText(this, wxID_ANY, wxT("Real Size: "),   wxPoint(2, 5));
-       
+
        //Text Control
        _size = new wxTextCtrl(this, wxID_ANY, wxT(""),  wxPoint(78,3),   wxSize(70, 20), 0, wxDefaultValidator, wxTextCtrlNameStr);
-       
+
        //The button
        new wxButton(this, 1, wxT("Calibrate"), wxPoint(78, 70), wxSize(70, 25), 0, wxDefaultValidator, wxT("button"));
 
        //Conexion del boton con su respectivo manejador
        Connect(1, wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction) &interfCalibrationPanel::onCalibrate);
-       
+
 }
 
 interfCalibrationPanel:: ~interfCalibrationPanel()