]> Creatis software - creaContours.git/commitdiff
#3382 Change Init parameters
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Mon, 17 Jan 2022 06:41:42 +0000 (07:41 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Mon, 17 Jan 2022 06:41:42 +0000 (07:41 +0100)
bbtk/src/bbCreaContournDimensions.cxx
lib/Interface_Icons_NDimensions/interfToolsPanels.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
lib/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.cxx
lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx
lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx

index 6d8890d131b6ac676bbd9fce8acaf3a9dad45cdd..8aad345e44e55ce97664e87428f594a742ee1ae9 100644 (file)
@@ -43,7 +43,7 @@ void nDimensions::Process()
        std::vector<vtkImageData*> selectedimages;
        if(img!=NULL && currentimg!=img)
        {
-               wxContourMainFrame::getInstance()->ShowToolsPanel(true);
+        wxContourMainFrame::getInstance()->ShowToolsPanel(true);
                currentimg=img;
                selectedimages.push_back(img);
                wxContourMainFrame::getInstance()->setVectImages(selectedimages);
@@ -55,10 +55,7 @@ void nDimensions::Process()
                //wxContourMainFrame::getInstance()->getValuesXYZ(vectx, vecty, vectz, &size);
                //wxContourMainFrame::getInstance()->getMaskValue(mask, value, contourtype);
        } // if currentimg
-
     wxContourMainFrame::getInstance()->RefreshInterface();
-
-
     bbSetOutputwxContourMainFrame( wxContourMainFrame::getInstance() );
 //     bbSetOutputX(vectx);
 //     bbSetOutputY(vecty);
@@ -71,6 +68,7 @@ void nDimensions::Process()
 //-----------------------------------------------------------------
 void nDimensions::CreateWidget(wxWindow* parent)
 {
+    printf("EED nDimensions::CreateWidget Start \n");
        //vtkImageData* img = bbGetInputIn();
 
        std::vector<vtkImageData*> selectedimages;
@@ -104,13 +102,15 @@ printf("EED WARNING Verify that GetDllAppPath in  nDimensions::CreateWidget bbCr
        wxContourMainFrame* wxcontourmainframe = wxContourMainFrame::getInstance(parent, wxID_ANY, wxString(_T("")), wxPoint(100,50), wxSize(800, 600), selectedimages,wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER,datadir );
        wxContourMainFrame::getInstance()->ShowToolsPanel(false);
 
-//             bbSetOutputWidget( new wxPanel(parent,-1) );
                bbSetOutputWidget( wxcontourmainframe    );
+    printf("EED nDimensions::CreateWidget End %p\n", wxcontourmainframe);
+
 }
 
 //-----------------------------------------------------------------
 void nDimensions::bbUserSetDefaultValues()
 {
+    currentimg=NULL;
        bbSetInputContourType(0);
        bbSetInputIn(NULL);
 }
index 671047dda4d1abd67e819701e4e58df8bb692e59..8f57f3442a7d4043dee833fa43a501bbe1e21af1 100644 (file)
@@ -30,7 +30,7 @@ interfConfigurationPanel::interfConfigurationPanel(wxWindow * parent)
 : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
 {
 //     wxPanel *panel                                                  = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxNO_BORDER, wxString(_T("")));
-       _withOfContourLine                                              = new wxSlider(this, -1, 1 , 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+       _withOfContourLine                                              = new wxSlider(this, -1, 3 , 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
 
        double range[2];
        interfMainPanel::getInstance()->getImageRange(range);
@@ -55,7 +55,7 @@ interfConfigurationPanel::interfConfigurationPanel(wxWindow * parent)
        _interpolationCheckBox->SetValue(true);
 
        _showTextContourCheckBox                                = new wxCheckBox(this, -1, _T("Labels") );
-       _showTextContourCheckBox->SetValue(true);
+       _showTextContourCheckBox->SetValue(false);
 
        _beforContourCheckBox                                   = new wxCheckBox(this, -1, _T("Befor Contour") );
        _beforContourCheckBox->SetValue(false);
@@ -280,7 +280,6 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent)
 //: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
 : wxPanel(parent, -1)
 {
-printf("EED interfInformationPanel::interfInformationPanel Start\n");
        //wxPanel *panel                                                                        = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxTAB_TRAVERSAL);
        wxString lstOptions[4];
        lstOptions[0]=_T("Current Slice");
@@ -297,9 +296,6 @@ printf("EED interfInformationPanel::interfInformationPanel Start\n");
        _radiolstboxContourGroup->SetSelection(1);
        Connect( _radiolstboxContourGroup->GetId(), wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &interfInformationPanel::onContourGroup );
 
-printf("EED interfInformationPanel::interfInformationPanel 1\n");
-
-
        _XYZValues      = new wxCheckBox(this, -1, _T("Save Contour Values") );
        _XYZValues->SetValue(true);
        _contourImage   = new wxCheckBox(this, -1, _T("Extract Contours as Images") );
@@ -313,7 +309,6 @@ printf("EED interfInformationPanel::interfInformationPanel 1\n");
        informationContourLabelsBtn->SetEventHandler( this );
 #else
        //      informationContourLabelsBtn->SetEventHandler( this );
-       printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo informationContourLabelsBtn->SetEventHandler \n");
 #endif
        Connect( informationContourLabelsBtn->GetId(),          wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onInformationContourLabels );
 
@@ -322,7 +317,6 @@ printf("EED interfInformationPanel::interfInformationPanel 1\n");
        statisticsContourBtn->SetEventHandler( this );
 #else
        //statisticsContourBtn->SetEventHandler( this );
-       printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo statisticsContourBtn->SetEventHandler \n");
 #endif
        Connect( statisticsContourBtn->GetId(),         wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onExtractInformation );
 
@@ -331,7 +325,6 @@ printf("EED interfInformationPanel::interfInformationPanel 1\n");
        showResultImagesBtn->SetEventHandler( this );
 #else
        //showResultImagesBtn->SetEventHandler( this );
-       printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo showResultImagesBtn->SetEventHandler \n");
 #endif
        Connect( showResultImagesBtn->GetId(),          wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onShowResultImages );
 
@@ -340,13 +333,10 @@ printf("EED interfInformationPanel::interfInformationPanel 1\n");
        saveResultsBtn->SetEventHandler( this );
 #else
 //EED  saveResultsBtn->SetEventHandler( this );
-printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo saveResultsBtn->SetEventHandler \n");
 #endif
 
        Connect( saveResultsBtn->GetId(),               wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults );
-
        int sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ();
-
        //_theViewPanel->getSceneManager()->GetImageDataSizeZ();
        _mbarrangeSliceInformation                      =  new mBarRange(this,65,65);
        _mbarrangeSliceInformation->SetMin(0);
@@ -360,14 +350,10 @@ printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo saveRes
        _mbarrangeSliceInformation->setIfWithActualDrawed( false );
        _mbarrangeSliceInformation->SetStart( 0 );
        _mbarrangeSliceInformation->SetEnd( sizeZ-1 );
-
        double range[2];
        interfMainPanel::getInstance()->getImageRange(range);
-printf("EED interfInformationPanel::interfInformationPanel 2\n");
-
        int min = (int)floor (range[0]);
        int max = (int)ceil (range[1]);
-
        _mbarrangeRangeInformation      =  new mBarRange(this,65,65);
        _mbarrangeRangeInformation->SetMin(0);
        _mbarrangeRangeInformation->SetStart(0);
@@ -380,7 +366,6 @@ printf("EED interfInformationPanel::interfInformationPanel 2\n");
        _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 );
@@ -388,9 +373,6 @@ printf("EED interfInformationPanel::interfInformationPanel 2\n");
        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 );
-
-
-printf("EED interfInformationPanel::interfInformationPanel 3\n");
        _staticTextInformation  = new wxStaticText(this,-1,_T("    "));
        _grid = new wxGrid( this,
                 wxID_ANY,
@@ -407,7 +389,6 @@ printf("EED interfInformationPanel::interfInformationPanel 3\n");
 //                     _grid->SetColLabelSize(0);
        FillGridWithContoursInformation();
 
-
 //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
 #if wxMAJOR_VERSION <= 2
        wxFlexGridSizer * sizerSave             = new wxFlexGridSizer(2,2);
@@ -419,8 +400,6 @@ printf("EED interfInformationPanel::interfInformationPanel 3\n");
        sizerSave->Add( _statistics,   1, wxALL, 2 );
        sizerSave->Add( _contourImage, 1, wxALL, 2 );
 
-
-printf("EED interfInformationPanel::interfInformationPanel 4\n");
 //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
 #if wxMAJOR_VERSION <= 2
        wxFlexGridSizer * sizerA                = new wxFlexGridSizer(10);
@@ -449,30 +428,20 @@ printf("EED interfInformationPanel::interfInformationPanel 4\n");
 #else
        wxFlexGridSizer * sizer         = new wxFlexGridSizer(20,1,0,0);
 #endif
-printf("EED interfInformationPanel::interfInformationPanel 5\n");
        sizer->Add( sizerA                     , 1, wxALL               , 0 );
-printf("EED interfInformationPanel::interfInformationPanel 5.1\n");
        sizer->Add( new wxStaticText(this      ,1,_T("Slice Range"))    , 1, wxALL , 0 );
-printf("EED interfInformationPanel::interfInformationPanel 5.2\n");
        sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW        , 2 );
-printf("EED interfInformationPanel::interfInformationPanel 5.3\n");
        sizer->Add( new wxStaticText(this      ,1,_T("Gray Range"))     , 1, wxALL , 0 );
-printf("EED interfInformationPanel::interfInformationPanel 5.4\n");
        sizer->Add( _mbarrangeRangeInformation , 1, wxALL|wxGROW        , 2 );
-       
-       
-       sizer->Add( sizerB                     , 1, wxEXPAND            , 0 );
+
+    sizer->Add( sizerB                     , 1, wxEXPAND               , 0 );
        sizer->Add( _staticTextInformation     , 1, wxEXPAND            , 0 );
        sizer->Add( _grid                      , 1, wxEXPAND            , 0 );
        this->SetSizer( sizer );
        this->SetSize( wxSize(1500,1500) );
        this->SetAutoLayout( true );
-printf("EED interfInformationPanel::interfInformationPanel 5.10\n");
        this->Layout();
        //return panel;
-
-printf("EED interfInformationPanel::interfInformationPanel End\n");
-
 }
 
 interfInformationPanel::~interfInformationPanel()
index 6e93fadb4224064ba277a8404199059646aae5ef..7eab8c93249c7203b05e7d9740ddd262fcd5a30d 100644 (file)
@@ -159,7 +159,7 @@ void wxContourMainFrame::setVectImages(std::vector<vtkImageData*> imgs)
 }
 
 
-       wxContourMainFrame* wxContourMainFrame :: getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir )
+       wxContourMainFrame* wxContourMainFrame::getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir )
        {
                if(instance == NULL)
                {
@@ -214,9 +214,9 @@ void wxContourMainFrame::setVectImages(std::vector<vtkImageData*> imgs)
        //
        wxAuiNotebook * wxContourMainFrame::createNotebook()
        {
-               wxSize client_size = GetClientSize();
+               wxSize client_size      = GetClientSize();
                wxAuiNotebook* noteBook = new wxAuiNotebook(this, -1, wxPoint(client_size.x, client_size.y), wxSize(430,200), m_notebook_style);
-               wxBitmap page_bmp = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
+               wxBitmap page_bmp       = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
                return noteBook;
        }
 
index e47a1ad1563426eeb050887f96eef944aa5cd065..7622e8bcab14ddc9621f66407254a2ec4f60fd63 100644 (file)
@@ -66,7 +66,7 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHOOSER_CHANGE )
                //_configuration = "CCCc";
                //setVerticalMaxSelectedNums( "1 2 3 3 ");//groupConfig );
 
-               SetSize(300,300);
+               SetSize(300,50);
                _outSizer = new wxFlexGridSizer ( 1, 10, 10);
                _orientation = theOrientation;
                initializeResolutionSlider();
index 7d9c22cb8222b1524c5891e5d5537b6a14f1eee1..78b568ab7438217f2799f9056339daa9ac6282ff 100644 (file)
@@ -79,8 +79,8 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP )
                _waiting                                                = false;
                _creatingROI                                    = false;
                _drawingSelectionROI                    = false;
-               _showTextContour                                = true;
-               SetWidthContour(1.0);   
+               _showTextContour                                = false;
+               SetWidthContour( 3.0/2 );
                _wxVtk_BaseView = theWxBaseViewToManage;
                if( _wxVtk_BaseView!=NULL )
                {
index a1cf210c43e803ddcbeec536e969fc3e31b72a11..8e9f1d8e3663b3c498ae5d7327eb2c4635c13e7d 100644 (file)
@@ -59,12 +59,12 @@ KernelManagerContour::KernelManagerContour(std::vector<vtkImageData*> images,std
 /**THIS ALL SHOULD BE IN AN OTHER LIB CALLED PERSISTANCE
 **
 **/
+    time_t  seconds;
+    seconds     = time (NULL);
+    int time    = seconds;
        inredo          = 0;
        inundo          = 0;
-       time_t seconds;
-       seconds         = time (NULL);
-       int time        = seconds;
-       stundoredo = tmpdir+"/temp"+intToString(time);
+       stundoredo  = tmpdir+"/temp"+intToString(time);
        _currentIndex = 0;
        _contourPropagation = NULL;
 #if(WIN32)
@@ -124,24 +124,22 @@ void KernelManagerContour::setVectImages(std::vector<vtkImageData*> vectimg)
 
 void KernelManagerContour::GetSpacing(double *vecspc, int iImage)
 {
-       vecspc[0]=vectimagesSpacing[iImage][0];
-       vecspc[1]=vectimagesSpacing[iImage][1];
-       vecspc[2]=vectimagesSpacing[iImage][2];
+       vecspc[0] = vectimagesSpacing[iImage][0];
+       vecspc[1] = vectimagesSpacing[iImage][1];
+       vecspc[2] = vectimagesSpacing[iImage][2];
 }
 
 void KernelManagerContour::initializeEnvironment(std::string datadir)
 {
-       _datadir = datadir;
-       std::string conceptsFN                  =  datadir+"holaConceptsFile.cf";
-       std::string imageSourcesFN              =  datadir+"holaImagesInstantsFile.of";
-       std::string imageSectionsFN             = "";
-       std::string axeThingsFN                 = "";
-
-       std::map<std::string, ImageSourceThing *> * sourcesMap          = new std::map<std::string, ImageSourceThing *>();
-       std::map<std::string, ImageSectionThing *>* sectionsMap         = new std::map<std::string, ImageSectionThing *>();
-       std::map<std::string, AxeThing *>* axesMap                                      = new std::map<std::string, AxeThing *>();
-       std::map<std::string, ContourThing *>* outlinesMap                      = new std::map<std::string, ContourThing *>();
-
+       _datadir                                                    = datadir;
+       std::string conceptsFN                                              = datadir+"holaConceptsFile.cf";
+       std::string imageSourcesFN                                          = datadir+"holaImagesInstantsFile.of";
+       std::string imageSectionsFN                                         = "";
+       std::string axeThingsFN                                             = "";
+       std::map<std::string, ImageSourceThing *> * sourcesMap      = new std::map<std::string, ImageSourceThing *>();
+       std::map<std::string, ImageSectionThing *>* sectionsMap     = new std::map<std::string, ImageSectionThing *>();
+       std::map<std::string, AxeThing *>* axesMap                                  = new std::map<std::string, AxeThing *>();
+       std::map<std::string, ContourThing *>* outlinesMap                  = new std::map<std::string, ContourThing *>();
        for(int i = 0; i < (int)(vectimages.size()); i++)
        {
                vtkImageData* selectedimage = vectimages[i];
@@ -149,15 +147,14 @@ void KernelManagerContour::initializeEnvironment(std::string datadir)
                std::string imgstring = "Source Image "+intToString(i+1);
                sourcesMap->insert(std::pair<std::string, ImageSourceThing *>( imgstring, thing));
        } // for
-
        OutlineModelBuilder * _builder                                                          = new OutlineModelBuilder( conceptsFN ,datadir);
        _builder->buildImageSource_Envornment( imageSourcesFN, sourcesMap );
        _builder->buildImageSection_Envornment( imageSectionsFN, sectionsMap );
        _builder->buildAxe_Envornment(axeThingsFN, axesMap );
        _builder->buildCountour_Envornment( imageSectionsFN, outlinesMap );
        //Creating the objects to manage
-       modelManager                            = new OutlineModelManager( _builder->getImSourceEnv(), _builder->getImSectionEnv(), _builder->getAxesEnv(),  _builder->getContourEnv() );
-       imageSource     = modelManager->getImageSourceThingByKeyName( "Source Image 1" );
+       modelManager = new OutlineModelManager( _builder->getImSourceEnv(), _builder->getImSectionEnv(), _builder->getAxesEnv(),  _builder->getContourEnv() );
+       imageSource      = modelManager->getImageSourceThingByKeyName( "Source Image 1" );
 }
 
 vtkImageData* KernelManagerContour::getSourceImage()