From b467cd27f8b79c7e33d1f44dd4eaaf4030c65151 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Tue, 30 May 2017 14:54:41 +0200 Subject: [PATCH] #3094 creaContours Bug New Normal - Contour information in pixels and image units (spc) -> creaMaracasVisu modification --- .../wxContourMainFrame.cxx | 34 ++++++++++++++++--- .../wxContourMainFrame.h | 14 ++++---- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index 617dce5..3d4413b 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -1194,11 +1194,22 @@ void wxContourMainFrame::saveFileWithContours( std::string filename ) fprintf(pFileData,"NumberOfContours %d\n", sizeLstNameThings ); //------------------------------------------------------------------------------------------------------------ + +// EED 2017-05-30 + double spc[3]; + spc[0]=1; + spc[1]=1; + spc[2]=1; + for (i=0 ; igetOutlineByKeyName(lstNameThings[i]); - double sizeInPixel = manualModel ->GetPathSize(); + +// EED 2017-05-30 +// double sizeInPixel = manualModel ->GetPathSize( ); + double sizeInPixel = manualModel ->GetPathSize( spc ); + double realContourSize = sizeInPixel*_onePixelSize; manualModel ->SetRealSize(realContourSize); //------------------------------------------------------------------------------------------------------------ @@ -3227,10 +3238,18 @@ double wxContourMainFrame::getContourSizeInPixels() std::string cloneName = currentSelection [0]; manualBaseModel * manualModel = kernelManager->getOutlineByKeyName(cloneName);//_modelManager->getOutlineByKeyName( cloneName )->getModel(); - contourSize = manualModel-> GetPathSize(); + +// EED 2017-05-30 +// contourSize = manualModel->GetPathSize(); + double spc[3]; + spc[0]=1; + spc[1]=1; + spc[2]=1; + contourSize = manualModel->GetPathSize( spc ); } return contourSize; } + manualBaseModel * wxContourMainFrame::getContour () { std::vector currentSelection = _theViewPanel->getSelectedObjects(); @@ -3260,9 +3279,16 @@ void wxContourMainFrame::onPrintLabel (wxString label, manualBaseModel* manualMo } void wxContourMainFrame::onInsertCalculation(manualBaseModel* manualModel) { - double sizeInPixel = manualModel ->GetPathSize(); +// EED 2017-05-30 +// double sizeInPixel = manualModel ->GetPathSize( ); + double spc[3]; + spc[0]=1; // ???? + spc[1]=1; // ???? + spc[2]=1; // ???? + double sizeInPixel = manualModel ->GetPathSize( spc ); + double onePixelRealSize = interfMainPanel::getInstance()->GetPixelValue();; - double realContourSize = sizeInPixel*onePixelRealSize; + double realContourSize = sizeInPixel*onePixelRealSize; manualModel ->SetRealSize(realContourSize); } diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h index ba7da1b..934238e 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h @@ -379,16 +379,16 @@ private: wxAuiManager m_mgr; wxAuiNotebook *notebook; - long m_notebook_style; - long m_notebook_theme; - int _numberOfVariablesStatistics; + long m_notebook_style; + long m_notebook_theme; + int _numberOfVariablesStatistics; // Contour Image Mask ThresholdImageView *_viewMaskImage; ThresholdImageViewPanel *_viewMaskImagePanel; // Threshold Image - ThresholdImageView *_viewThresholdImage; + ThresholdImageView *_viewThresholdImage; ThresholdImageViewPanel *_viewThresholdImagePanel; // Color Layer Image @@ -397,9 +397,9 @@ private: bool _actorPresent; // temporary variables readding .roi file - int _tmpReadFileImageDim[3]; - double _tmpReadFileImageSpac[3]; - int _tmpReadFileTypeOfTransformation; + int _tmpReadFileImageDim[3]; + double _tmpReadFileImageSpac[3]; + int _tmpReadFileTypeOfTransformation; void readDimSpc(FILE *pFile, bool interactiveOption); -- 2.45.0