#include "ColorLayerImageViewPanel.h"
#include "OpenImageDialog.h"
-
+#include <wx/string.h>
//---------------------------------------------------------
//---------------------------------------------------------
}
-void wxDlgTransformByDimensionBySpacingByPixel::GetTransformType(wxWindow *parent , wxString message,int &typeOfTransformation,bool &dlgWxOK)
+void wxDlgTransformByDimensionBySpacingByPixel::GetTransformType(
+ wxWindow *parent ,
+ double baseSpc[3],
+ double layerSpc[3],
+ int baseDim[3],
+ int layerDim[3],
+ wxString message,
+ int &typeOfTransformation,
+ bool &dlgWxOK)
{
- wxDialog* dial = new wxDialog (parent,-1,_T("Tools"),wxDefaultPosition, wxSize(590,190));
+ wxDialog* dial = new wxDialog (parent,-1,_T("Tools"),wxDefaultPosition, wxSize(500,550),wxRESIZE_BORDER);
wxSizer* buttonsSizer = dial->CreateSeparatedButtonSizer(wxOK|wxCANCEL);
wxBoxSizer *dialSizer = new wxBoxSizer(wxVERTICAL);
lstOptOperation[0]=_T("By Dimension");
lstOptOperation[1]=_T("By Spacing");
lstOptOperation[2]=_T("By Pixel");
- wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(270,45), 3 , lstOptOperation, 3, wxRA_SPECIFY_COLS);
-
- dialSizer->Add( new wxStaticText(dial,-1,message) , 0, wxGROW );
- dialSizer->Add( new wxStaticText(dial,-1,_T(" ")) , 0, wxGROW );
+ wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(250,90), 3 , lstOptOperation, 3, wxRA_SPECIFY_COLS);
+
+ wxString str;
+ wxString strBaseSpc(str);
+ wxString strLayerSpc;
+ wxString strBaseDim;
+ wxString strLayerDim;
+
+ strBaseSpc.Printf(wxT("Base spacing: %f %f %f"), baseSpc[0],baseSpc[1],baseSpc[2] );
+ strLayerSpc.Printf(wxT("Layer spacing: %f %f %f"), layerSpc[0],layerSpc[1],layerSpc[2] );
+ strBaseDim.Printf(wxT("Base dimension: %d %d %d"), baseDim[0],baseDim[1],baseDim[2] );
+ strLayerDim.Printf(wxT("Layer dimension: %d %d %d"), layerDim[0],layerDim[1],layerDim[2] );
+
+ dialSizer->Add( new wxStaticText(dial,-1,message ) , 0, wxGROW );
+ dialSizer->Add( new wxStaticText(dial,-1,_T(" ") ) , 0, wxGROW );
+ dialSizer->Add( new wxStaticText(dial,-1, strBaseSpc ) , 0, wxGROW );
+ dialSizer->Add( new wxStaticText(dial,-1, strLayerSpc ) , 0, wxGROW );
+ dialSizer->Add( new wxStaticText(dial,-1,_T(" ") ) , 0, wxGROW );
+ dialSizer->Add( new wxStaticText(dial,-1, strBaseDim ) , 0, wxGROW );
+ dialSizer->Add( new wxStaticText(dial,-1, strLayerDim ) , 0, wxGROW );
+ dialSizer->Add( new wxStaticText(dial,-1,_T(" ") ) , 0, wxGROW );
+ dialSizer->Add( new wxStaticText(dial,-1,message ) , 0, wxGROW );
+ dialSizer->Add( new wxStaticText(dial,-1,_T(" ") ) , 0, wxGROW );
dialSizer->Add(radioOpts,0,wxGROW);
- dialSizer->Add( new wxStaticText(dial,-1,_T(" ")) , 0, wxGROW );
+ dialSizer->Add( new wxStaticText(dial,-1,_T(" ") ) , 0, wxGROW );
dialSizer->Add(buttonsSizer,0,wxGROW);
dial->SetSizer(dialSizer, true);
dial->Layout();
dial->ShowModal();
typeOfTransformation = -1;
- dlgWxOK = false;
+ dlgWxOK = false;
if (dial->GetReturnCode() == wxID_OK)
{
typeOfTransformation = radioOpts->GetSelection() + 1;
- dlgWxOK = true;
+ dlgWxOK = true;
}
}
_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") );
_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);
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
(dim[0]!=_dimBase[0]) || (spc[1]!=_spcBase[1]) || (spc[2]!=_spcBase[2])
)
{
- // CM
- 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;
- //EO CM
+ // CM
+ 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,spc,spc,dim,dim,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;
+ } // _fitting_mode -1
+
+printf("EED ColorLayerImageViewPanel::SetImage %d\n", typeOfTransformation );
+
+ //EO CM
if (typeOfTransformation==1) // make dimensions equals
{
printf("EED ColorLayerImageViewPanel::onReadImage ...WARNNING.... dif size image spc*dim ofnew image ...???\n");