2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------
29 #include <creaImageIOWxOutputDlg.h>
34 WxOutputDlg::WxOutputDlg(wxWindow *parent, const std::vector<std::string> filenames, int i_dim, bool single)
35 : wxDialog(parent, -1,_T("OUTPUT FORMAT"), wxDefaultPosition, wxSize(350,450))
38 int size = (int)filenames.size();
43 sentence = "You select";
44 std::string sentence2 = "You have the possibility to select output format :";
46 std::vector<std::string> outsentences;
57 sentence += " single frames";
61 sentence += " multi-frames";
63 sentence += " as output";
70 outsentences.push_back("It shall be a single file with a single 2D frmae");
74 outsentences.push_back("It shall be multiple files with 2D frames");
75 outsentences.push_back("It shall be a single file with 3D frames");
82 outsentences.push_back("It shall be a single file with 3D frames");
83 outsentences.push_back("It shall be multiple files with 2D frames");
87 outsentences.push_back("It shall be a single file with (3D+t) frames");
88 outsentences.push_back("It shall be multiple (n+t) files with 2D frames");
89 outsentences.push_back("It shall be multiple (n) files with (2D+t) frames");
90 outsentences.push_back("It shall be a multiple (t) files with (2D+n) frames");
101 int start_point = 45;
102 /// \TODO fix unused variable ExportText
103 wxStaticText * ExportText=new wxStaticText(this,-1,crea::std2wx(sentence), wxPoint(5,10));
105 std::vector<std::string>::iterator it = outsentences.begin();
106 for(int i = 0;it != outsentences.end(); it++, i++, start_point += 45)
108 wxCheckBox *check = new wxCheckBox(this, -1, crea::std2wx((*it)), wxPoint(5,start_point) );
110 check->SetValue(true);
112 check->SetValue(false);
113 Connect( check->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxOutputDlg::OnChange );
114 checkOut.push_back(check);
117 checkAsking = new wxCheckBox(this, -1, _T("Do you want to save this output and no more asking"), wxPoint(5,start_point) );
120 wxButton *Ok = new wxButton(this, -1,_T("OK"), wxPoint(5,start_point+20) );
122 Connect( Ok->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxOutputDlg::OnOk );
124 /// \TODO fix unused variable Cancel
125 wxButton *Cancel = new wxButton(this, wxID_CANCEL,_T("CANCEL"), wxPoint(100,start_point+20) );
130 WxOutputDlg::~WxOutputDlg(){}
132 void WxOutputDlg::OnOk(wxCommandEvent &event)
135 SetReturnCode(wxID_OK);
138 void WxOutputDlg::OnChange(wxCommandEvent& event)
140 std::vector<wxCheckBox*>::iterator it = checkOut.begin();
142 for(int i = 0;it != checkOut.end(); it++, i++)
144 if( (*it)->GetId() == event.GetId())
149 (*it)->SetValue(false);
154 const std::string WxOutputDlg::getDim()
157 std::vector<wxCheckBox*>::iterator it = checkOut.begin();
158 for(int i = 1;it != checkOut.end(); it++, i++)
160 if( (*it)->GetValue() )
162 sprintf(res,"%d", i);
171 const std::string WxOutputDlg::getAsking()
173 if(checkAsking->GetValue())