From: Eduardo DAVILA Date: Thu, 3 May 2018 09:57:08 +0000 (+0200) Subject: #3185 creaImageIO Feature New Normal - Clean code X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;p=creaImageIO.git #3185 creaImageIO Feature New Normal - Clean code --- diff --git a/bbtk/src/bbcreaImageIOGimmick.xml b/bbtk/src/bbcreaImageIOGimmick.xml index 248a868..d07a54f 100644 --- a/bbtk/src/bbcreaImageIOGimmick.xml +++ b/bbtk/src/bbcreaImageIOGimmick.xml @@ -130,16 +130,11 @@ bbSetOutputOut(m_results[0]); bbSetOutputOut2(m_results); } - std::vector files; - w.GetSelectedFiles(files); - bbSetOutputFiles(files); - - - bbSetOutputDicomInfo( m_resultsDicomAtr ); - - - - w.OnExit(); + std::vector files; + w.GetSelectedFiles(files); + bbSetOutputFiles(files); + bbSetOutputDicomInfo( m_resultsDicomAtr ); + w.OnExit(); } diff --git a/src/creaImageIOGimmickView.cpp b/src/creaImageIOGimmickView.cpp index 4ada3a9..672f922 100644 --- a/src/creaImageIOGimmickView.cpp +++ b/src/creaImageIOGimmickView.cpp @@ -489,26 +489,15 @@ void GimmickView::ReadImagesNotThreaded(std::vector& s, std::vect i_attr.outside.push_back("D0019_100a"); // simens Number Of Images In Mosaic -//EED Borrame - int i,isize=i_attr.outside.size(); - for (i=0;i::iterator it; for (it=im.begin(); it!=im.end(); ++it) { OutStrGimmick out; out.img = vtkImageData::New(); out.img->ShallowCopy(mReader.GetImage(*it)); -printf("EED GimmickView::readImages1 A\n "); if(i_attr.mult) { getAttributes((*it),out.infos,i_attr); -printf("EED GimmickView::readImages1 B %s \n ", out.infos.find("D0019_100a")->second.c_str() ); } o_output.push_back(out); } @@ -516,7 +505,6 @@ printf("EED GimmickView::readImages1 B %s \n ", out.infos.find("D0019_100a")-> if(!i_attr.mult) { getAttributes(im.front(), o_output.front().infos, i_attr); -printf("EED GimmickView::readImages1 C %s \n ", o_output.front().infos.find("D0019_100a")->second.c_str() ); } } diff --git a/src/creaImageIOWxGimmickReaderDialog.cpp b/src/creaImageIOWxGimmickReaderDialog.cpp index bce7fc7..771bb05 100644 --- a/src/creaImageIOWxGimmickReaderDialog.cpp +++ b/src/creaImageIOWxGimmickReaderDialog.cpp @@ -67,10 +67,10 @@ namespace creaImageIO try { - mGimmick = boost::shared_ptr(new Gimmick()); - mGimmick->Initialize(i_namedescp,i_namedb); + mGimmick = boost::shared_ptr(new Gimmick()); + mGimmick->Initialize(i_namedescp,i_namedb); - mView = new WxGimmickView(mGimmick, + mView = new WxGimmickView(mGimmick, this, TVID, wxDefaultPosition, @@ -78,9 +78,9 @@ namespace creaImageIO min_dim, max_dim, threads); - mView->Initialize(); + mView->Initialize(); // Connect the AddProgress callback - mView->ConnectValidationObserver + mView->ConnectValidationObserver ( boost::bind( &WxGimmickReaderDialog::OnValid , this, _1 ) ); } catch (crea::Exception e) @@ -88,20 +88,15 @@ namespace creaImageIO e.Print(); return; } - mtopsizer->Add( mView,1,wxGROW,0); - wxSizer* bsizer = this->CreateSeparatedButtonSizer(wxOK|wxCANCEL); /*mOkButton = new wxButton(this, wxID_OK, _T("OK"), wxPoint(170,50)); mCancelButton = new wxButton(this, wxID_CANCEL, _T("CANCEL"), wxPoint(210,50)); */ mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this); mCancelButton = (wxButton*)FindWindowById(GetEscapeId(), this); - mOkButton->Enable(false); mtopsizer->Add ( bsizer, 0, wxGROW ); - - SetSizer( mtopsizer ); - + SetSizer( mtopsizer ); Layout(); } @@ -118,7 +113,6 @@ namespace creaImageIO { mGimmick->Finalize(); } - } ///Callback method on a selection diff --git a/src/creaImageIOWxGimmickView.cpp b/src/creaImageIOWxGimmickView.cpp index 0ee66e5..ef9ee5c 100644 --- a/src/creaImageIOWxGimmickView.cpp +++ b/src/creaImageIOWxGimmickView.cpp @@ -204,8 +204,8 @@ namespace creaImageIO /// \TODO fix warning: unused variable hsize int hsize = size.GetHeight(); - int top_minsize = 450; - int bottom_minsize = 50; + int top_minsize = 450; + int bottom_minsize = 50; mSplitter->SetMinimumPaneSize( bottom_minsize ); mSplitter->SplitHorizontally( mNotebook, mBottomPanel, @@ -1175,9 +1175,9 @@ namespace creaImageIO //======================================================================== void WxGimmickView::CreateEditFieldsDialog(tree::Node* node, std::vector names, std::vector keys) { - wxDialog* dial= new wxDialog (this,-1,crea::std2wx("Edit Fields for node "+node->GetLabel()),wxDefaultPosition, wxSize(350,155)); - wxBoxSizer *siz = new wxBoxSizer(wxVERTICAL); - WxEditFieldsPanel* ef = new WxEditFieldsPanel(dial, dial, this, node, names, keys); + wxDialog *dial= new wxDialog (this,-1,crea::std2wx("Edit Fields for node "+node->GetLabel()),wxDefaultPosition, wxSize(350,155)); + wxBoxSizer *siz = new wxBoxSizer(wxVERTICAL); + WxEditFieldsPanel *ef = new WxEditFieldsPanel(dial, dial, this, node, names, keys); siz->Add( ef,1,wxGROW ,0); dial->SetSizer(siz); diff --git a/src/creaImageIOWxSimpleDlg.cpp b/src/creaImageIOWxSimpleDlg.cpp index f11574c..1c076b0 100644 --- a/src/creaImageIOWxSimpleDlg.cpp +++ b/src/creaImageIOWxSimpleDlg.cpp @@ -145,11 +145,9 @@ namespace creaImageIO dlg.ShowModal(); if (dlg.GetReturnCode() == wxID_OK) { - dlg.stopReading(); - - std::vector outStrGimmick; - dlg.getSelected(outStrGimmick, m_attrDicomTags,true,""); - + dlg.stopReading(); + std::vector outStrGimmick; + dlg.getSelected(outStrGimmick, m_attrDicomTags,true,""); m_results.clear(); int size=(int)outStrGimmick.size(); int ii; @@ -171,7 +169,6 @@ namespace creaImageIO infoimage = _T("EED Missing info ???"); infoimageSource = _T("GIMMICK"); - dlg.OnExit(); } SetReturnCode( dlg.GetReturnCode() );