From eadfc36256b2a77d2c3073d9249ce3020c2f554b Mon Sep 17 00:00:00 2001 From: Eduardo Davila Date: Mon, 14 Dec 2009 16:59:31 +0000 Subject: [PATCH] *** empty log message *** --- .../interfMainPanel.cxx | 5 +++ .../interfMainPanel.h | 1 + .../interfToolsPanels.cxx | 44 ++++++++++++++----- .../interfToolsPanels.h | 4 +- .../wxContourMainFrame.cxx | 22 ++++++++-- .../wxContourMainFrame.h | 2 + 6 files changed, 61 insertions(+), 17 deletions(-) diff --git a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx index 5e5f84f..6f5dd53 100644 --- a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx +++ b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx @@ -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) { diff --git a/lib/Interface_Icons_NDimensions/interfMainPanel.h b/lib/Interface_Icons_NDimensions/interfMainPanel.h index 83911f7..90d2a30 100644 --- a/lib/Interface_Icons_NDimensions/interfMainPanel.h +++ b/lib/Interface_Icons_NDimensions/interfMainPanel.h @@ -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); diff --git a/lib/Interface_Icons_NDimensions/interfToolsPanels.cxx b/lib/Interface_Icons_NDimensions/interfToolsPanels.cxx index c4a05d0..24c7939 100644 --- a/lib/Interface_Icons_NDimensions/interfToolsPanels.cxx +++ b/lib/Interface_Icons_NDimensions/interfToolsPanels.cxx @@ -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(); diff --git a/lib/Interface_Icons_NDimensions/interfToolsPanels.h b/lib/Interface_Icons_NDimensions/interfToolsPanels.h index e0784f2..85b05d6 100644 --- a/lib/Interface_Icons_NDimensions/interfToolsPanels.h +++ b/lib/Interface_Icons_NDimensions/interfToolsPanels.h @@ -85,9 +85,9 @@ private: void onShowResultImages(wxCommandEvent& event); void onSaveResults(wxCommandEvent& event); void onContourGroup(wxCommandEvent& event); - void FillGridWithContoursInformation(); - + void onRangeSliceInformation(wxCommandEvent& event); + diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index 1957a9e..e86dc1b 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -2304,6 +2304,11 @@ std::vector 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); diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h index 77a3ebe..d73d2e7 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h @@ -370,6 +370,8 @@ class wxContourMainFrame : public wxPanel { void SetFileLocation(std::string newFileLocation); //------------------------------------------------------------------------------------------------------------ + void SetScalarRange(int grayRangeMin, int grayRangeMax); + //------------------------------------------------------------------------------------------------------------ private: -- 2.47.1