]> Creatis software - creaContours.git/commitdiff
*** empty log message ***
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 14 Dec 2009 16:59:31 +0000 (16:59 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 14 Dec 2009 16:59:31 +0000 (16:59 +0000)
lib/Interface_Icons_NDimensions/interfMainPanel.cxx
lib/Interface_Icons_NDimensions/interfMainPanel.h
lib/Interface_Icons_NDimensions/interfToolsPanels.cxx
lib/Interface_Icons_NDimensions/interfToolsPanels.h
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h

index 5e5f84f10c089db4ca911d508460b0baa43755f7..6f5dd532d8a533e8ca1e2ef955174e21fa73c44c 100644 (file)
@@ -755,6 +755,11 @@ void interfMainPanel::setColLableInfoPanel(int tmpIntB,wxString tmpTitleString)
 
 }
 
+void interfMainPanel::SetScalarRange(int grayRangeMin,int grayRangeMax)
+{
+       wxContourMainFrame::getInstance()->SetScalarRange(grayRangeMin, grayRangeMax); 
+}
+
 void interfMainPanel::onSaveResults(std::string directory,std::string namefile, std::string filename, 
                                                                        int typeContourGroup, int selection, int minZ, int maxZ ,bool XYZValues, bool contourImage, bool statistics)
 {
index 83911f7627416d7b5ca9a9d7746bf8c3190b2a83..90d2a30bfbef6543bb6d968c16d45dba99d868e0 100644 (file)
@@ -157,6 +157,7 @@ public:
        void appendColsInformationPanel(int _numberOfVariablesStatistics);
        void setCellValueInfoPanel(int z,int tmpIntA,wxString tempString);
        void setColLableInfoPanel(int tmpIntB ,wxString tmpTitleString);
+       void SetScalarRange(int grayRangeMin,int grayRangeMax);
        void onSaveResults(std::string directory,std::string namefile, std::string filename,
                int typeContourGroup, int selection, int minZ, int maxZ, bool XYZValues, bool contourImage, bool statistics);
        wxString getCellValue(int j,int i);
index c4a05d0dbfc2700017249bbbfa1780468b681683..24c79394bd34dab16d40f445e9ab665717c97554 100644 (file)
@@ -76,7 +76,6 @@ void interfConfigurationPanel::onBrigthnessColorWindowLevel(wxScrollEvent& event
        int colorwindow                         = _brithtnessColorLevel->GetValue();
        int windowlevel                         = _brithtnessWindowLevel->GetValue();
 
-
        interfMainPanel::getInstance()->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
 
 }
@@ -244,6 +243,8 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        _mbarrangeSliceInformation-> SetStart( 0 );
        _mbarrangeSliceInformation-> SetEnd( sizeZ-1 );  
 
+
+
        double range[2];
        interfMainPanel::getInstance()->getImageRange(range);
 
@@ -253,15 +254,24 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        _mbarrangeRangeInformation      =  new mBarRange(this,65,65);
        _mbarrangeRangeInformation->SetMin(0);
        _mbarrangeRangeInformation->SetStart(0);
-       _mbarrangeRangeInformation-> SetOrientation( true );
-       _mbarrangeRangeInformation-> setActiveStateTo(true);
-       _mbarrangeRangeInformation-> setVisibleLabels( true );
-       _mbarrangeRangeInformation-> setDeviceEndMargin(10);
-       _mbarrangeRangeInformation-> setRepresentedValues( min , max );
-       _mbarrangeRangeInformation-> setDeviceBlitStart(10,10); 
-       _mbarrangeRangeInformation-> setIfWithActualDrawed( false );
-       _mbarrangeRangeInformation-> SetStart( min );
-       _mbarrangeRangeInformation-> SetEnd( max );  
+       _mbarrangeRangeInformation->SetOrientation( true );
+       _mbarrangeRangeInformation->setActiveStateTo(true);
+       _mbarrangeRangeInformation->setVisibleLabels( true );
+       _mbarrangeRangeInformation->setDeviceEndMargin(10);
+       _mbarrangeRangeInformation->setRepresentedValues( min , max );
+       _mbarrangeRangeInformation->setDeviceBlitStart(10,10); 
+       _mbarrangeRangeInformation->setIfWithActualDrawed( false );
+       _mbarrangeRangeInformation->SetStart( min );
+       _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_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 );             
+
 
        _staticTextInformation  = new wxStaticText(this,-1,_T("    "));
 
@@ -319,9 +329,21 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
        this->Layout();
        //return panel;
 }
-interfInformationPanel::~interfInformationPanel(){
+
+interfInformationPanel::~interfInformationPanel()
+{
 }
 
+
+void interfInformationPanel::onRangeSliceInformation(wxCommandEvent& event)
+{      
+       int     grayRangeMin    = _mbarrangeRangeInformation->GetStart();
+       int     grayRangeMax    = _mbarrangeRangeInformation->GetEnd(); 
+       interfMainPanel::getInstance()->SetScalarRange(grayRangeMin,grayRangeMax);      
+       interfMainPanel::getInstance()->RefreshInterface();     
+}
+
+
 void interfInformationPanel::onInformationContourLabels(wxCommandEvent& event){
        wxBusyCursor wait;
        FillGridWithContoursInformation();
index e0784f26d5b63e2297846a25b69557d6e9871062..85b05d62e509256f1bd68d1ff22e81c2b64a9b5c 100644 (file)
@@ -85,9 +85,9 @@ private:
        void onShowResultImages(wxCommandEvent& event);
        void onSaveResults(wxCommandEvent& event);
        void onContourGroup(wxCommandEvent& event);
-
        void FillGridWithContoursInformation();
-       
+       void onRangeSliceInformation(wxCommandEvent& event);
+
 
        
                
index 1957a9e4d37aed7e1a61f5576abc4e8e7f95cb0d..e86dc1b19c70df15bb30634ebcb340ab44402ede 100644 (file)
@@ -2304,6 +2304,11 @@ std::vector<std::string> wxContourMainFrame::getOutlinesName(int slide){
 }
 
 
+void wxContourMainFrame::SetScalarRange(int grayRangeMin, int grayRangeMax)
+{
+       _contourextractdata->SetScalarRange(grayRangeMin,grayRangeMax);
+}
+
 
 void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ,int grayRangeMin, int grayRangeMax)
 {
@@ -2419,16 +2424,22 @@ void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int sel
                        }
 
                        _contourextractdata->SetLstManualContourModel( lstManConModTmp );
+                       _contourextractdata->SetScalarRange(grayRangeMin,grayRangeMax);
 
                        pLstValue.clear();
                        pLstValuePosX.clear();
                        pLstValuePosY.clear();
                        pLstValuePosZ.clear();
-                       _contourextractdata->GetValuesInsideCrown(      &pLstValue,
+
+                       
+                       int numberOfPixels;
+                       _contourextractdata->GetValuesInsideCrown(  &numberOfPixels,
+                                                                                                               &pLstValue,
                                                                                                                &pLstValuePosX,
                                                                                                                &pLstValuePosY,
                                                                                                                &pLstValuePosZ);
 
+                       resultSize=numberOfPixels;
                        // Statistics of each slice.
                        _contourextractdata->Statistics( &pLstValue,
                                                                                        grayRangeMin,
@@ -2439,7 +2450,7 @@ void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int sel
                                                                                        &resultMax,
                                                                                        &resultAverage,
                                                                                        &resultStandardeviation);
-                       
+
                        if (interfMainPanel::getInstance()->getNumberColsInformationPanel()<_numberOfVariablesStatistics*(iContourGroup+1)  )
                        {
                                interfMainPanel::getInstance()->appendColsInformationPanel(_numberOfVariablesStatistics);
@@ -2447,7 +2458,8 @@ void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int sel
 
                        tmpIntA=_numberOfVariablesStatistics*iContourGroup ;
 
-                       tempString.Printf(_T("%d"),resultSize);
+                       tempString.Printf(_T("%d"),numberOfPixels);
+
                        interfMainPanel::getInstance()->setCellValueInfoPanel(z, tmpIntA, tempString);  
 
                        tempString.Printf(_T("%d"),resultGrayRangeCount);
@@ -2699,7 +2711,9 @@ void wxContourMainFrame::SaveValuesXYZ(std::string directory,std::string namefil
                        pLstValuePosX.clear();
                        pLstValuePosY.clear();
                        pLstValuePosZ.clear();
-                       _contourextractdata->GetValuesInsideCrown(      &pLstValue,
+                       int numberOfPixels;
+                       _contourextractdata->GetValuesInsideCrown(      &numberOfPixels,
+                                                                                                               &pLstValue,
                                                                                                                &pLstValuePosX,
                                                                                                                &pLstValuePosY,
                                                                                                                &pLstValuePosZ);
index 77a3ebe607768dff22cc7806d8d9a856cfbd0ccc..d73d2e75290b05727067598dd2540ab4f8b64b85 100644 (file)
@@ -370,6 +370,8 @@ class wxContourMainFrame : public wxPanel {
        void SetFileLocation(std::string newFileLocation);
 //------------------------------------------------------------------------------------------------------------
 
+       void SetScalarRange(int grayRangeMin, int grayRangeMax);
+
 //------------------------------------------------------------------------------------------------------------
        
 private: