1 /*********************************************************************
2 Segment - Segment initial labels based on signal structure.
3 Segment is part of GNU Astronomy Utilities (Gnuastro) package.
4 
5 Original author:
6      Mohammad Akhlaghi <mohammad@akhlaghi.org>
7 Contributing author(s):
8 Copyright (C) 2018-2021, Free Software Foundation, Inc.
9 
10 Gnuastro is free software: you can redistribute it and/or modify it
11 under the terms of the GNU General Public License as published by the
12 Free Software Foundation, either version 3 of the License, or (at your
13 option) any later version.
14 
15 Gnuastro is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
22 **********************************************************************/
23 #ifndef UI_H
24 #define UI_H
25 
26 /* For common options groups. */
27 #include <gnuastro-internal/options.h>
28 
29 
30 
31 
32 
33 /* Macros. */
34 #define UI_NO_CONV_KERNEL_NAME "none"
35 
36 
37 
38 
39 
40 /* Option groups particular to this program. */
41 enum program_args_groups
42 {
43   UI_GROUP_SEGMENTATION = GAL_OPTIONS_GROUP_AFTER_COMMON,
44 };
45 
46 
47 
48 
49 
50 /* Available letters for short options:
51 
52    a b e f g i j l n p r t u w x z
53    A E H J Q R W X Y
54 */
55 enum option_keys_enum
56 {
57   /* With short-option version. */
58   UI_KEY_KERNEL             = 'k',
59   UI_KEY_DETECTION          = 'd',
60   UI_KEY_LARGETILESIZE      = 'L',
61   UI_KEY_MINSKYFRAC         = 'B',
62   UI_KEY_SNMINAREA          = 'm',
63   UI_KEY_SNQUANT            = 'c',
64   UI_KEY_KEEPMAXNEARRIVER   = 'v',
65   UI_KEY_CLUMPSNTHRESH      = 's',
66   UI_KEY_GTHRESH            = 'G',
67   UI_KEY_MINRIVERLENGTH     = 'y',
68   UI_KEY_OBJBORDERSN        = 'O',
69   UI_KEY_CONTINUEAFTERCHECK = 'C',
70 
71   /* Only with long version (start with a value 1000, the rest will be set
72      automatically). */
73   UI_KEY_KHDU               = 1000,
74   UI_KEY_CONVOLVED,
75   UI_KEY_CHDU,
76   UI_KEY_DHDU,
77   UI_KEY_SKY,
78   UI_KEY_SKYHDU,
79   UI_KEY_STD,
80   UI_KEY_STDHDU,
81   UI_KEY_VARIANCE,
82   UI_KEY_MINIMA,
83   UI_KEY_RAWOUTPUT,
84   UI_KEY_MINNUMFALSE,
85   UI_KEY_ONLYCLUMPS,
86   UI_KEY_GROWNCLUMPS,
87   UI_KEY_CHECKSN,
88   UI_KEY_CHECKSEGMENTATION,
89 };
90 
91 
92 
93 
94 
95 void
96 ui_read_check_inputs_setup(int argc, char *argv[], struct segmentparams *p);
97 
98 void
99 ui_abort_after_check(struct segmentparams *p, char *filename, char *file2name,
100                      char *description);
101 
102 void
103 ui_free_report(struct segmentparams *p, struct timeval *t1);
104 
105 #endif
106