X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOWxGimmickTools.cpp;h=6bbcec286eefaba0de0912f21b2ee2f1ea43fd28;hb=6dc7534dff25fd12b882ac520c4befdbaf9d4709;hp=d0392f50e3633a6c4315f2f89f27ffe5e7f8bd33;hpb=93692028fda538964e7ce2216e08b04d600b7a5e;p=creaImageIO.git diff --git a/src2/creaImageIOWxGimmickTools.cpp b/src2/creaImageIOWxGimmickTools.cpp index d0392f5..6bbcec2 100644 --- a/src2/creaImageIOWxGimmickTools.cpp +++ b/src2/creaImageIOWxGimmickTools.cpp @@ -1,5 +1,6 @@ #include + namespace creaImageIO { /** @@ -10,24 +11,28 @@ namespace creaImageIO { _currentDir = mCurrentDirectory; _addFiles = true; + _mhd = false; - _inputPath = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxSize(150,30)); - _outputPath = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxSize(150,30)); - _addCheckBox = new wxCheckBox(this, -1, _T("Add Images to Database?") ); + _inputPath = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxSize(400,30)); + _outputPath = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxSize(400,30)); + _addCheckBox = new wxCheckBox(this, -1, _T("Add Images to Database?") ); + _mhdCheckBox = new wxCheckBox(this, -1, _T("Convert to MHD?") ); _addCheckBox->SetValue(_addFiles); + _mhdCheckBox->SetValue(_mhd); - wxButton *inputDir = new wxButton(this,wxID_ANY,_T("Input Directory"), wxDefaultPosition, wxSize(150,30) ); - wxButton *outputDir = new wxButton(this,wxID_ANY,_T("Output Directory"), wxDefaultPosition, wxSize(150,30) ); + wxButton *inputDir = new wxButton(this, wxID_ANY,_T("Input Directory"), wxDefaultPosition, wxSize(140,30) ); + wxButton *outputDir = new wxButton(this, wxID_ANY,_T("Output Directory"), wxDefaultPosition, wxSize(140,30) ); Connect( inputDir->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxGimmickTools::onInputDir ); Connect( outputDir->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxGimmickTools::onOutputDir ); Connect( _addCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxGimmickTools::onAddToDatabase ); + Connect( _mhdCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxGimmickTools::onMHD ); + + wxFlexGridSizer *textSizer = new wxFlexGridSizer(1,2); + textSizer->Add( new wxStaticText(this, -1, _T("Transform a Bruker image into Dicom / MHD format.")), 1, wxGROW ); + textSizer->Add( new wxStaticText(this, -1, _T("If checkbox is selected images will be loaded into the DB.")), 1, wxGROW ); - wxFlexGridSizer * textSizer = new wxFlexGridSizer(1,2); - textSizer->Add( new wxStaticText(this,-1,_T("Transform a Bruker image into Dicom format.")) , 1, wxGROW ); - textSizer->Add( new wxStaticText(this,-1,_T("If checkbox is selected images will be loaded into the DB.")) , 1, wxGROW ); - - wxFlexGridSizer * sizer = new wxFlexGridSizer(2,5); + wxFlexGridSizer *sizer = new wxFlexGridSizer(2,5); sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW ); sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW ); sizer->Add( _inputPath, 1, wxGROW ); @@ -37,10 +42,11 @@ namespace creaImageIO sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW ); sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW ); sizer->Add( _addCheckBox, 1, wxGROW ); - + sizer->Add( _mhdCheckBox, 1, wxGROW ); + wxFlexGridSizer *topSizer = new wxFlexGridSizer(1, 2); topSizer->Add( textSizer, 1, wxGROW ); - topSizer->Add( sizer, 1, wxGROW ); + topSizer->Add( sizer, 1, wxGROW ); this->SetSizer( topSizer ); this->SetAutoLayout( true ); this->Layout(); @@ -61,10 +67,15 @@ namespace creaImageIO return _outputPath->GetValue(); } - bool WxGimmickTools::getCheckBoxValue() + bool WxGimmickTools::getAddToDBCheckBoxValue() { return _addCheckBox->GetValue(); } + + bool WxGimmickTools::getMHDCheckBoxValue() + { + return _mhdCheckBox->GetValue(); + } void WxGimmickTools::onInputDir(wxCommandEvent& event) { @@ -92,6 +103,11 @@ namespace creaImageIO { _addFiles = _addCheckBox->GetValue(); } + + void WxGimmickTools::onMHD(wxCommandEvent& event) + { + _mhd = _mhdCheckBox->GetValue(); + } } // EO namespace creaImageIO