]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx
#2855 creaMaracasVisu Bug New Normal - ColorLayer box spacing size not identified
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / ThresholdImageView / ColorLayerImageViewPanel.cxx
index cad61bd9c6b7382f286c5db306b61b9f288bcddb..b0fd0bb8a0155e23e363cd362da8855d70ade338 100644 (file)
@@ -105,11 +105,12 @@ printf("EED ColorLayerImageViewPanel::ColorLayerImageViewPanel Start\n");
        _histogram                              = NULL;
        _histogramMinMaxLevel   = NULL;
 
-       wxFlexGridSizer * sizer         = new wxFlexGridSizer(1);
+       wxFlexGridSizer * sizer         = NULL;
        _colorLayerImageViewManager     = new ColorLayerImageViewManager();
 
        if (type==1)
        {
+               sizer                                                   = new wxFlexGridSizer(1);
                _btn_ReadImage                                  = new wxButton(this, wxID_ANY, _T("Read Image") );
                _thresholdGo                                    = true;
                _cb_ShowHide                                    = new wxCheckBox(this, wxID_ANY, _T("Show/Hide Layer") );
@@ -125,7 +126,7 @@ printf("EED ColorLayerImageViewPanel::ColorLayerImageViewPanel Start\n");
                _sl_SliceImageX->Enable(false);
                _sl_SliceImageY->Enable(false);
                _sl_SliceImageZ->Enable(false);
-               _interpolationCheckBox = new wxCheckBox(this, -1, _T("Image Interpolation") );
+               _interpolationCheckBox = new wxCheckBox(this, -1, _T("Interpole") );
                _interpolationCheckBox->SetValue(true);
                _opacity = new wxSlider(this, wxID_ANY, 6, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
 
@@ -179,12 +180,16 @@ printf("EED ColorLayerImageViewPanel::ColorLayerImageViewPanel Start\n");
 
        if (type==2)
        {
-               _opacity = new wxSlider(this, wxID_ANY, 6, 1, 10, wxDefaultPosition, wxSize(2,40), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+               sizer                                                   = new wxFlexGridSizer(2);
+               _interpolationCheckBox = new wxCheckBox(this, -1, _T("Interpolate") );
+               _interpolationCheckBox->SetValue(true);
+               _opacity = new wxSlider(this, wxID_ANY, 6, 0, 10, wxDefaultPosition, wxSize(2,40), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+
+               Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &ColorLayerImageViewPanel::onThresholdInterpolation );
                Connect( _opacity->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &ColorLayerImageViewPanel::onChangeOpacity );
 //             sizer -> Add( new wxStaticText(this,-1,_T("Opacity Level"))                     , 1, wxEXPAND );
-//             sizer -> Add( _opacity, 1, wxGROW );
-//             sizer -> Add( new wxStaticText(this,-1,_T("Opacity Level"))  );
-               sizer -> Add( _opacity ,1,wxGROW  );
+               sizer -> Add( _opacity                                  , 1, wxGROW );
+               sizer -> Add( _interpolationCheckBox    , 1, wxGROW );
                sizer->AddGrowableCol(0);
 
        } // type==2
@@ -280,17 +285,22 @@ void ColorLayerImageViewPanel::SetImage(vtkImageData *img)
          int typeOfTransformation;     
          // In case of the option is set to create a dialog box.
          if (_fitting_mode == -1)
-           {
-             bool transformOkDlg;
-             wxString msg = _T("The image resolution of both images are not compatible. Do you want to tranform it? ");
-             wxDlgTransformByDimensionBySpacingByPixel dlg;
-             dlg.GetTransformType(this,msg,typeOfTransformation,transformOkDlg);
-             // CM Reset the default value (Pixel i.e. 3) if the dialog box returned an inappropriate value.
-             if (transformOkDlg == false)
-               typeOfTransformation = 3;
-           }
-         else
-           typeOfTransformation = _fitting_mode;
+         {
+               bool transformOkDlg;
+           wxString msg = _T("The image resolution of both images are not compatible. Do you want to tranform it? ");
+           wxDlgTransformByDimensionBySpacingByPixel dlg;
+           dlg.GetTransformType(this,msg,typeOfTransformation,transformOkDlg);
+           // CM Reset the default value (Pixel i.e. 3) if the dialog box returned an inappropriate value.
+           if (transformOkDlg == false)
+               {
+               typeOfTransformation = 3;
+               } 
+          } else {
+               typeOfTransformation = _fitting_mode;
+         }
+
+printf("EED ColorLayerImageViewPanel::SetImage %d\n", typeOfTransformation );
+
          //EO CM
             if (typeOfTransformation==1)  // make dimensions equals
             {