From: Eduardo DAVILA Date: Fri, 18 Jun 2021 05:45:20 +0000 (+0200) Subject: #3467 Bug: InvertCrop Dimension of 2D or 3D X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9bf93d26c92029689cb5da02822edb68d5835864;p=bbtk.git #3467 Bug: InvertCrop Dimension of 2D or 3D --- diff --git a/packages/vtk/src/bbvtkInversCrop.cxx b/packages/vtk/src/bbvtkInversCrop.cxx index 68b2b1c..8a4bb33 100644 --- a/packages/vtk/src/bbvtkInversCrop.cxx +++ b/packages/vtk/src/bbvtkInversCrop.cxx @@ -113,15 +113,20 @@ printf("EED InversCrop::Process 2 %d %d %d \n",dim[0],dim[1],dim[2] ); spxM = px*(-1); px = 0; } - sizeXM = dimMoveX-spxM; - if (px+sizeXM>=dim[0]) sizeXM=dim[0]-px; - sizeXM = sizeXM * bbGetInputImageFix()->GetScalarSize(); + sizeXM = dimMoveX-spxM; + if (px+sizeXM>=dim[0]) { sizeXM=dim[0]-px; } + sizeXM = sizeXM * bbGetInputImageFix()->GetScalarSize(); for (k=0; kGetDataDimension()==3) + { + pz = k+bbGetInputOrigin()[2]; + } else { + pz = k; + }// Dimension 3 if ( (py=0) && (pz>=0) && (sizeXM>0) ) @@ -131,6 +136,8 @@ printf("EED InversCrop::Process 2 %d %d %d \n",dim[0],dim[1],dim[2] ); } // for j } // for k +printf("EED InversCrop::Process 4 %d %d %d \n",px,py,pz ); + _imageoutput->Modified(); } else { // If Image Fixe Move the same GetScalarType printf ("ERROR: InversCrop both ImageFixe and ImageMove need the same format.\n"); diff --git a/packages/wx/src/bbwxComboBox.cxx b/packages/wx/src/bbwxComboBox.cxx index e1883ac..0a1a99e 100644 --- a/packages/wx/src/bbwxComboBox.cxx +++ b/packages/wx/src/bbwxComboBox.cxx @@ -183,7 +183,7 @@ void ComboBoxWidget::OnSpinCtrlClick(wxCommandEvent& event) //-------------------------------------------------------------------------- void ComboBoxWidget::FillItems( int iSelection, std::vector< std::string > lstIn ) { - int i,size=lstIn.size(); + int i,size = lstIn.size(); #if defined(_WIN32) @@ -240,8 +240,9 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ComboBox,bbtk::WxBlackBox); void ComboBox::Process() { int iSelection = bbGetInputSelection(); - if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=bbGetInputIn().size()-1; } -// if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=0; } + printf("ComboBox::Process A iSelection=%d\n", iSelection); +// if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=bbGetInputIn().size()-1; } + if (bbGetInputSelection() >= bbGetInputIn().size()) { iSelection=0; } ComboBoxWidget *w = (ComboBoxWidget*)bbGetOutputWidget(); w->FillItems( iSelection, bbGetInputIn() ); bbSetInputSelection( iSelection ); @@ -251,6 +252,7 @@ void ComboBox::Process() { bbSetOutputOutString( bbGetInputIn()[ iSelection ] ); } // if iSelection + printf("ComboBox::Process B iSelection=%d\n", iSelection); w->VerifyDeselect(iSelection); } //=====