1 /** @file projection.cpp
3 @author Bruno M. Carvalho and Deniz Sarioz
4 licensed under (open-source) QPL v1.0
5 which accompanies this distribution in the file QPL
8 #include "projection.h"
12 #include <qbuttongroup.h>
13 #include <qcheckbox.h>
14 #include <qcombobox.h>
17 #include <qlineedit.h>
18 #include <qmultilineedit.h>
19 #include <qpushbutton.h>
20 #include <qradiobutton.h>
22 #include <qstringlist.h>
26 #include <qwhatsthis.h>
27 #include <qmessagebox.h>
28 #include <qtabwidget.h>
30 /** populates the tab inside the pseudo tab corresponding to create set 1 *
33 void projectionwindow::populate_idheader() {
34 idheaderlabel = new QLabel( idheaderWidget, "idheaderlabel" );
35 idheaderlabel->setGeometry( QRect( 20, 30, 90, 20 ) );
36 idheaderlabel->setText( tr( "ID HEADER" ) );
37 idheader = new QLineEdit( idheaderWidget, "idheader" );
38 idheader->setGeometry( QRect( 120, 20, 500, 28 ) );
41 bool projectionwindow::check_idheader(QString& errs) {
43 QString idText = idheader->text();
44 QString simpleIdText = idText.simplifyWhiteSpace();
45 if(simpleIdText.isEmpty()) {
46 pseudoCommandsWidget->setCurrentPage(0);
48 errs = "Make sure that id header is not blank.";
55 QString projectionwindow::get_idheader() {
57 idOut.append(idheader->text());
62 void projectionwindow::populate_geometry() {
63 geometrylabel = new QLabel( geometryWidget, "geometrylabel" );
64 geometrylabel->setGeometry( QRect( 10, 20, 100, 20 ) );
65 geometrylabel->setText( tr( "GEOMETRY" ) );
67 geometrybuttongroup = new QButtonGroup( geometryWidget, "geometrybuttongroup" );
68 geometrybuttongroup->setGeometry( QRect( 120, 10, 570, 160 ) );
69 geometrybuttongroup->setTitle( tr( "" ) );
70 geometrybuttongroup->setEnabled(true);
72 parallelbutton = new QRadioButton( geometrybuttongroup, "parallelbutton" );
73 parallelbutton->setGeometry( QRect( 10, 20, 100, 24 ) );
74 parallelbutton->setText( tr( "PARALLEL" ) );
75 parallelbutton->setChecked(true);
76 QObject::connect(parallelbutton,SIGNAL(clicked()),this,SLOT(activateParallelFields()));
78 parallelbuttongroup = new QButtonGroup( geometrybuttongroup, "parallelbuttongroup" );
79 parallelbuttongroup->setGeometry( QRect( 130, 10, 120, 70 ) );
80 parallelbuttongroup->setTitle( tr( "" ) );
81 parallelbuttongroup->setEnabled(true);
83 uniformbutton = new QRadioButton( parallelbuttongroup, "uniformbutton" );
84 uniformbutton->setGeometry( QRect( 10, 10, 100, 24 ) );
85 uniformbutton->setText( tr( "UNIFORM" ) );
86 uniformbutton->setChecked(true);
88 variablebutton = new QRadioButton( parallelbuttongroup, "variablebutton" );
89 variablebutton->setGeometry( QRect( 10, 40, 100, 24 ) );
90 variablebutton->setText( tr( "VARIABLE" ) );
92 parallelbuttongroup2 = new QButtonGroup( geometrybuttongroup, "parallelbuttongroup2" );
93 parallelbuttongroup2->setGeometry( QRect( 260, 10, 90, 70 ) );
94 parallelbuttongroup2->setTitle( tr( "" ) );
95 parallelbuttongroup2->setEnabled(true);
97 stripbutton = new QRadioButton( parallelbuttongroup2, "stripbutton" );
98 stripbutton->setGeometry( QRect( 10, 10, 70, 24 ) );
99 stripbutton->setText( tr( "STRIP" ) );
101 linebutton = new QRadioButton( parallelbuttongroup2, "linebutton" );
102 linebutton->setGeometry( QRect( 10, 40, 70, 24 ) );
103 linebutton->setText( tr( "LINE" ) );
104 linebutton->setChecked(true);
106 divergentbutton = new QRadioButton( geometrybuttongroup, "divergentbutton" );
107 divergentbutton->setGeometry( QRect( 10, 100, 120, 24 ) );
108 divergentbutton->setText( tr( "DIVERGENT" ) );
109 QObject::connect(divergentbutton,SIGNAL(clicked()),this,SLOT(activateDivergentFields()));
111 divergentbuttongroup = new QButtonGroup( geometrybuttongroup, "divergentbuttongroup" );
112 divergentbuttongroup->setGeometry( QRect( 130, 80, 120, 70 ) );
113 divergentbuttongroup->setTitle( tr( "" ) );
114 divergentbuttongroup->setEnabled(false);
116 arcbutton = new QRadioButton( divergentbuttongroup, "arcbutton" );
117 arcbutton->setGeometry( QRect( 10, 10, 60, 24 ) );
118 arcbutton->setText( tr( "ARC" ) );
120 tangentbutton = new QRadioButton( divergentbuttongroup, "tangentbutton" );
121 tangentbutton->setGeometry( QRect( 10, 40, 100, 20 ) );
122 tangentbutton->setText( tr( "TANGENT" ) );
124 sourcetoorigin = new QLineEdit( geometrybuttongroup, "sourcetoorigin" );
125 sourcetoorigin->setGeometry( QRect( 260, 100, 140, 28 ) );
126 sourcetoorigin->setEnabled(false);
128 sourcetooriginlabel = new QLabel( geometrybuttongroup, "sourcetooriginlabel" );
129 sourcetooriginlabel->setGeometry( QRect( 270, 80, 120, 20 ) );
130 sourcetooriginlabel->setText( tr( "source_to_origin" ) );
131 sourcetooriginlabel->setEnabled(false);
133 sourcetodetector = new QLineEdit( geometrybuttongroup, "sourcetodetector" );
134 sourcetodetector->setGeometry( QRect( 410, 100, 140, 28 ) );
135 sourcetodetector->setEnabled(false);
137 sourcetodetectorlabel = new QLabel( geometrybuttongroup, "sourcetodetectorlabel" );
138 sourcetodetectorlabel->setGeometry( QRect( 410, 80, 140, 20 ) );
139 sourcetodetectorlabel->setText( tr( "source_to_detector" ) );
140 sourcetodetectorlabel->setEnabled(false);
142 raysumslabel = new QLabel( geometryWidget, "raysumslabel" );
143 raysumslabel->setGeometry( QRect( 10, 180, 90, 20 ) );
144 raysumslabel->setText( tr( "RAYSUMS" ) );
146 raysumsbuttongroup = new QButtonGroup( geometryWidget, "raysumsbuttongroup" );
147 raysumsbuttongroup->setGeometry( QRect( 120, 180, 570, 120 ) );
148 raysumsbuttongroup->setTitle( tr( "" ) );
149 // raysumsbuttongroup->setEnabled(false);
151 userbutton = new QRadioButton( raysumsbuttongroup, "userbutton" );
152 userbutton->setGeometry( QRect( 10, 40, 70, 24 ) );
153 userbutton->setText( tr( "USER" ) );
154 userbutton->setChecked(true);
155 QObject::connect(userbutton,SIGNAL(clicked()),this,SLOT(activateUserFields()));
157 userrays = new QLineEdit( raysumsbuttongroup, "userrays" );
158 userrays->setGeometry( QRect( 130, 30, 90, 28 ) );
159 userrays->setEnabled(true);
161 userrayslabel = new QLabel( raysumsbuttongroup, "userrayslabel" );
162 userrayslabel->setGeometry( QRect( 140, 10, 70, 20 ) );
163 userrayslabel->setText( tr( "user_rays" ) );
164 userrayslabel->setEnabled(true);
166 programbutton = new QRadioButton( raysumsbuttongroup, "programbutton" );
167 programbutton->setGeometry( QRect( 10, 90, 110, 24 ) );
168 programbutton->setText( tr( "PROGRAM" ) );
169 QObject::connect(programbutton,SIGNAL(clicked()),this,SLOT(activateProgramFields()));
171 raysumsnelem = new QLineEdit( raysumsbuttongroup, "raysumsnelem" );
172 raysumsnelem->setGeometry( QRect( 130, 80, 90, 28 ) );
173 raysumsnelem->setEnabled(false);
175 raysumsnelemlabel = new QLabel( raysumsbuttongroup, "raysumsnelemlabel" );
176 raysumsnelemlabel->setGeometry( QRect( 150, 60, 50, 20 ) );
177 raysumsnelemlabel->setText( tr( "nelem" ) );
178 raysumsnelemlabel->setEnabled(false);
180 raysumspixelsize = new QLineEdit( raysumsbuttongroup, "raysumspixelsize" );
181 raysumspixelsize->setGeometry( QRect( 240, 80, 90, 28 ) );
182 raysumspixelsize->setEnabled(false);
184 raysumspixelsizelabel = new QLabel( raysumsbuttongroup, "raysumspixelsizelabel" );
185 raysumspixelsizelabel->setGeometry( QRect( 250, 60, 70, 20 ) );
186 raysumspixelsizelabel->setText( tr( "pixel_size" ) );
187 raysumspixelsizelabel->setEnabled(false);
189 detectorspacing = new QLineEdit( raysumsbuttongroup, "detectorspacing" );
190 detectorspacing->setGeometry( QRect( 370, 50, 140, 28 ) );
192 detectorspacinglabel = new QLabel( raysumsbuttongroup, "detectorspacinglabel" );
193 detectorspacinglabel->setGeometry( QRect( 380, 30, 130, 20 ) );
194 detectorspacinglabel->setText( tr( "detector_spacing" ) );
196 angleslabel = new QLabel( geometryWidget, "angleslabel" );
197 angleslabel->setGeometry( QRect( 8, 310, 70, 20 ) );
198 angleslabel->setText( tr( "ANGLES" ) );
200 anglesbuttongroup = new QButtonGroup( geometryWidget, "anglesbuttongroup" );
201 anglesbuttongroup->setGeometry( QRect( 120, 310, 570, 100 ) );
202 anglesbuttongroup->setTitle( tr( "" ) );
204 prjnum = new QLineEdit( anglesbuttongroup, "prjnum" );
205 prjnum->setGeometry( QRect( 17, 40, 120, 28 ) );
207 prjnumlabel = new QLabel( anglesbuttongroup, "prjnumlabel" );
208 prjnumlabel->setGeometry( QRect( 50, 20, 50, 20 ) );
209 prjnumlabel->setText( tr( "prjnum" ) );
211 linobutton = new QRadioButton( anglesbuttongroup, "linobutton" );
212 linobutton->setGeometry( QRect( 160, 10, 60, 24 ) );
213 linobutton->setText( tr( "LINO" ) );
214 QObject::connect(linobutton,SIGNAL(clicked()),this,SLOT(deactivateEqualSpacingFields()));
216 equalspacingbutton = new QRadioButton( anglesbuttongroup, "equalspacingbutton" );
217 equalspacingbutton->setGeometry( QRect( 160, 40, 160, 24 ) );
218 equalspacingbutton->setText( tr( "EQUAL SPACING" ) );
219 QObject::connect(equalspacingbutton,SIGNAL(clicked()),this,SLOT(activateEqualSpacingFields()));
221 nonebutton = new QRadioButton( anglesbuttongroup, "nonebutton" );
222 nonebutton->setGeometry( QRect( 160, 70, 70, 24 ) );
223 nonebutton->setText( tr( "NONE" ) );
224 nonebutton->setChecked(true);
225 QObject::connect(nonebutton,SIGNAL(clicked()),this,SLOT(deactivateEqualSpacingFields()));
227 firstangle = new QLineEdit( anglesbuttongroup, "firstangle" );
228 firstangle->setGeometry( QRect( 340, 40, 80, 28 ) );
229 firstangle->setEnabled(false);
231 firstanglelabel = new QLabel( anglesbuttongroup, "firstanglelabel" );
232 firstanglelabel->setGeometry( QRect( 345, 20, 80, 20 ) );
233 firstanglelabel->setText( tr( "first_angle" ) );
234 firstanglelabel->setEnabled(false);
236 lastangle = new QLineEdit( anglesbuttongroup, "lastangle" );
237 lastangle->setGeometry( QRect( 440, 40, 80, 28 ) );
238 lastangle->setEnabled(false);
240 lastanglelabel = new QLabel( anglesbuttongroup, "lastanglelabel" );
241 lastanglelabel->setGeometry( QRect( 445, 20, 80, 20 ) );
242 lastanglelabel->setText( tr( "last_angle" ) );
243 lastanglelabel->setEnabled(false);
245 angles = new QLineEdit( geometryWidget, "angles" );
246 angles->setGeometry( QRect( 120, 415, 570, 105 ) );
247 angles->setEnabled(true);
251 // bool projectionwindow::check_geometry(QString& errs) {
256 /** Returns a string for set 6 of CREATE input sequence
259 @return projection geometry specification
260 @author Bruno M. Carvalho
262 //QString createwindow::getOutput6()
263 QString projectionwindow::get_geometry() {
267 output.sprintf("GEOMETRY\n");
268 if(parallelbutton->isChecked()) {
269 output.append("PARALLEL ");
270 if(uniformbutton->isChecked()) {
271 output.append("UNIFORM ");
274 if(variablebutton->isChecked()) {
275 output.append("VARIABLE ");
277 if(stripbutton->isChecked()) {
278 output.append("STRIP ");
281 if(linebutton->isChecked()) {
282 output.append("LINE ");
286 if(divergentbutton->isChecked()) {
287 output.append("DIVERGENT ");
288 if(arcbutton->isChecked()) {
289 output.append("ARC ");
292 if(tangentbutton->isChecked()) {
293 output.append("TANGENT ");
295 output+=sourcetoorigin->text();
297 output+=sourcetodetector->text();
300 output.append("RAYS ");
301 if(userbutton->isChecked()) {
302 output.append("USER ");
303 output+=userrays->text();
307 if(programbutton->isChecked()) {
308 output.append("PROGRAM ");
309 output+=raysumsnelem->text();
311 output+=raysumspixelsize->text();
314 output+=detectorspacing->text();
316 output.append("ANGLES ");
317 output+=prjnum->text();
319 if(linobutton->isChecked()) {
320 output.append("LINO ");
321 //output.append("\n");
324 if(equalspacingbutton->isChecked()) {
325 output.append("EQUAL SPACING ");
327 output+=firstangle->text();
329 output+=lastangle->text();
330 //output.append("\n");
334 output+=angles->text();
335 //output.append("\n");
342 void projectionwindow::populate_measurement() {
343 measurementlabel = new QLabel( measurementWidget, "measurementlabel" );
344 measurementlabel->setGeometry( QRect( 10, 20, 130, 20 ) );
345 measurementlabel->setText( tr( "MEASUREMENT" ) );
347 measurementbuttongroup = new QButtonGroup( measurementWidget, "measurementbuttongroup" );
348 measurementbuttongroup->setGeometry( QRect( 20, 50, 710, 410 ) );
349 measurementbuttongroup->setTitle( tr( "" ) );
350 measurementbuttongroup->setEnabled( true );
352 perfectbutton = new QRadioButton( measurementbuttongroup, "perfectbutton" );
353 perfectbutton->setGeometry( QRect( 10, 10, 100, 24 ) );
354 perfectbutton->setText( tr( "PERFECT" ) );
355 perfectbutton->setChecked(true);
356 QObject::connect(perfectbutton,SIGNAL(clicked()),this,SLOT(deactivateNoisyFields()));
358 noisybutton = new QRadioButton( measurementbuttongroup, "noisybutton" );
359 noisybutton->setGeometry( QRect( 10, 40, 70, 24 ) );
360 noisybutton->setText( tr( "NOISY" ) );
361 QObject::connect(noisybutton,SIGNAL(clicked()),this,SLOT(activateNoisyFields()));
363 noisyframe = new QFrame( measurementbuttongroup, "noisyframe" );
364 noisyframe->setGeometry( QRect( 90, 40, 570, 250 ) );
365 noisyframe->setFrameStyle( 49 );
366 noisyframe->setEnabled(false);
368 quantumbutton = new QCheckBox( noisyframe, "quantumbutton" );
369 quantumbutton->setGeometry( QRect( 20, 30, 110, 24 ) );
370 quantumbutton->setText( tr( "QUANTUM" ) );
371 quantumbutton->setEnabled(false);
372 QObject::connect(quantumbutton,SIGNAL(clicked()),this,SLOT(activateQuantumFields()));
374 quanmn = new QLineEdit( noisyframe, "quanmn" );
375 quanmn->setGeometry( QRect( 180, 30, 80, 28 ) );
376 quanmn->setEnabled(false);
378 quanmnlabel = new QLabel( noisyframe, "quanmnlabel" );
379 quanmnlabel->setGeometry( QRect( 190, 10, 60, 20 ) );
380 quanmnlabel->setText( tr( "quanmn" ) );
381 quanmnlabel->setEnabled(false);
383 quancm = new QLineEdit( noisyframe, "quancm" );
384 quancm->setGeometry( QRect( 270, 30, 80, 28 ) );
385 quancm->setEnabled(false);
387 quancmlabel = new QLabel( noisyframe, "quancmlabel" );
388 quancmlabel->setGeometry( QRect( 280, 10, 60, 20 ) );
389 quancmlabel->setText( tr( "quancm" ) );
390 quancmlabel->setEnabled(false);
392 calibrationlabel = new QLabel( noisyframe, "calibrationlabel" );
393 calibrationlabel->setGeometry( QRect( 360, 30, 110, 20 ) );
394 calibrationlabel->setText( tr( "CALIBRATION" ) );
395 calibrationlabel->setEnabled(false);
397 quanin = new QComboBox( noisyframe, "quanin" );
398 quanin->setGeometry( QRect( 480, 30, 80, 28 ) );
399 quanin->insertItem("1",-1);
400 quanin->insertItem("2",-1);
401 quanin->insertItem("3",-1);
402 quanin->insertItem("4",-1);
403 quanin->setEnabled(false);
405 quaninlabel = new QLabel( noisyframe, "quaninlabel" );
406 quaninlabel->setGeometry( QRect( 490, 10, 50, 20 ) );
407 quaninlabel->setText( tr( "quanin" ) );
408 quaninlabel->setEnabled(false);
410 scatterbutton = new QCheckBox( noisyframe, "scatterbutton" );
411 scatterbutton->setGeometry( QRect( 20, 90, 100, 24 ) );
412 scatterbutton->setText( tr( "SCATTER" ) );
413 QObject::connect(scatterbutton,SIGNAL(clicked()),this,SLOT(activateScatterFields()));
415 sctnpk = new QLineEdit( noisyframe, "sctnpk" );
416 sctnpk->setGeometry( QRect( 180, 90, 80, 28 ) );
417 sctnpk->setEnabled(false);
419 sctnpklabel = new QLabel( noisyframe, "sctnpklabel" );
420 sctnpklabel->setGeometry( QRect( 190, 70, 50, 20 ) );
421 sctnpklabel->setText( tr( "sctnpk" ) );
422 sctnpklabel->setEnabled(false);
424 sctnwd = new QLineEdit( noisyframe, "sctnwd" );
425 sctnwd->setGeometry( QRect( 270, 90, 80, 28 ) );
426 sctnwd->setEnabled(false);
428 sctnwdlabel = new QLabel( noisyframe, "sctnwdlabel" );
429 sctnwdlabel->setGeometry( QRect( 280, 70, 60, 20 ) );
430 sctnwdlabel->setText( tr( "sctnwd" ) );
431 sctnwdlabel->setEnabled(false);
433 additivebutton = new QCheckBox( noisyframe, "additivebutton" );
434 additivebutton->setGeometry( QRect( 20, 150, 90, 24 ) );
435 additivebutton->setText( tr( "ADDITIVE" ) );
436 additivebutton->setChecked(false);
437 QObject::connect(additivebutton,SIGNAL(clicked()),this,SLOT(activateAdditiveFields()));
439 addnmn = new QLineEdit( noisyframe, "addnmn" );
440 addnmn->setGeometry( QRect( 180, 150, 80, 28 ) );
441 addnmn->setEnabled(false);
443 addnmnlabel = new QLabel( noisyframe, "addnmnlabel" );
444 addnmnlabel->setGeometry( QRect( 190, 130, 60, 20 ) );
445 addnmnlabel->setText( tr( "addnmn" ) );
446 addnmnlabel->setEnabled(false);
448 addnsd = new QLineEdit( noisyframe, "addnsd" );
449 addnsd->setGeometry( QRect( 270, 150, 80, 28 ) );
450 addnsd->setEnabled(false);
452 addnsdlabel = new QLabel( noisyframe, "addnsdlabel" );
453 addnsdlabel->setGeometry( QRect( 280, 130, 60, 20 ) );
454 addnsdlabel->setText( tr( "addnsd" ) );
455 addnsdlabel->setEnabled(false);
457 multiplicativebutton = new QCheckBox( noisyframe, "multiplicativebutton" );
458 multiplicativebutton->setGeometry( QRect( 20, 210, 150, 24 ) );
459 multiplicativebutton->setText( tr( "MULTIPLICATIVE" ) );
460 QObject::connect(multiplicativebutton,SIGNAL(clicked()),this,SLOT(activateMultiplicativeFields()));
462 multnmn = new QLineEdit( noisyframe, "multnmn" );
463 multnmn->setGeometry( QRect( 180, 210, 80, 28 ) );
464 multnmn->setEnabled(false);
466 multnmnlabel = new QLabel( noisyframe, "multnmnlabel" );
467 multnmnlabel->setGeometry( QRect( 190, 190, 70, 20 ) );
468 multnmnlabel->setText( tr( "multnmn" ) );
469 multnmnlabel->setEnabled(false);
471 multnsd = new QLineEdit( noisyframe, "multnsd" );
472 multnsd->setGeometry( QRect( 270, 210, 80, 28 ) );
473 multnsd->setEnabled(false);
475 multnsdlabel = new QLabel( noisyframe, "multnsdlabel" );
476 multnsdlabel->setGeometry( QRect( 280, 190, 70, 20 ) );
477 multnsdlabel->setText( tr( "multnsd" ) );
478 multnsdlabel->setEnabled(false);
480 seedlabel = new QLabel( measurementbuttongroup, "seedlabel" );
481 seedlabel->setGeometry( QRect( 10, 310, 110, 20 ) );
482 seedlabel->setText( tr( "SEED" ) );
483 seedlabel->setEnabled(false);
485 seed = new QLineEdit( measurementbuttongroup, "seed" );
486 seed->setGeometry( QRect( 140, 310, 70, 28 ) );
487 seed->setEnabled(false);
489 seedlabel1 = new QLabel( measurementbuttongroup, "seedlabel1" );
490 seedlabel1->setGeometry( QRect( 155, 290, 70, 20 ) );
491 seedlabel1->setText( tr( "seed" ) );
492 seedlabel1->setEnabled(false);
494 backgroundlabel = new QLabel( measurementbuttongroup, "backgroundlabel" );
495 backgroundlabel->setGeometry( QRect( 10, 370, 120, 20 ) );
496 backgroundlabel->setText( tr( "BACKGROUND" ) );
498 backgr1 = new QLineEdit( measurementbuttongroup, "backgr1" );
499 backgr1->setGeometry( QRect( 140, 370, 70, 28 ) );
501 backgr1label = new QLabel( measurementbuttongroup, "backgr1label" );
502 backgr1label->setGeometry( QRect( 145, 350, 70, 20 ) );
503 backgr1label->setText( tr( "backgr(1)" ) );
507 // bool projectionwindow::check_measurement(QString& errs) {
513 /** Returns a string for set 7 of CREATE input sequence
516 @return measurement statistics
517 @author Bruno M. Carvalho
519 // QString createwindow::getOutput7()
520 QString projectionwindow::get_measurement() {
523 output.sprintf("MEASUREMENT ");
524 if(perfectbutton->isChecked()) {
525 output.append("PERFECT ");
529 if(noisybutton->isChecked()) {
530 output.append("NOISY ");
532 if(quantumbutton->isChecked()) {
533 output.append("QUANTUM ");
534 output+=quanmn->text();
536 output+=quancm->text();
538 t.sprintf("CALIBRATION %d \n",quanin->currentItem()+1);
540 output.append("SEED ");
541 output+=seed->text();
545 if(scatterbutton->isChecked()) {
546 output.append("SCATTER ");
547 output+=sctnpk->text();
549 output+=sctnwd->text();
553 if(additivebutton->isChecked()) {
554 output.append("ADDITIVE ");
555 output+=addnmn->text();
557 output+=addnsd->text();
559 output.append("SEED ");
560 output+=seed->text();
564 if(multiplicativebutton->isChecked()) {
565 output.append("MULTIPLICATIVE ");
566 output+=multnmn->text();
568 output+=multnsd->text();
570 output.append("SEED ");
571 output+=seed->text();
575 output.append("BACKGROUND ");
576 output+=backgr1->text();
578 // assume single energy with NERGY = 1 in pseudo projections
579 // if(polychromaticbutton->isChecked()) {
580 // output+=backgr2->text();
581 // output.append(" ");
582 // output+=backgr3->text();
583 // output.append(" ");
584 // output+=backgr4->text();
585 // output.append(" ");
586 // output+=backgr5->text();
587 // output.append(" ");
588 // output+=backgr6->text();
589 // output.append(" ");
590 // output+=backgr7->text();
592 //output.append("\n");
597 * Constructs a projectionwindow which is a child of 'parent', with the
598 * name 'name' and widget flags set to 'f'
600 * The dialog will by default be modeless, unless you set 'modal' to
601 * TRUE to construct a modal dialog.
603 @author Bruno M. Carvalho / DS
605 projectionwindow::projectionwindow( QWidget* parent, const char* name, bool modal, WFlags fl )
606 : QDialog( parent, name, modal, fl )
609 setName( "projectionwindow" );
611 setMinimumSize( QSize( 730, 630 ) );
612 setMaximumSize( QSize( 730, 630 ) );
613 setCaption( tr( "Projection Window" ) );
615 tabwidget1 = new QTabWidget( this, "tabwidget1" );
616 tabwidget1->setGeometry( QRect( 0, 0, 750, 550 ) );
617 tabwidget1->setMinimumSize( QSize( 750, 550 ) );
618 tabwidget1->setMaximumSize( QSize( 750, 550 ) );
619 tabwidget1->setTabPosition( QTabWidget::Top );
620 tabwidget1->setTabShape( QTabWidget::Triangular );
622 /* Create tab 1 -- projection type widget */
624 projTypeWidget = new QWidget( tabwidget1, "projection type" );
626 projTypeLabel = new QLabel( projTypeWidget, "projtypelabel" );
627 projTypeLabel->setGeometry( QRect( 10, 20, 120, 20 ) );
628 projTypeLabel->setText( tr( "Projection Type" ) );
630 projectionbuttongroup = new QButtonGroup( projTypeWidget, "projectionbuttongroup" );
631 projectionbuttongroup->setGeometry( QRect( 25, 40, 690, 480 ) );
632 // projectionbuttongroup->setTitle( tr( "Projection Type" ) );
633 projectionbuttongroup->setAlignment( int( QButtonGroup::AlignHCenter ) );
635 oldbutton = new QRadioButton( projectionbuttongroup, "oldbutton" );
636 oldbutton->setGeometry( QRect( 10, 20, 95, 24 ) );
637 oldbutton->setText( tr( "OLD" ) );
639 QObject::connect(oldbutton,SIGNAL(clicked()),this,SLOT(deactivateFields()));
641 tabwidget1->insertTab( projTypeWidget, "Projection Type" );
643 /** Create tab 2 -- PseudoProjection Commands */
644 pseudoCommandsWidget = new QTabWidget( tabwidget1, "pseudo commands" );
646 pseudobutton = new QRadioButton( projectionbuttongroup, "pseudobutton" );
647 pseudobutton->setGeometry( QRect( 10, 60, 95, 24 ) );
648 pseudobutton->setText( tr( "PSEUDO" ) );
649 QObject::connect(pseudobutton,SIGNAL(clicked()),this,SLOT(activatePseudoFields()));
651 tabwidget1->insertTab( pseudoCommandsWidget, "Pseudo Commands" );
652 tabwidget1->setTabEnabled(pseudoCommandsWidget, false);
654 // Make the create-like command sets 1,6,7 under the pseudo commands tab!
657 idheaderWidget = new QWidget( pseudoCommandsWidget, "ID Header" );
659 pseudoCommandsWidget->insertTab( idheaderWidget, "ID Header" );
662 geometryWidget = new QWidget( pseudoCommandsWidget, "Geometry" );
664 pseudoCommandsWidget->insertTab( geometryWidget, "Geometry" );
666 // set 7: measurement
667 measurementWidget = new QWidget( pseudoCommandsWidget, "Measurement" );
668 populate_measurement();
669 pseudoCommandsWidget->insertTab( measurementWidget, "Measurement" );
672 /** Create the options to real for beam hardening correction */
673 realbutton = new QRadioButton( projectionbuttongroup, "realbutton" );
674 realbutton->setGeometry( QRect( 10, 100, 95, 24 ) );
675 realbutton->setText( tr( "REAL" ) );
676 QObject::connect(realbutton,SIGNAL(clicked()),this,SLOT(deactivateFields()));
678 bhcbutton = new QCheckBox( projectionbuttongroup, "bhcbutton");
679 bhcbutton->setGeometry ( QRect( 130, 90, 500, 60) );
680 bhcbutton->setText( tr( "BEAM HARDENING CORRECTION\n(Fill in the window below.)" ) );
681 bhcbutton->setEnabled(false);
682 QObject::connect(realbutton,SIGNAL(clicked()),this,SLOT(activateRealOptions()));
684 bhcwindow = new QMultiLineEdit( projectionbuttongroup, "bhcwindow");
685 bhcwindow->setGeometry( QRect( 130, 155, 500, 300 ) );
686 bhcwindow->setEnabled(false);
687 QObject::connect(bhcbutton,SIGNAL(clicked()),this,SLOT(activateRealOptions()));
689 okbutton = new QPushButton( this, "okbutton" );
690 okbutton->setGeometry( QRect( 100, 560, 100, 40 ) );
691 okbutton->setText( tr( "OK" ) );
692 QObject::connect(okbutton,SIGNAL(clicked()),this,SLOT(checkValues()));
694 cancelbutton = new QPushButton( this, "cancelbutton" );
695 cancelbutton->setGeometry( QRect( 510, 560, 100, 40 ) );
696 cancelbutton->setText( tr( "Cancel" ) );
697 QObject::connect(cancelbutton,SIGNAL(clicked()),this,SLOT(reject()));
701 * Destroys the object and frees any allocated resources
703 projectionwindow::~projectionwindow()
705 // no need to delete child widgets, Qt does it all for us
708 /** Deactivates pseudo and rebin fields
710 @author Bruno M. Carvalho
712 void projectionwindow::deactivateFields()
714 if(oldbutton->isChecked() || realbutton->isChecked()) {
715 // tabwidget1->deleteTab( 1 );
716 tabwidget1->setTabEnabled(pseudoCommandsWidget, false);
718 if(oldbutton->isChecked() || pseudobutton->isChecked()) {
719 bhcwindow->setEnabled(false);
720 bhcbutton->setEnabled(false);
721 //bhcbutton->setOn(false);
723 if( ! bhcbutton->isChecked() ) {
724 bhcwindow->setEnabled(false);
728 /** Activates real options
730 @author Joanna Klukowska
732 void projectionwindow::activateRealOptions()
735 if(realbutton->isChecked()) {
736 bhcbutton->setEnabled(true);
737 if (bhcbutton->isChecked() ) {
738 bhcwindow->setEnabled(true);
746 /** Activates pseudo fields "recursively"
748 @author Bruno M. Carvalho / DS
750 void projectionwindow::activatePseudoFields()
753 if(pseudobutton->isChecked()) {
754 //bhcwindow->setEnabled(false);
755 //bhcbutton->setEnabled(false);
756 tabwidget1->setTabEnabled(pseudoCommandsWidget, true);
757 tabwidget1->setCurrentPage( 1 );
758 pseudoCommandsWidget->setTabEnabled(idheaderWidget, true);
759 pseudoCommandsWidget->setTabEnabled(geometryWidget, true);
760 pseudoCommandsWidget->setTabEnabled(measurementWidget, true);
763 // tabwidget1->setTabEnabled(pseudoCommandsWidget, false);
764 // pseudoCommandsWidget->setEnabled(FALSE);
769 /** Activates parallel fields and deactivates divergent fields
771 @author Bruno M. Carvalho (copied over by DS from create.cpp)
773 void projectionwindow::activateParallelFields()
775 if(parallelbutton->isChecked()) {
776 parallelbuttongroup->setEnabled(true);
777 parallelbuttongroup2->setEnabled(true);
778 divergentbuttongroup->setEnabled(false);
779 sourcetoorigin->setEnabled(false);
780 sourcetooriginlabel->setEnabled(false);
781 sourcetodetector->setEnabled(false);
782 sourcetodetectorlabel->setEnabled(false);
783 // activateOKButton();
786 parallelbuttongroup->setEnabled(false);
787 parallelbuttongroup2->setEnabled(false);
788 // activateOKButton();
792 /** Activates divergent fields and deactivates parallel fields
794 @author Bruno M. Carvalho (copied over by DS from create.cpp)
796 void projectionwindow::activateDivergentFields()
798 if(divergentbutton->isChecked()) {
799 divergentbuttongroup->setEnabled(true);
800 sourcetoorigin->setEnabled(true);
801 sourcetooriginlabel->setEnabled(true);
802 sourcetodetector->setEnabled(true);
803 sourcetodetectorlabel->setEnabled(true);
804 parallelbuttongroup->setEnabled(false);
805 parallelbuttongroup2->setEnabled(false);
806 // activateOKButton();
809 divergentbuttongroup->setEnabled(false);
810 sourcetoorigin->setEnabled(false);
811 sourcetooriginlabel->setEnabled(false);
812 sourcetodetector->setEnabled(false);
813 sourcetodetectorlabel->setEnabled(false);
814 // activateOKButton();
819 /** Activates user fields and deactivates program fields
821 @author Bruno M. Carvalho
823 void projectionwindow::activateUserFields()
825 if(userbutton->isChecked()) {
826 userrays->setEnabled(true);
827 userrayslabel->setEnabled(true);
828 raysumsnelem->setEnabled(false);
829 raysumsnelemlabel->setEnabled(false);
830 raysumspixelsize->setEnabled(false);
831 raysumspixelsizelabel->setEnabled(false);
832 // activateOKButton();
835 userrays->setEnabled(false);
836 userrayslabel->setEnabled(false);
837 // activateOKButton();
841 /** Activates program fields and deactivates user fields
843 @author Bruno M. Carvalho
845 void projectionwindow::activateProgramFields()
847 if(programbutton->isChecked()) {
848 raysumsnelem->setEnabled(true);
849 raysumsnelemlabel->setEnabled(true);
850 raysumspixelsize->setEnabled(true);
851 raysumspixelsizelabel->setEnabled(true);
852 userrays->setEnabled(false);
853 userrayslabel->setEnabled(false);
854 // activateOKButton();
857 raysumsnelem->setEnabled(false);
858 raysumsnelemlabel->setEnabled(false);
859 raysumspixelsize->setEnabled(false);
860 raysumspixelsizelabel->setEnabled(false);
861 // activateOKButton();
865 /** Activates equal spacing fields
867 @author Bruno M. Carvalho
869 void projectionwindow::activateEqualSpacingFields()
871 if(equalspacingbutton->isChecked()) {
872 firstangle->setEnabled(true);
873 firstanglelabel->setEnabled(true);
874 lastangle->setEnabled(true);
875 lastanglelabel->setEnabled(true);
876 angles->setEnabled(false);
877 // activateOKButton();
880 firstangle->setEnabled(false);
881 firstanglelabel->setEnabled(false);
882 lastangle->setEnabled(false);
883 lastanglelabel->setEnabled(false);
884 angles->setEnabled(true);
885 // activateOKButton();
890 /** Deactivates equal spacing fields
892 @author Bruno M. Carvalho
894 void projectionwindow::deactivateEqualSpacingFields()
896 firstangle->setEnabled(false);
897 firstanglelabel->setEnabled(false);
898 lastangle->setEnabled(false);
899 lastanglelabel->setEnabled(false);
900 if(linobutton->isChecked())
901 angles->setEnabled(false);
903 if(nonebutton->isChecked())
904 angles->setEnabled(true);
905 // activateOKButton();
910 /** Activates noisy fields
912 @author Bruno M. Carvalho
914 void projectionwindow::activateNoisyFields()
916 if(noisybutton->isChecked()) {
917 noisyframe->setEnabled(true);
918 quantumbutton->setChecked(true);
919 quantumbutton->setEnabled(true);
920 quanmn->setEnabled(true);
921 quanmnlabel->setEnabled(true);
922 quancm->setEnabled(true);
923 quancmlabel->setEnabled(true);
924 calibrationlabel->setEnabled(true);
925 quanin->setEnabled(true);
926 quaninlabel->setEnabled(true);
927 seedlabel->setEnabled(true);
928 seed->setEnabled(true);
929 seedlabel1->setEnabled(true);
930 // activateOKButton();
933 noisyframe->setEnabled(false);
934 // activateOKButton();
938 /** Deactivates noisy fields
940 @author Bruno M. Carvalho
942 void projectionwindow::deactivateNoisyFields()
944 noisyframe->setEnabled(false);
945 seedlabel->setEnabled(false);
946 seed->setEnabled(false);
947 seedlabel1->setEnabled(false);
948 // activateOKButton();
951 /** Activates quantum fields and deactivates scatter, additive and
952 multiplicative fields
954 @author Bruno M. Carvalho
956 void projectionwindow::activateQuantumFields()
958 if(quantumbutton->isChecked()) {
959 quanmn->setEnabled(true);
960 quanmnlabel->setEnabled(true);
961 quancm->setEnabled(true);
962 quancmlabel->setEnabled(true);
963 calibrationlabel->setEnabled(true);
964 quanin->setEnabled(true);
965 quaninlabel->setEnabled(true);
966 seed->setEnabled(true);
967 seedlabel->setEnabled(true);
968 seedlabel1->setEnabled(true);
969 // activateOKButton();
972 quanmn->setEnabled(false);
973 quanmnlabel->setEnabled(false);
974 quancm->setEnabled(false);
975 quancmlabel->setEnabled(false);
976 calibrationlabel->setEnabled(false);
977 quanin->setEnabled(false);
978 quaninlabel->setEnabled(false);
979 if(!additivebutton->isChecked() && !multiplicativebutton->isChecked()) {
980 seed->setEnabled(false);
981 seedlabel->setEnabled(false);
982 seedlabel1->setEnabled(false);
984 // activateOKButton();
988 /** Activates scatter fields and deactivates quantum, additive and
989 multiplicative fields
991 @author Bruno M. Carvalho
993 void projectionwindow::activateScatterFields()
995 if(scatterbutton->isChecked()) {
996 sctnpk->setEnabled(true);
997 sctnpklabel->setEnabled(true);
998 sctnwd->setEnabled(true);
999 sctnwdlabel->setEnabled(true);
1000 // activateOKButton();
1003 sctnpk->setEnabled(false);
1004 sctnpklabel->setEnabled(false);
1005 sctnwd->setEnabled(false);
1006 sctnwdlabel->setEnabled(false);
1007 // activateOKButton();
1011 /** Activates additive fields and deactivates quantum, scatter and
1012 multiplicative fields
1014 @author Bruno M. Carvalho
1016 void projectionwindow::activateAdditiveFields()
1018 if(additivebutton->isChecked()) {
1019 addnmn->setEnabled(true);
1020 addnmnlabel->setEnabled(true);
1021 addnsd->setEnabled(true);
1022 addnsdlabel->setEnabled(true);
1023 seed->setEnabled(true);
1024 seedlabel->setEnabled(true);
1025 seedlabel1->setEnabled(true);
1026 // activateOKButton();
1029 addnmn->setEnabled(false);
1030 addnmnlabel->setEnabled(false);
1031 addnsd->setEnabled(false);
1032 addnsdlabel->setEnabled(false);
1033 if(!quantumbutton->isChecked() && !multiplicativebutton->isChecked()) {
1034 seed->setEnabled(false);
1035 seedlabel->setEnabled(false);
1036 seedlabel1->setEnabled(false);
1038 // activateOKButton();
1042 /** Activates multiplicative fields and deactivates quantum, scatter and
1045 @author Bruno M. Carvalho
1047 void projectionwindow::activateMultiplicativeFields()
1049 if(multiplicativebutton->isChecked()) {
1050 multnmn->setEnabled(true);
1051 multnmnlabel->setEnabled(true);
1052 multnsd->setEnabled(true);
1053 multnsdlabel->setEnabled(true);
1054 seed->setEnabled(true);
1055 seedlabel->setEnabled(true);
1056 seedlabel1->setEnabled(true);
1057 // activateOKButton();
1060 multnmn->setEnabled(false);
1061 multnmnlabel->setEnabled(false);
1062 multnsd->setEnabled(false);
1063 multnsdlabel->setEnabled(false);
1064 if(!quantumbutton->isChecked() && !additivebutton->isChecked()) {
1065 seed->setEnabled(false);
1066 seedlabel->setEnabled(false);
1067 seedlabel1->setEnabled(false);
1069 // activateOKButton();
1074 /** Returns a string for PROJECTION input sequence
1077 @author Bruno M. Carvalho / DS
1079 QString projectionwindow::getOutput()
1083 output.sprintf("PROJECTION ");
1084 if(oldbutton->isChecked()) {
1085 output.append("OLD ");
1087 if(realbutton->isChecked()) {
1088 output.append("REAL ");
1089 if (bhcbutton->isChecked() ) {
1090 output += "BEAM HARDENING CORRECTION\n";
1091 output += bhcwindow->text();
1094 if(pseudobutton->isChecked()) {
1095 output += "PSEUDO\n";
1096 output += get_idheader();
1098 output += get_geometry();
1100 output += get_measurement();
1103 } // --projectionwindow::getOutput()
1105 void projectionwindow::checkValues()
1107 QString err;// contains the error string
1108 if(!pseudobutton->isChecked()) {
1109 accept(); // that was easy.
1111 if (!check_idheader(err)) { // don't accept, show why
1112 QMessageBox::information(this,"SnarkInput",err);
1114 // i was going to do this more elegantly using
1115 // check_geometry(err) and check_measurement(err) but realized
1116 // how much code would have to be rewritten...
1117 // just stole the part below from bruno's create.cpp --deniz
1119 int usr=0,pnlm,pn,sed;
1120 float stoo,stod=0,ppxls,decs,fa,la,qm,qc,sw,sp,am,as,mm,ms;
1123 /* Consistency check for geometry section */
1124 if(divergentbutton->isChecked()) {
1125 stoo=strtof((const char *)sourcetoorigin->text());
1128 stod=strtof((const char *)sourcetodetector->text());
1136 if(userbutton->isChecked()) {
1137 usr=strtoi((const char *)userrays->text());
1140 if(usr<1 || !(usr%2))
1143 if(programbutton->isChecked()) {
1144 pnlm=strtoi((const char *)raysumsnelem->text());
1147 if(pnlm<1 || !(pnlm%2))
1149 ppxls=strtof((const char *)raysumspixelsize->text());
1155 if(divergentbutton->isChecked() && pnlm*ppxls*M_SQRT1_2 >= stoo)
1158 decs=strtof((const char *)detectorspacing->text());
1163 if(divergentbutton->isChecked() && userbutton->isChecked())
1164 if((usr-1)*decs>=stod*M_PI)
1166 pn=strtoi((const char *)prjnum->text());
1171 if(linobutton->isChecked())
1174 if(equalspacingbutton->isChecked()) {
1175 fa=strtof((const char *)firstangle->text());
1178 la=strtof((const char *)lastangle->text());
1184 if(nonebutton->isChecked()) {
1185 QString angst = angles->text();
1186 //Splits angst into strings wherever the regular expression sep occurs, and return the list of those strings.
1187 // If allowEmptyEntries is TRUE, a null string is inserted in the list wherever the separator matches twice without intervening text.
1188 QRegExp sep("\\s+");
1189 // whitespace. the first '\' is for escaping '\'
1190 QStringList angleStringList = QStringList::split(sep, angst);
1193 for ( QStringList::Iterator it = angleStringList.begin();
1194 it != angleStringList.end(); ++it ) {
1195 // check (*it) is really a float
1196 // double QString::toDouble ( bool * ok = 0 ) const
1198 (*it).toDouble(&ok);
1202 // pn is already numerified value in prjnum field
1203 if(angleCount != pn) f=39;
1206 /* Consistency check for measurement section */
1208 if(noisybutton->isChecked()) {
1209 if(scatterbutton->isChecked()) {
1210 sp=strtof((const char *)sctnpk->text());
1215 sw=strtof((const char *)sctnwd->text());
1222 if(quantumbutton->isChecked() || additivebutton->isChecked() || multiplicativebutton->isChecked()) {
1223 sed=strtoi((const char *)seed->text());
1227 if(quantumbutton->isChecked()) {
1228 qm=strtof((const char *)quanmn->text());
1231 qc=strtof((const char *)quancm->text());
1237 if(additivebutton->isChecked()) {
1238 am=strtof((const char *)addnmn->text());
1241 as=strtof((const char *)addnsd->text());
1245 if(multiplicativebutton->isChecked()) {
1246 mm=strtof((const char *)multnmn->text());
1251 ms=strtof((const char *)multnsd->text());
1256 if(!quantumbutton->isChecked() && !scatterbutton->isChecked() && !additivebutton->isChecked() && !multiplicativebutton->isChecked())
1260 b1=strtof((const char *)backgr1->text());
1264 // and then do something based on value of error flag f
1269 case 21: QMessageBox::information(this,"SnarkInput","Error!\n"
1270 "Invalid source_to_origin format.");
1271 pseudoCommandsWidget->setCurrentPage(1);
1272 sourcetoorigin->setFocus();
1274 case 22: QMessageBox::information(this,"SnarkInput","Error!\n"
1275 "Invalid source_to_detector format.");
1276 pseudoCommandsWidget->setCurrentPage(1);
1277 sourcetodetector->setFocus();
1279 case 23: QMessageBox::information(this,"SnarkInput","Error!\n"
1280 "Invalid user_rays format.");
1281 pseudoCommandsWidget->setCurrentPage(1);
1282 userrays->setFocus();
1284 case 24: QMessageBox::information(this,"SnarkInput","Error!\n"
1285 "Invalid nelem format.");
1286 pseudoCommandsWidget->setCurrentPage(1);
1287 raysumsnelem->setFocus();
1289 case 25: QMessageBox::information(this,"SnarkInput","Error!\n"
1290 "Invalid pixel_size format.");
1291 pseudoCommandsWidget->setCurrentPage(1);
1292 raysumspixelsize->setFocus();
1294 case 26: QMessageBox::information(this,"SnarkInput","Error!\n"
1295 "Invalid detector_spacing format.");
1296 pseudoCommandsWidget->setCurrentPage(1);
1297 detectorspacing->setFocus();
1299 case 27: QMessageBox::information(this,"SnarkInput","Error!\n"
1300 "Invalid prjnum format.");
1301 pseudoCommandsWidget->setCurrentPage(1);
1304 case 28: QMessageBox::information(this,"SnarkInput","Error!\n"
1305 "Invalid first_angle format.");
1306 pseudoCommandsWidget->setCurrentPage(1);
1307 firstangle->setFocus();
1309 case 29: QMessageBox::information(this,"SnarkInput","Error!\n"
1310 "Invalid last_angle format.");
1311 pseudoCommandsWidget->setCurrentPage(1);
1312 lastangle->setFocus();
1314 case 30: QMessageBox::information(this,"SnarkInput","Error!\n"
1315 "source_to_origin must be positive.");
1316 pseudoCommandsWidget->setCurrentPage(1);
1317 sourcetoorigin->setFocus();
1319 case 31: QMessageBox::information(this,"SnarkInput","Error!\n"
1320 "source_to_detector must be positive.");
1321 pseudoCommandsWidget->setCurrentPage(1);
1322 sourcetodetector->setFocus();
1324 case 32: QMessageBox::information(this,"SnarkInput","Error!\n"
1325 "pixel_size must be positive.");
1326 pseudoCommandsWidget->setCurrentPage(1);
1327 raysumspixelsize->setFocus();
1329 case 33: QMessageBox::information(this,"SnarkInput","Error!\n"
1330 "detector_spacing must be equal or greater than 0.");
1331 pseudoCommandsWidget->setCurrentPage(1);
1332 detectorspacing->setFocus();
1334 case 34: QMessageBox::information(this,"SnarkInput","Error!\n"
1335 "user_rays must be positive and odd.");
1336 pseudoCommandsWidget->setCurrentPage(1);
1337 userrays->setFocus();
1339 case 35: QMessageBox::information(this,"SnarkInput","Error!\n"
1340 "nelem must be positive and odd.");
1341 pseudoCommandsWidget->setCurrentPage(1);
1342 raysumsnelem->setFocus();
1344 case 36: QMessageBox::information(this,"SnarkInput","Error!\n"
1345 "projnum must be positive, and greater than 1\n"
1346 "if LINO or EQUAL_SPACING is selected.");
1347 pseudoCommandsWidget->setCurrentPage(1);
1350 case 37: QMessageBox::information(this,"SnarkInput","Error!\n"
1351 "nelem * pixel_size/sqrt(2) must be smaller than source_to_detector.");
1352 pseudoCommandsWidget->setCurrentPage(1);
1353 raysumsnelem->setFocus();
1355 case 38: QMessageBox::information(this,"SnarkInput","Error!\n"
1356 "(user_rays-1) * detector_spacing must be smaller than source_to_detector * PI.");
1357 pseudoCommandsWidget->setCurrentPage(1);
1358 detectorspacing->setFocus();
1360 // case 39 is never reached, since this was only half implemented.
1361 case 39: QMessageBox::information(this,"SnarkInput","Error!\n"
1362 "number of angles must be equal to prjnum and each angle must be a floating-point number.");
1363 pseudoCommandsWidget->setCurrentPage(1);
1366 case 40: QMessageBox::information(this,"SnarkInput","Error!\n"
1367 "Invalid quanmn format.");
1368 pseudoCommandsWidget->setCurrentPage(2);
1371 case 41: QMessageBox::information(this,"SnarkInput","Error!\n"
1372 "Invalid quancm format.");
1373 pseudoCommandsWidget->setCurrentPage(2);
1376 case 42: QMessageBox::information(this,"SnarkInput","Error!\n"
1377 "Invalid sctnpk format.");
1378 pseudoCommandsWidget->setCurrentPage(2);
1381 case 43: QMessageBox::information(this,"SnarkInput","Error!\n"
1382 "Invalid sctnwd format.");
1383 pseudoCommandsWidget->setCurrentPage(2);
1386 case 44: QMessageBox::information(this,"SnarkInput","Error!\n"
1387 "Invalid addnmn format.");
1388 pseudoCommandsWidget->setCurrentPage(2);
1391 case 45: QMessageBox::information(this,"SnarkInput","Error!\n"
1392 "Invalid addnsd format.");
1393 pseudoCommandsWidget->setCurrentPage(2);
1396 case 46: QMessageBox::information(this,"SnarkInput","Error!\n"
1397 "Invalid multnmn format.");
1398 pseudoCommandsWidget->setCurrentPage(2);
1399 multnmn->setFocus();
1401 case 47: QMessageBox::information(this,"SnarkInput","Error!\n"
1402 "Invalid multnsd format.");
1403 pseudoCommandsWidget->setCurrentPage(2);
1404 multnsd->setFocus();
1406 case 48: QMessageBox::information(this,"SnarkInput","Error!\n"
1407 "Invalid seed format.");
1408 pseudoCommandsWidget->setCurrentPage(2);
1411 case 49: QMessageBox::information(this,"SnarkInput","Error!\n"
1412 "Invalid backgr(i) format.");
1413 pseudoCommandsWidget->setCurrentPage(2);
1414 backgr1->setFocus();
1416 case 50: QMessageBox::information(this,"SnarkInput","Error!\n"
1417 "quancm must be positive.");
1418 pseudoCommandsWidget->setCurrentPage(2);
1421 case 51: QMessageBox::information(this,"SnarkInput","Error!\n"
1422 "sctnpk must be positive");
1423 pseudoCommandsWidget->setCurrentPage(2);
1426 case 52: QMessageBox::information(this,"SnarkInput","Error!\n"
1427 "multnmn must be nonzero.");
1428 pseudoCommandsWidget->setCurrentPage(2);
1429 multnmn->setFocus();
1431 case 53: QMessageBox::information(this,"SnarkInput","Error!\n"
1432 "sctnwd must be greater than detector_spacing.");
1433 pseudoCommandsWidget->setCurrentPage(2);
1436 case 54: QMessageBox::information(this,"SnarkInput","Error!\n"
1437 "if NOISY is selected at least one of the options\n"
1438 " QUANTUM, SCATTER, ADDITIVE OR MULTIPLICATIVE must be selected too.");
1439 pseudoCommandsWidget->setCurrentPage(2);
1440 quantumbutton->setFocus();
1443 } // -- if didn't fail at the idheader
1444 } // -- if pseudo /was/ checked
1445 } // --projectionwindow::checkValues()