1 /*****************************************************************************
2    Major portions of this software are copyrighted by the Medical College
3    of Wisconsin, 1994-2000, and are released under the Gnu General Public
4    License, Version 2.  See the file README.Copyright for details.
5 ******************************************************************************/
6 
7 #include "mrilib.h"
8 
9 /**--------------------------------------------------------------------
10    Check option # nopt to see if it is a legal dataset editing command.
11    If so, put its value into "edopt" and return the number of options
12    consumed.  If not, return 0.  An illegal editing option results in
13    a fatal error!
14 -----------------------------------------------------------------------**/
15 
16 #define CHECK_DONE RETURN(nopt-nopt_in)
17 
EDIT_check_argv(int argc,char * argv[],int nopt,EDIT_options * edopt)18 int EDIT_check_argv( int argc , char * argv[] , int nopt , EDIT_options * edopt )
19 {
20    float val ;
21    int  ival , nopt_in=nopt ;
22 
23 ENTRY("EDIT_check_argv") ;
24 
25    /**** -1clip val ****/
26 
27    if( strncmp(argv[nopt],"-1clip" ,6) == 0 ||
28        strncmp(argv[nopt],"-1uclip",6) == 0 ){
29       nopt++ ;
30       if( nopt >= argc ){
31          fprintf(stderr,"no argument after %s?\n",argv[nopt-1]) ; EXIT(1);
32       }
33       edopt->clip_top = strtod( argv[nopt++] , NULL ) ;
34       if( edopt->clip_top <= 0 ){
35          fprintf(stderr,"illegal value after %s!\n",argv[nopt-2]) ; EXIT(1) ;
36       }
37       edopt->clip_bot = -edopt->clip_top ;
38       edopt->clip_unscaled = (strncmp(argv[nopt-2],"-1uclip",6) == 0) ;
39       CHECK_DONE ;
40    }
41 
42    /**** -2clip val1 val2 ****/
43 
44    if( strncmp(argv[nopt],"-2clip" ,6) == 0 ||
45        strncmp(argv[nopt],"-2uclip",6) == 0   ){
46       nopt++ ;
47       if( nopt+1 >= argc ){
48          fprintf(stderr,"no arguments after %s?\n",argv[nopt-1]) ; EXIT(1) ;
49       }
50       edopt->clip_bot = strtod( argv[nopt++] , NULL ) ;  /* bot */
51       edopt->clip_top = strtod( argv[nopt++] , NULL ) ;  /* top */
52 
53       if( edopt->clip_bot >= edopt->clip_top ){
54          fprintf(stderr,
55                  "*** %s %f %f is illegal:\n"
56                  "*** first value must be less than second value!\n",
57                  argv[nopt-3] , edopt->clip_bot , edopt->clip_top ) ;
58          EXIT(1) ;
59       }
60       edopt->clip_unscaled = (strncmp(argv[nopt-3],"-2uclip",6) == 0) ;
61       CHECK_DONE ;
62    }
63 
64    /**** -1thtoin ****/
65 
66    if( strncmp(argv[nopt],"-1thtoin",6) == 0 ){
67       edopt->thtoin = 1 ;
68       nopt++ ; CHECK_DONE ;
69    }
70 
71    /**** -2thtoin ****/
72 
73    if( strncmp(argv[nopt],"-2thtoin",6) == 0 ){
74       edopt->thtoin = 2 ;
75       nopt++ ; CHECK_DONE ;
76    }
77 
78    /**** -1zscore (17 Sep 1998) ****/
79 
80    if( strncmp(argv[nopt],"-1zscore",6) == 0 ){
81       edopt->zscore = 1 ;
82       nopt++ ; CHECK_DONE ;
83    }
84 
85    /**** -dxyz=1 (11 Sep 2000) ****/
86 
87    if( strcmp(argv[nopt],"-dxyz=1") == 0 ){
88       edopt->fake_dxyz = 1 ;
89       nopt++ ; CHECK_DONE ;
90    }
91 
92    /**** -1noneg ****/
93 
94    if( strncmp(argv[nopt],"-1noneg",6) == 0 ){
95       edopt->noneg = 1 ;
96       nopt++ ; CHECK_DONE ;
97    }
98 
99    /**** -1abs ****/
100 
101    if( strncmp(argv[nopt],"-1abs",6) == 0 ){
102       edopt->abss = 1 ;
103       nopt++ ; CHECK_DONE ;
104    }
105 
106    /**** -1thresh thr ****/
107 
108    if( strncmp(argv[nopt],"-1thresh",6) == 0 ){
109       nopt++ ;
110       if( nopt >= argc ){
111          fprintf(stderr,"no argument after -1thresh!\n") ; EXIT(1);
112       }
113       val = strtod( argv[nopt++] , NULL ) ;
114       if( val < 0.0 ){
115          fprintf(stderr,"illegal value after -1thresh!\n") ; EXIT(1) ;
116       }
117       edopt->thresh =  val ;
118       edopt->thbot  = -val ;  /* 26 Dec 2007 */
119       CHECK_DONE ;
120    }
121 
122    /**** -2thresh bot top [26 Dec 2007] ****/
123 
124    if( strncmp(argv[nopt],"-2thresh",6) == 0 ){
125       float v1,v2 ;
126       nopt++ ;
127       if( nopt+1 >= argc ){
128          fprintf(stderr,"need 2 arguments after -2thresh!\n") ; EXIT(1);
129       }
130       v1 = strtod( argv[nopt++] , NULL ) ;
131       v2 = strtod( argv[nopt++] , NULL ) ;
132       if( v1 >= v2 ) ERROR_exit("Illegal values after -2thresh") ;
133       edopt->thresh = v2 ;
134       edopt->thbot  = v1 ;
135       CHECK_DONE ;
136    }
137 
138    /**** -1clust rmm vmul ****/
139 
140    if( strncmp(argv[nopt],"-1clust",12) == 0 ){
141       nopt++ ;
142       if( nopt+1 >= argc ){
143          fprintf(stderr,"need 2 arguments after -1clust!\n") ; EXIT(1) ;
144       }
145       edopt->edit_clust = ECFLAG_SAME;
146       edopt->clust_rmm  = strtod( argv[nopt++] , NULL ) ;
147       edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ;
148       if( edopt->clust_rmm < 0 ){
149          fprintf(stderr,"illegal value after -1clust\n") ; EXIT(1) ;
150       }
151       CHECK_DONE ;
152    }
153 
154 
155    /**** -1clust_mean rmm vmul ****/   /* 10 Sept 1996 */
156 
157    if( strncmp(argv[nopt],"-1clust_mean",12) == 0 ){
158       nopt++ ;
159       if( nopt+1 >= argc ){
160          fprintf(stderr,"need 2 arguments after -1clust_mean!\n") ; EXIT(1) ;
161       }
162       edopt->edit_clust = ECFLAG_MEAN;
163       edopt->clust_rmm  = strtod( argv[nopt++] , NULL ) ;
164       edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ;
165       if( edopt->clust_rmm < 0 ){
166          fprintf(stderr,"illegal value after -1clust_mean\n") ; EXIT(1) ;
167       }
168       CHECK_DONE ;
169    }
170 
171    /**** -1clust_max rmm vmul ****/   /* 10 Sept 1996 */
172 
173    if( strncmp(argv[nopt],"-1clust_max",12) == 0 ){
174       nopt++ ;
175       if( nopt+1 >= argc ){
176          fprintf(stderr,"need 2 arguments after -1clust_max!\n") ; EXIT(1) ;
177       }
178       edopt->edit_clust = ECFLAG_MAX;
179       edopt->clust_rmm  = strtod( argv[nopt++] , NULL ) ;
180       edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ;
181       if( edopt->clust_rmm < 0 ){
182          fprintf(stderr,"illegal value after -1clust_max\n") ; EXIT(1) ;
183       }
184       CHECK_DONE ;
185    }
186 
187    /**** -1clust_amax rmm vmul ****/   /* 10 Sept 1996 */
188 
189    if( strncmp(argv[nopt],"-1clust_amax",12) == 0 ){
190       nopt++ ;
191       if( nopt+1 >= argc ){
192          fprintf(stderr,"need 2 arguments after -1clust_amax!\n") ; EXIT(1) ;
193       }
194       edopt->edit_clust = ECFLAG_AMAX;
195       edopt->clust_rmm  = strtod( argv[nopt++] , NULL ) ;
196       edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ;
197       if( edopt->clust_rmm < 0 ){
198          fprintf(stderr,"illegal value after -1clust_amax\n") ; EXIT(1) ;
199       }
200       CHECK_DONE ;
201    }
202 
203    /**** -1clust_smax rmm vmul ****/   /* 10 Sept 1996 */
204 
205    if( strncmp(argv[nopt],"-1clust_smax",12) == 0 ){
206       nopt++ ;
207       if( nopt+1 >= argc ){
208          fprintf(stderr,"need 2 arguments after -1clust_smax!\n") ; EXIT(1) ;
209       }
210       edopt->edit_clust = ECFLAG_SMAX;
211       edopt->clust_rmm  = strtod( argv[nopt++] , NULL ) ;
212       edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ;
213       if( edopt->clust_rmm < 0 ){
214          fprintf(stderr,"illegal value after -1clust_smax\n") ; EXIT(1) ;
215       }
216       CHECK_DONE ;
217    }
218 
219    /**** -1clust_size rmm vmul ****/   /* 10 Sept 1996 */
220 
221    if( strncmp(argv[nopt],"-1clust_size",12) == 0 ){
222       nopt++ ;
223       if( nopt+1 >= argc ){
224          fprintf(stderr,"need 2 arguments after -1clust_size!\n") ; EXIT(1) ;
225       }
226       edopt->edit_clust = ECFLAG_SIZE;
227       edopt->clust_rmm  = strtod( argv[nopt++] , NULL ) ;
228       edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ;
229       if( edopt->clust_rmm < 0 ){
230          fprintf(stderr,"illegal value after -1clust_size\n") ; EXIT(1) ;
231       }
232       CHECK_DONE ;
233    }
234 
235    /**** -1clust_order rmm vmul ****/   /* 09 June 1998 */
236 
237    if( strncmp(argv[nopt],"-1clust_order",12) == 0 ){
238       nopt++ ;
239       if( nopt+1 >= argc ){
240          fprintf(stderr,"need 2 arguments after -1clust_order!\n") ; EXIT(1) ;
241       }
242       edopt->edit_clust = ECFLAG_ORDER;
243       edopt->clust_rmm  = strtod( argv[nopt++] , NULL ) ;
244       edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ;
245       if( edopt->clust_rmm < 0 ){
246          fprintf(stderr,"illegal value after -1clust_order\n") ; EXIT(1) ;
247       }
248       CHECK_DONE ;
249    }
250 
251    /**** -1clust_depth rmm vmul ****/   /* 09 June 1998 */
252 
253    if( strncmp(argv[nopt],"-1clust_depth",12) == 0 ){
254       nopt++ ;
255       if( nopt+1 >= argc ){
256          fprintf(stderr,"need 2 arguments after -1clust_depth!\n") ; EXIT(1) ;
257       }
258       edopt->edit_clust = ECFLAG_DEPTH;
259       edopt->clust_rmm  = strtod( argv[nopt++] , NULL ) ;
260       edopt->clust_vmul = strtod( argv[nopt++] , NULL ) ;
261       if( edopt->clust_rmm < 0 ){
262          fprintf(stderr,"illegal value after -1clust_depth\n") ; EXIT(1) ;
263       }
264       CHECK_DONE ;
265    }
266 
267    /**** 03 March 2010 ZSS: -isovalue and -isomerge ****/
268 
269    if( strcmp(argv[nopt],"-isovalue") == 0 ){
270       edopt->isomode = ISOVALUE_MODE ;
271       nopt++ ;  CHECK_DONE;
272    }
273 
274    if( strcmp(argv[nopt],"-isomerge") == 0 ){
275       edopt->isomode = ISOMERGE_MODE ;
276       nopt++ ; CHECK_DONE ;
277    }
278 
279    /**** -1erode pv ****/   /* 17 June 1998 */
280 
281    if( strncmp(argv[nopt],"-1erode",7) == 0 ){
282       nopt++ ;
283       if( nopt >= argc ){
284          fprintf(stderr,"need 1 argument after -1erode!\n") ; EXIT(1) ;
285       }
286       edopt->erode_pv  = strtod( argv[nopt++] , NULL ) ;
287       if (edopt->erode_pv > 1.0)  edopt->erode_pv /= 100.0;
288       if( edopt->erode_pv < 0.0 || edopt->erode_pv > 1.0 ){
289          fprintf(stderr,"illegal value after -1erode \n") ; EXIT(1) ;
290       }
291       CHECK_DONE ;
292    }
293 
294    /**** -1dilate ****/   /* 17 June 1998 */
295 
296    if( strncmp(argv[nopt],"-1dilate",8) == 0 ){
297       nopt++ ;
298       edopt->dilate = 1;
299       CHECK_DONE ;
300    }
301 
302    /**** -1filter_mean rmm ****/   /* 11 Sept 1996 */
303 
304    if( strncmp(argv[nopt],"-1filter_mean",15) == 0 ){
305       nopt++ ;
306       if( nopt >= argc ){
307          fprintf(stderr,"need 1 argument  after -1filter_mean \n") ; EXIT(1) ;
308       }
309       edopt->filter_opt = FCFLAG_MEAN;
310       edopt->filter_rmm  = strtod( argv[nopt++] , NULL ) ;
311       if( edopt->filter_rmm <= 0 ){
312          fprintf(stderr,"illegal value after -1filter_mean \n") ; EXIT(1) ;
313       }
314       CHECK_DONE ;
315    }
316 
317    /**** -1filter_nzmean rmm ****/   /* 11 Sept 1996 */
318 
319    if( strncmp(argv[nopt],"-1filter_nzmean",15) == 0 ){
320       nopt++ ;
321       if( nopt >= argc ){
322          fprintf(stderr,"need 1 argument  after -1filter_nzmean \n") ; EXIT(1) ;
323       }
324       edopt->filter_opt = FCFLAG_NZMEAN;
325       edopt->filter_rmm  = strtod( argv[nopt++] , NULL ) ;
326       if( edopt->filter_rmm <= 0 ){
327          fprintf(stderr,"illegal value after -1filter_nzmean \n") ; EXIT(1) ;
328       }
329       CHECK_DONE ;
330    }
331 
332    /**** -1filter_max rmm ****/   /* 11 Sept 1996 */
333 
334    if( strncmp(argv[nopt],"-1filter_max",15) == 0 ){
335       nopt++ ;
336       if( nopt >= argc ){
337          fprintf(stderr,"need 1 argument  after -1filter_max \n") ; EXIT(1) ;
338       }
339       edopt->filter_opt = FCFLAG_MAX;
340       edopt->filter_rmm  = strtod( argv[nopt++] , NULL ) ;
341       if( edopt->filter_rmm <= 0 ){
342          fprintf(stderr,"illegal value after -1filter_max \n") ; EXIT(1) ;
343       }
344       CHECK_DONE ;
345    }
346 
347    /**** -1filter_amax rmm ****/   /* 11 Sept 1996 */
348 
349    if( strncmp(argv[nopt],"-1filter_amax",15) == 0 ){
350       nopt++ ;
351       if( nopt >= argc ){
352          fprintf(stderr,"need 1 argument  after -1filter_amax \n") ; EXIT(1) ;
353       }
354       edopt->filter_opt = FCFLAG_AMAX;
355       edopt->filter_rmm  = strtod( argv[nopt++] , NULL ) ;
356       if( edopt->filter_rmm <= 0 ){
357          fprintf(stderr,"illegal value after -1filter_amax \n") ; EXIT(1) ;
358       }
359       CHECK_DONE ;
360    }
361 
362    /**** -1filter_smax rmm ****/   /* 11 Sept 1996 */
363 
364    if( strncmp(argv[nopt],"-1filter_smax",15) == 0 ){
365       nopt++ ;
366       if( nopt >= argc ){
367          fprintf(stderr,"need 1 argument  after -1filter_smax \n") ; EXIT(1) ;
368       }
369       edopt->filter_opt = FCFLAG_SMAX;
370       edopt->filter_rmm  = strtod( argv[nopt++] , NULL ) ;
371       if( edopt->filter_rmm <= 0 ){
372          fprintf(stderr,"illegal value after -1filter_smax \n") ; EXIT(1) ;
373       }
374       CHECK_DONE ;
375    }
376 
377    /**** -1filter_aver rmm ****/   /* 07 Jan 1998 */
378 
379    if( strncmp(argv[nopt],"-1filter_aver",15) == 0 ){
380       nopt++ ;
381       if( nopt >= argc ){
382          fprintf(stderr,"need 1 argument  after -1filter_aver \n") ; EXIT(1) ;
383       }
384       edopt->filter_opt = FCFLAG_AVER ;
385       edopt->filter_rmm  = strtod( argv[nopt++] , NULL ) ;
386       if( edopt->filter_rmm <= 0 ){
387          fprintf(stderr,"illegal value after -1filter_aver \n") ; EXIT(1) ;
388       }
389 
390       if( edopt->nfmask > 0 ) edopt->filter_opt = FCFLAG_MEAN ;
391       CHECK_DONE ;
392    }
393 
394 
395    /**** -t1filter_aver rmm ****/   /* 07 Jan 1998 */
396 
397    if( strncmp(argv[nopt],"-t1filter_aver",15) == 0 ){
398       nopt++ ;
399       if( nopt >= argc ){
400          fprintf(stderr,"need 1 argument  after -t1filter_aver \n") ; EXIT(1) ;
401       }
402       edopt->thrfilter_opt = FCFLAG_AVER ;
403       edopt->thrfilter_rmm  = strtod( argv[nopt++] , NULL ) ;
404       if( edopt->thrfilter_rmm <= 0 ){
405          fprintf(stderr,"illegal value after -t1filter_aver \n") ; EXIT(1) ;
406       }
407 
408       if( edopt->nfmask > 0 ) edopt->thrfilter_opt = FCFLAG_MEAN ;
409       CHECK_DONE ;
410    }
411 
412 
413    /**** -t1filter_mean rmm ****/   /* 1 Oct 1996 */
414 
415    if( strncmp(argv[nopt],"-t1filter_mean",15) == 0 ){
416       nopt++ ;
417       if( nopt >= argc ){
418          fprintf(stderr,"need 1 argument  after -t1filter_mean \n") ; EXIT(1) ;
419       }
420       edopt->thrfilter_opt = FCFLAG_MEAN;
421       edopt->thrfilter_rmm  = strtod( argv[nopt++] , NULL ) ;
422       if( edopt->thrfilter_rmm <= 0 ){
423          fprintf(stderr,"illegal value after -t1filter_mean \n") ; EXIT(1) ;
424       }
425       CHECK_DONE ;
426    }
427 
428 
429    /**** -t1filter_nzmean rmm ****/   /* 1 Oct 1996 */
430 
431    if( strncmp(argv[nopt],"-t1filter_nzmean",15) == 0 ){
432       nopt++ ;
433       if( nopt >= argc ){
434          fprintf(stderr,"need 1 argument  after -t1filter_nzmean \n") ; EXIT(1) ;
435       }
436       edopt->thrfilter_opt = FCFLAG_NZMEAN;
437       edopt->thrfilter_rmm  = strtod( argv[nopt++] , NULL ) ;
438       if( edopt->thrfilter_rmm <= 0 ){
439          fprintf(stderr,"illegal value after -t1filter_nzmean \n") ; EXIT(1) ;
440       }
441       CHECK_DONE ;
442    }
443 
444 
445    /**** -t1filter_max rmm ****/   /* 1 Oct 1996 */
446 
447    if( strncmp(argv[nopt],"-t1filter_max",15) == 0 ){
448       nopt++ ;
449       if( nopt >= argc ){
450          fprintf(stderr,"need 1 argument  after -t1filter_max \n") ; EXIT(1) ;
451       }
452       edopt->thrfilter_opt = FCFLAG_MAX;
453       edopt->thrfilter_rmm  = strtod( argv[nopt++] , NULL ) ;
454       if( edopt->thrfilter_rmm <= 0 ){
455          fprintf(stderr,"illegal value after -t1filter_max \n") ; EXIT(1) ;
456       }
457       CHECK_DONE ;
458    }
459 
460 
461    /**** -t1filter_amax rmm ****/   /* 1 Oct 1996 */
462 
463    if( strncmp(argv[nopt],"-t1filter_amax",15) == 0 ){
464       nopt++ ;
465       if( nopt >= argc ){
466          fprintf(stderr,"need 1 argument  after -t1filter_amax \n") ; EXIT(1) ;
467       }
468       edopt->thrfilter_opt = FCFLAG_AMAX;
469       edopt->thrfilter_rmm  = strtod( argv[nopt++] , NULL ) ;
470       if( edopt->thrfilter_rmm <= 0 ){
471          fprintf(stderr,"illegal value after -t1filter_amax \n") ; EXIT(1) ;
472       }
473       CHECK_DONE ;
474    }
475 
476 
477    /**** -t1filter_smax rmm ****/   /* 1 Oct 1996 */
478 
479    if( strncmp(argv[nopt],"-t1filter_smax",15) == 0 ){
480       nopt++ ;
481       if( nopt >= argc ){
482          fprintf(stderr,"need 1 argument  after -t1filter_smax \n") ; EXIT(1) ;
483       }
484       edopt->thrfilter_opt = FCFLAG_SMAX;
485       edopt->thrfilter_rmm  = strtod( argv[nopt++] , NULL ) ;
486       if( edopt->thrfilter_rmm <= 0 ){
487          fprintf(stderr,"illegal value after -t1filter_smax \n") ; EXIT(1) ;
488       }
489       CHECK_DONE ;
490    }
491 
492    /**** -1blur_sigma size ****/
493 
494    if( strncmp(argv[nopt],"-1blur_sigma",12) == 0 ){
495       nopt++ ;
496       if( nopt >= argc ){
497          fprintf(stderr,"need argument after -1blur_sigma!\n") ; EXIT(1) ;
498       }
499       edopt->blur = strtod( argv[nopt++] , NULL ) ;
500       if( edopt->blur <= 0 ){
501          fprintf(stderr,"illegal value after -1blur_sigma\n") ; EXIT(1) ;
502       }
503       CHECK_DONE ;
504    }
505 
506    /**** -1blur_rms size ****/
507 
508    if( strncmp(argv[nopt],"-1blur_rms",12) == 0 ){
509       nopt++ ;
510       if( nopt >= argc ){
511          fprintf(stderr,"need argument after -1blur_rms!\n") ; EXIT(1) ;
512       }
513       edopt->blur = strtod( argv[nopt++] , NULL ) ;
514       if( edopt->blur <= 0 ){
515          fprintf(stderr,"illegal value after -1blur_rms\n") ; EXIT(1) ;
516       }
517       edopt->blur = RMS_TO_SIGMA(edopt->blur) ;
518       CHECK_DONE ;
519    }
520 
521    /**** -1blur3D_fwhm xsize ysize zsize [17 Jun 2019] ****/
522 
523    if( strncmp(argv[nopt],"-1blur3D_fwhm",13) == 0 ){
524       nopt++ ;
525       if( nopt+2 >= argc ){
526          fprintf(stderr,"need 3 arguments after -1blur3D_fwhm!\n") ; EXIT(1) ;
527       }
528       edopt->blurx = strtod( argv[nopt++] , NULL ) ;
529       edopt->blury = strtod( argv[nopt++] , NULL ) ;
530       edopt->blurz = strtod( argv[nopt++] , NULL ) ;
531       if( edopt->blurx <= 0.0f && edopt->blury <= 0.0f && edopt->blurz <= 0.0f ){
532         WARNING_message("-1blur3D_fwhm: all values are non-positive -- ignoring") ;
533       } else {
534         edopt->blurx = FWHM_TO_SIGMA(edopt->blurx) ;
535         edopt->blury = FWHM_TO_SIGMA(edopt->blury) ;
536         edopt->blurz = FWHM_TO_SIGMA(edopt->blurz) ;
537       }
538       CHECK_DONE ;
539    }
540 
541    /**** -1blur_fwhm size ****/
542 
543    if( strncmp(argv[nopt],"-1blur_fwhm",11) == 0 ){
544       nopt++ ;
545       if( nopt >= argc ){
546          fprintf(stderr,"need argument after -1blur_fwhm!\n") ; EXIT(1) ;
547       }
548       edopt->blur = strtod( argv[nopt++] , NULL ) ;
549       if( edopt->blur <= 0.0 ){
550         WARNING_message("-1blur_fwhm: blur value is non-positive -- ignoring") ;
551       } else {
552         edopt->blur = FWHM_TO_SIGMA(edopt->blur) ;
553       }
554       CHECK_DONE ;
555    }
556 
557 #if 0
558    /**** -1blur ****/
559 
560    if( strncmp(argv[nopt],"-1blur",6) == 0 ){
561       fprintf(stderr,
562               "*** the old -1blur option is no longer valid! ***\n") ;
563       EXIT(1) ;
564    }
565 #endif
566 
567    /**** -t1blur_sigma size ****/   /* 4 Oct 1996 */
568 
569    if( strncmp(argv[nopt],"-t1blur_sigma",12) == 0 ){
570       nopt++ ;
571       if( nopt >= argc ){
572          fprintf(stderr,"need argument after -t1blur_sigma!\n") ; EXIT(1) ;
573       }
574       edopt->thrblur = strtod( argv[nopt++] , NULL ) ;
575       if( edopt->thrblur <= 0 ){
576          fprintf(stderr,"illegal value after -t1blur_sigma\n") ; EXIT(1) ;
577       }
578       CHECK_DONE ;
579    }
580 
581    /**** -t1blur_rms size ****/   /* 4 Oct 1996 */
582 
583    if( strncmp(argv[nopt],"-t1blur_rms",12) == 0 ){
584       nopt++ ;
585       if( nopt >= argc ){
586          fprintf(stderr,"need argument after -t1blur_rms!\n") ; EXIT(1) ;
587       }
588       edopt->thrblur = strtod( argv[nopt++] , NULL ) ;
589       if( edopt->thrblur <= 0 ){
590          fprintf(stderr,"illegal value after -t1blur_rms\n") ; EXIT(1) ;
591       }
592       edopt->thrblur = RMS_TO_SIGMA(edopt->thrblur) ;
593       CHECK_DONE ;
594    }
595 
596    /**** -t1blur_fwhm size ****/   /* 4 Oct 1996 */
597 
598    if( strncmp(argv[nopt],"-t1blur_fwhm",12) == 0 ){
599       nopt++ ;
600       if( nopt >= argc ){
601          fprintf(stderr,"need argument after -t1blur_fwhm!\n") ; EXIT(1) ;
602       }
603       edopt->thrblur = strtod( argv[nopt++] , NULL ) ;
604       if( edopt->thrblur <= 0 ){
605          fprintf(stderr,"illegal value after -t1blur_fwhm\n") ; EXIT(1) ;
606       }
607       edopt->thrblur = FWHM_TO_SIGMA(edopt->thrblur) ;
608       CHECK_DONE ;
609    }
610 
611 
612    /**** -1scale ****/
613 
614    if( strncmp(argv[nopt],"-1scale",6) == 0 ){
615 #ifdef ALLOW_SCALE_TO_MAX
616       edopt->scale = 1 ;
617 #else
618       fprintf(stderr,
619               "*** the old -1scale option is no longer valid! ***\n") ;
620 #endif
621       nopt++ ; CHECK_DONE ;
622    }
623 
624    /**** -1mult mult ****/
625 
626    if( strncmp(argv[nopt],"-1mult",6) == 0 ){
627       nopt++ ;
628       if( nopt >= argc ){
629          fprintf(stderr,"no argument after -1mult!\n") ; EXIT(1);
630       }
631       val = strtod( argv[nopt++] , NULL ) ;
632       if( val == 0.0 ){
633          fprintf(stderr,"illegal value after -1mult!\n") ; EXIT(1) ;
634       }
635       edopt->mult = val ;
636       CHECK_DONE ;
637     }
638 
639     /**** -1zvol x1 x2 y1 y2 z1 z2 ***/
640 
641     if( strncmp(argv[nopt],"-1zvol",6) == 0 ){
642       char * cerr ;
643 
644       if( nopt+6 >= argc ){
645          fprintf(stderr,"need 6 arguments after -1zvol!\a\n") ; EXIT(1) ;
646       }
647 
648       edopt->zv_x1 = strtod( argv[nopt+1] , &cerr ) ;
649       if( cerr == argv[nopt+1] ){
650          fprintf(stderr,"illegal 1st argument after -1zvol!\a\n") ; EXIT(1) ;
651       }
652 
653       edopt->zv_x2 = strtod( argv[nopt+2] , &cerr ) ;
654       if( cerr == argv[nopt+2] ){
655          fprintf(stderr,"illegal 2nd argument after -1zvol!\a\n") ; EXIT(1) ;
656       }
657 
658       edopt->zv_y1 = strtod( argv[nopt+3] , &cerr ) ;
659       if( cerr == argv[nopt+3] ){
660          fprintf(stderr,"illegal 3rd argument after -1zvol!\a\n") ; EXIT(1) ;
661       }
662 
663       edopt->zv_y2 = strtod( argv[nopt+4] , &cerr ) ;
664       if( cerr == argv[nopt+4] ){
665          fprintf(stderr,"illegal 4th argument after -1zvol!\a\n") ; EXIT(1) ;
666       }
667 
668       edopt->zv_z1 = strtod( argv[nopt+5] , &cerr ) ;
669       if( cerr == argv[nopt+5] ){
670          fprintf(stderr,"illegal 5th argument after -1zvol!\a\n") ; EXIT(1) ;
671       }
672 
673       edopt->zv_z2 = strtod( argv[nopt+6] , &cerr ) ;
674       if( cerr == argv[nopt+6] ){
675          fprintf(stderr,"illegal 6th argument after -1zvol!\a\n") ; EXIT(1) ;
676       }
677       edopt->do_zvol = 1 ;
678 
679       nopt += 7 ; CHECK_DONE ;
680    }
681 
682    RETURN( 0 );
683 }
684