nabu_config.py 23.1 KB
Newer Older
Pierre Paleo's avatar
Pierre Paleo committed
1
from .validators import *
Pierre Paleo's avatar
Pierre Paleo committed
2
from .. import __version__
Pierre Paleo's avatar
Pierre Paleo committed
3

Pierre Paleo's avatar
Pierre Paleo committed
4
5
6
7
8
9
#
# option "type":
#  - required: always visible, user must provide a valid value
#  - optional: visible, but might be left blank
#  - advanced: optional and not visible by default
#  - unsupported: hidden (not implemented yet)
10
11
12
13
14
15
16
_options_levels = {
    "required": 0,
    "optional": 1,
    "advanced": 2,
    "unsupported": 10,
}

Pierre Paleo's avatar
Pierre Paleo committed
17

Pierre Paleo's avatar
Pierre Paleo committed
18
19
20
nabu_config = {
    "dataset": {
        "location": {
Pierre Paleo's avatar
Pierre Paleo committed
21
            "default": "",
22
            "help": "Dataset location, either a directory or a HDF5-Nexus file.",
Pierre Paleo's avatar
Pierre Paleo committed
23
            "validator": dataset_location_validator,
Pierre Paleo's avatar
Pierre Paleo committed
24
            "type": "required",
Pierre Paleo's avatar
Pierre Paleo committed
25
        },
26
27
28
29
30
31
        "hdf5_entry": {
            "default": "",
            "help": "Entry in the HDF5 file, if applicable. Default is the first available entry.",
            "validator": optional_string_validator,
            "type": "advanced",
        },
32
33
        "binning": {
            "default": "1",
Pierre Paleo's avatar
Pierre Paleo committed
34
            "help": "Binning factor in the horizontal dimension when reading the data.\nThe final slices dimensions will be divided by 'slices_binning'",
35
            "validator": binning_validator,
Pierre Paleo's avatar
Pierre Paleo committed
36
            "type": "advanced",
37
38
39
        },
        "binning_z": {
            "default": "1",
Pierre Paleo's avatar
Pierre Paleo committed
40
            "help": "Binning factor in the vertical dimension when reading the data.\nThis retsults in a lesser number of reconstructed slices.",
41
            "validator": binning_validator,
Pierre Paleo's avatar
Pierre Paleo committed
42
            "type": "advanced",
43
44
45
46
47
        },
        "projections_subsampling": {
            "default": "1",
            "help": "Projections subsampling factor: take one projection out of 'projection_subsampling'",
            "validator": binning_validator,
Pierre Paleo's avatar
Pierre Paleo committed
48
            "type": "advanced",
49
        },
50
51
52
53
54
55
        "exclude_projections": {
            "default": "",
            "help": "Path to a file name containing projections to exclude (projection indices).",
            "validator": optional_file_location_validator,
            "type": "advanced",
        },
Pierre Paleo's avatar
Pierre Paleo committed
56
57
58
59
    },
    "preproc": {
        "flatfield_enabled": {
            "default": "1",
60
61
            "help": "Whether to enable flat-field normalization. If the value is 'forced', then nabu will perform flatfield regardless of the dataset by attempting to load flats/refs from tomwer_processes.h5 file or nabu_processes.h5 or file provided in 'processes_file'.",
            "validator": flatfield_enabled_validator,
62
            "type": "required",
Pierre Paleo's avatar
Pierre Paleo committed
63
        },
64
65
66
67
68
69
70
71
72
73
74
75
        "flat_distortion_correction_enabled": {
            "default": "0",
            "help": "Whether to correct for flat distortion. If activated, each radio is correlated with its corresponding flat, in order to determine and correct the flat distortion.",
            "validator": boolean_validator,
            "type": "advanced",
        },
        "flat_distortion_params": {
            "default": "tile_size=100; interpolation_kind='linear'; padding_mode='edge'; correction_spike_threshold=None",
            "help": "Advanced parameters for flat distortion correction",
            "validator": optional_string_validator,
            "type": "advanced",
        },
Pierre Paleo's avatar
Pierre Paleo committed
76
77
78
79
        "ccd_filter_enabled": {
            "default": "0",
            "help": "Whether to enable the CCD hotspots correction.",
            "validator": boolean_validator,
Pierre Paleo's avatar
Pierre Paleo committed
80
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
81
82
83
84
85
        },
        "ccd_filter_threshold": {
            "default": "0.04",
            "help": "If ccd_filter_enabled = 1, a median filter is applied on the 3X3 neighborhood\nof every pixel. If a pixel value exceeds the median value more than this parameter,\nthen the pixel value is replaced with the median value.",
            "validator": float_validator,
Pierre Paleo's avatar
Pierre Paleo committed
86
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
87
        },
88
89
90
91
92
93
94
95
96
97
98
99
        "double_flatfield_enabled": {
            "default": "0",
            "help": "Whether to enable the 'double flat-field' filetering for correcting rings artefacts.",
            "validator": boolean_validator,
            "type": "optional",
        },
        "dff_sigma": {
            "default": "",
            "help": "Enable high-pass filtering on double flatfield with this value of 'sigma'",
            "validator": optional_float_validator,
            "type": "advanced",
        },
Pierre Paleo's avatar
Pierre Paleo committed
100
101
        "take_logarithm": {
            "default": "1",
Pierre Paleo's avatar
Pierre Paleo committed
102
            "help": "Whether to take logarithm after flat-field and phase retrieval.",
103
            "validator": boolean_validator,
Pierre Paleo's avatar
Pierre Paleo committed
104
            "type": "required",
Pierre Paleo's avatar
Pierre Paleo committed
105
        },
106
107
108
109
        "log_min_clip": {
            "default": "1e-6",
            "help": "After division by the FF, and before the logarithm, the is clipped to this minimum. Enabled only if take_logarithm=1",
            "validator": float_validator,
110
            "type": "advanced",
111
112
113
114
115
        },
        "log_max_clip": {
            "default": "10.0",
            "help": "After division by the FF, and before the logarithm, the is clipped to this maximum. Enabled only if take_logarithm=1",
            "validator": float_validator,
116
            "type": "advanced",
117
        },
118
119
120
121
        "sino_normalization": {
            "default": "",
            "help": "Sinogram normalization method. Available methods are: chebyshev, none. Default is none (no normalization)",
            "validator": sino_normalization_validator,
122
            "type": "advanced",
123
        },
Pierre Paleo's avatar
Pierre Paleo committed
124
125
126
127
128
129
        "processes_file": {
            "default": "",
            "help": "Load results from a previous session. This the path to a HDF5 file containing results data along with configuration needed to obtain it.",
            "validator": optional_file_location_validator,
            "type": "advanced",
        },
130
131
132
133
134
135
136
        "sino_rings_correction": {
            "default": "",
            "help": "Sinogram rings removal method. Default (empty) is None. Available are: None, munch. See also: sino_rings_options",
            "validator": sino_deringer_methods,
            "type": "optional",
        },
        "sino_rings_options": {
137
            "default": "sigma=1.0 ; levels=10",
138
139
140
141
            "help": "Options for sinogram rings correction methods. The parameters are separated by commas and passed as 'name=value', for example: sigma=1.0;levels=10. Mind the semicolon separator (;).",
            "validator": cor_options_validator,
            "type": "advanced",
        },
Pierre Paleo's avatar
Pierre Paleo committed
142
143
144
        "rotate_projections": {
            "default": "",
            "help": "Whether to rotate each projection image with a certain angle (in degree). By default (empty) no rotation is done.",
145
            "validator": optional_nonzero_float_validator,
Pierre Paleo's avatar
Pierre Paleo committed
146
147
148
149
150
151
152
153
            "type": "advanced",
        },
        "rotate_projections_center": {
            "default": "",
            "help": "Center of rotation when 'rotate_projections' is non-empty. By default the center of rotation is the middle of each radio, i.e ((Nx-1)/2.0, (Ny-1)/2.0).",
            "validator": optional_tuple_of_floats_validator,
            "type": "advanced",
        },
154
155
        "tilt_correction": {
            "default": "",
156
            "help": "Detector tilt correction. Default (empty) means no tilt correction.\nThe following values can be provided for automatic tilt estimation, in this case, the projection images are rotated by the found tilt value:\n - A scalar value: tilt correction angle in degrees\n - 1d-correlation: auto-detect tilt with the 1D correlation method (fastest, but works best for small tilts)\n - fft-polar: auto-detect tilt with polar FFT method (slower, but works well on all ranges of tilts)",
157
158
159
            "validator": tilt_validator,
            "type": "advanced",
        },
Pierre Paleo's avatar
Pierre Paleo committed
160
161
162
163
164
165
        "autotilt_options": {
            "default": "",
            "help": "Options for methods computing automatically the detector tilt. The parameters are separated by commas and passed as 'name=value', for example: low_pass=1; high_pass=20. Mind the semicolon separator (;).",
            "validator": cor_options_validator,
            "type": "advanced",
        },
166

Pierre Paleo's avatar
Pierre Paleo committed
167
168
169
    },
    "phase": {
        "method": {
170
            "default": "none",
Pierre Paleo's avatar
Pierre Paleo committed
171
172
            "help": "Phase retrieval method. Available are: Paganin, None",
            "validator": phase_method_validator,
Pierre Paleo's avatar
Pierre Paleo committed
173
            "type": "required",
Pierre Paleo's avatar
Pierre Paleo committed
174
        },
Pierre Paleo's avatar
Pierre Paleo committed
175
        "delta_beta": {
Pierre Paleo's avatar
Pierre Paleo committed
176
            "default": "100.0",
Pierre Paleo's avatar
Typos    
Pierre Paleo committed
177
            "help": "Single-distance phase retrieval related parameters\n----------------------------\ndelta/beta ratio for the Paganin/CTR method",
Pierre Paleo's avatar
Pierre Paleo committed
178
            "validator": float_validator,
Pierre Paleo's avatar
Pierre Paleo committed
179
            "type": "required",
Pierre Paleo's avatar
Pierre Paleo committed
180
        },
Nicola Vigano's avatar
Nicola Vigano committed
181
        "margin": {
Pierre Paleo's avatar
Pierre Paleo committed
182
            "default": "50",
183
            "help": "Margin (in pixels) in the Paganin filtering.",
Pierre Paleo's avatar
Pierre Paleo committed
184
            "validator": integer_validator,
185
            "type": "advanced",
Pierre Paleo's avatar
Pierre Paleo committed
186
        },
Pierre Paleo's avatar
Pierre Paleo committed
187
        "unsharp_coeff": {
Pierre Paleo's avatar
Pierre Paleo committed
188
            "default": "0",
Pierre Paleo's avatar
Pierre Paleo committed
189
            "help": "Unsharp mask strength. The unsharped image is equal to\n  UnsharpedImage =  (1 + coeff)*originalPaganinImage - coeff * ConvolvedImage. Setting this coefficient to zero means that no unsharp mask will be applied.",
Pierre Paleo's avatar
Pierre Paleo committed
190
            "validator": float_validator,
Pierre Paleo's avatar
Pierre Paleo committed
191
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
192
        },
Pierre Paleo's avatar
Pierre Paleo committed
193
        "unsharp_sigma": {
Pierre Paleo's avatar
Pierre Paleo committed
194
            "default": "0",
Pierre Paleo's avatar
Pierre Paleo committed
195
            "help": "Standard deviation of the Gaussian filter when applying an unsharp mask\nafter the Paganin filtering. Disabled if set to 0.",
Pierre Paleo's avatar
Pierre Paleo committed
196
            "validator": float_validator,
Pierre Paleo's avatar
Pierre Paleo committed
197
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
198
        },
Pierre Paleo's avatar
Pierre Paleo committed
199
        "padding_type": {
200
            "default": "edge",
201
            "help": "Padding type for the filtering step in Paganin/CTF. Available are: mirror, edge, zeros",
Pierre Paleo's avatar
Pierre Paleo committed
202
            "validator": padding_mode_validator,
Pierre Paleo's avatar
Pierre Paleo committed
203
            "type": "advanced",
Pierre Paleo's avatar
Pierre Paleo committed
204
        },
205
206
207
208
209
210
        "ctf_geometry": {
            "default": "z1_v=None; z1_h=None; detec_pixel_size=None; magnification=True",
            "help": "Geometric parameters for CTF phase retrieval. Length units are in meters.",
            "validator": optional_string_validator,
            "type": "optional",
        },
Pierre Paleo's avatar
Pierre Paleo committed
211
        "ctf_translations_file": {
Pierre Paleo's avatar
Pierre Paleo committed
212
213
214
            "default": "",
            "help": "A file where each line has two values: horizontal and vertical displacements. There should be as many values as there are projection images.",
            "validator": optional_file_location_validator,
215
            "type": "advanced",
Pierre Paleo's avatar
Pierre Paleo committed
216
        },
217
        "ctf_advanced_params": {
218
            "default": "length_scale=1e-5; lim1=1e-5; lim2=0.2; normalize_by_mean=True",
219
220
221
222
            "help": "Advanced parameters for CTF phase retrieval.",
            "validator": optional_string_validator,
            "type": "advanced",
        },
Pierre Paleo's avatar
Pierre Paleo committed
223
224
    },
    "reconstruction": {
Pierre Paleo's avatar
Pierre Paleo committed
225
226
227
228
        "method": {
            "default": "FBP",
            "help": "Reconstruction method. Possible values: FBP, none. If value is 'none', no reconstruction will be done.",
            "validator": reconstruction_method_validator,
Pierre Paleo's avatar
Pierre Paleo committed
229
            "type": "required",
Pierre Paleo's avatar
Pierre Paleo committed
230
        },
Pierre Paleo's avatar
Pierre Paleo committed
231
232
        "angles_file": {
            "default": "",
Pierre Paleo's avatar
Pierre Paleo committed
233
            "help": "In the case you want to override the angles found in the files metadata. The angles are in degree.",
Pierre Paleo's avatar
Pierre Paleo committed
234
            "validator": optional_file_location_validator,
Pierre Paleo's avatar
Pierre Paleo committed
235
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
236
        },
Pierre Paleo's avatar
Pierre Paleo committed
237
238
        "rotation_axis_position": {
            "default": "",
239
            "help": "Rotation axis position. Default (empty) is the middle of the detector width.\nAdditionally, the following methods are available to find automaticall the Center of Rotation (CoR):\n - centered : a fast and simple auto-CoR method. It only works when the CoR is not far from the middle of the detector. It does not work for half-tomography.\n - global : a slow but robust auto-CoR.\n - sliding-window : semi-automatically find the CoR with a sliding window. You have to specify on which side the CoR is (left, center, right). Please see the 'cor_options' parameter.\n - growing-window : automatically find the CoR with a sliding-and-growing window. You can tune the option with the parameter 'cor_options'.\n - sino-coarse-to-fine: Estimate CoR from sinogram. Only works for 360 degrees scans.",
240
            "validator": cor_validator,
241
            "type": "required",
Pierre Paleo's avatar
Pierre Paleo committed
242
        },
243
244
        "cor_options": {
            "default": "",
245
            "help": "Options for methods finding automatically the rotation axis position. The parameters are separated by commas and passed as 'name=value', for example: low_pass=1; high_pass=20. Mind the semicolon separator (;).",
246
247
248
            "validator": cor_options_validator,
            "type": "advanced",
        },
249
250
251
252
253
254
        "cor_slice": {
            "default": "",
            "help": "Which slice to use for estimating the Center of Rotation (CoR). This parameter can be an integer or 'top', 'middle', 'bottom'.\nIf provided, the CoR will be estimated from the correspondig sinogram, and 'cor_options' can contain the parameter 'subsampling'.",
            "validator": cor_slice_validator,
            "type": "advanced",
        },
Pierre Paleo's avatar
Pierre Paleo committed
255
256
        "axis_correction_file": {
            "default": "",
257
            "help": "In the case where the axis position is specified for each angle",
Pierre Paleo's avatar
Pierre Paleo committed
258
            "validator": optional_values_file_validator,
Pierre Paleo's avatar
Pierre Paleo committed
259
            "type": "advanced",
Pierre Paleo's avatar
Pierre Paleo committed
260
        },
Pierre Paleo's avatar
Pierre Paleo committed
261
262
263
        "translation_movements_file": {
            "default": "",
            "help": "A file where each line describes the translation in X and Z of the sample (or detector).",
Pierre Paleo's avatar
Pierre Paleo committed
264
            "validator": optional_values_file_validator,
Pierre Paleo's avatar
Pierre Paleo committed
265
266
            "type": "advanced",
        },
Pierre Paleo's avatar
Pierre Paleo committed
267
268
        "angle_offset": {
            "default": "0",
269
            "help": "Use this if you want to obtain a rotated reconstructed slice. The angle is in degrees.",
Pierre Paleo's avatar
Pierre Paleo committed
270
            "validator": float_validator,
Pierre Paleo's avatar
Pierre Paleo committed
271
            "type": "advanced",
Pierre Paleo's avatar
Pierre Paleo committed
272
273
274
275
276
        },
        "fbp_filter_type": {
            "default": "ramlak",
            "help": "Filter type for FBP method. Available are: ramlak, none",
            "validator": fbp_filter_name_validator,
Pierre Paleo's avatar
Pierre Paleo committed
277
            "type": "advanced",
Pierre Paleo's avatar
Pierre Paleo committed
278
279
280
        },
        "padding_type": {
            "default": "zeros",
Pierre Paleo's avatar
Pierre Paleo committed
281
            "help": "Padding type for FBP. Available are: zeros, edges",
Pierre Paleo's avatar
Pierre Paleo committed
282
            "validator": padding_mode_validator,
Pierre Paleo's avatar
Pierre Paleo committed
283
            "type": "optional", # put "advanced" with default value "edges" ?
Pierre Paleo's avatar
Pierre Paleo committed
284
285
        },
        "enable_halftomo": {
286
287
288
            "default": "auto",
            "help": "Whether to enable half-acquisition. Default is auto. You can enable/disable it manually by setting 1 or 0.",
            "validator": boolean_or_auto_validator,
Pierre Paleo's avatar
Pierre Paleo committed
289
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
290
291
292
        },
        "start_x": {
            "default": "0",
Pierre Paleo's avatar
Pierre Paleo committed
293
            "help": "\nParameters for sub-volume reconstruction. Indices start at 0 !\n----------------------------------------------------------------\n(x, y) are the dimension of a slice, and (z) is the 'vertical' axis\nBy default, all the volume is reconstructed slice by slice, along the axis 'z'.",
Pierre Paleo's avatar
Pierre Paleo committed
294
            "validator": nonnegative_integer_validator,
Pierre Paleo's avatar
Pierre Paleo committed
295
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
296
297
298
299
300
        },
        "end_x": {
            "default": "-1",
            "help": "",
            "validator": integer_validator,
Pierre Paleo's avatar
Pierre Paleo committed
301
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
302
303
304
305
306
        },
        "start_y": {
            "default": "0",
            "help": "",
            "validator": nonnegative_integer_validator,
Pierre Paleo's avatar
Pierre Paleo committed
307
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
308
309
310
311
312
        },
        "end_y": {
            "default": "-1",
            "help": "",
            "validator": integer_validator,
Pierre Paleo's avatar
Pierre Paleo committed
313
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
314
315
316
317
        },
        "start_z": {
            "default": "0",
            "help": "",
318
            "validator": slice_num_validator,
Pierre Paleo's avatar
Pierre Paleo committed
319
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
320
321
322
323
        },
        "end_z": {
            "default": "-1",
            "help": "",
324
            "validator": slice_num_validator,
Pierre Paleo's avatar
Pierre Paleo committed
325
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
326
327
328
329
330
        },
        "iterations": {
            "default": "200",
            "help": "\nParameters for iterative algorithms\n------------------------------------\nNumber of iterations",
            "validator": nonnegative_integer_validator,
Pierre Paleo's avatar
Pierre Paleo committed
331
            "type": "unsupported",
Pierre Paleo's avatar
Pierre Paleo committed
332
333
        },
        "optim_algorithm": {
Pierre Paleo's avatar
Pierre Paleo committed
334
            "default": "chambolle-pock",
Pierre Paleo's avatar
Pierre Paleo committed
335
336
            "help": "Optimization algorithm for iterative methods",
            "validator": optimization_algorithm_name_validator,
Pierre Paleo's avatar
Pierre Paleo committed
337
            "type": "unsupported",
Pierre Paleo's avatar
Pierre Paleo committed
338
339
340
341
342
        },
        "weight_tv": {
            "default": "1.0e-2",
            "help": "Total Variation regularization parameter for iterative methods",
            "validator": float_validator,
Pierre Paleo's avatar
Pierre Paleo committed
343
            "type": "unsupported",
Pierre Paleo's avatar
Pierre Paleo committed
344
345
346
347
348
        },
        "preconditioning_filter": {
            "default": "1",
            "help": "Whether to enable 'filter preconditioning' for iterative methods",
            "validator": boolean_validator,
Pierre Paleo's avatar
Pierre Paleo committed
349
            "type": "unsupported",
Pierre Paleo's avatar
Pierre Paleo committed
350
351
352
353
354
        },
        "positivity_constraint": {
            "default": "1",
            "help": "Whether to enforce a positivity constraint in the reconstruction.",
            "validator": boolean_validator,
Pierre Paleo's avatar
Pierre Paleo committed
355
            "type": "unsupported",
Pierre Paleo's avatar
Pierre Paleo committed
356
357
358
359
        },
    },
    "output": {
        "location": {
Pierre Paleo's avatar
Pierre Paleo committed
360
361
            "default": "",
            "help": "Directory where the output reconstruction is stored.",
362
            "validator": optional_directory_location_validator,
Pierre Paleo's avatar
Pierre Paleo committed
363
            "type": "required",
Pierre Paleo's avatar
Pierre Paleo committed
364
365
        },
        "file_prefix": {
366
            "default": "",
Pierre Paleo's avatar
Pierre Paleo committed
367
            "help": "File prefix. Optional, by default it is inferred from the scanned dataset.",
368
            "validator": optional_file_name_validator,
Pierre Paleo's avatar
Pierre Paleo committed
369
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
370
371
372
        },
        "file_format": {
            "default": "hdf5",
Pierre Paleo's avatar
Pierre Paleo committed
373
            "help": "Output file format. Available are: hdf5, tiff, jp2, edf",
Pierre Paleo's avatar
Pierre Paleo committed
374
            "validator": output_file_format_validator,
Pierre Paleo's avatar
Pierre Paleo committed
375
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
376
        },
377
378
        "overwrite_results": {
            "default": "0",
Pierre Paleo's avatar
Pierre Paleo committed
379
            "help": "What to do in the case where the output file exists.\nBy default, the output data is never overwritten and the process is interrupted if the file already exists.\nSet this option to 1 if you want to overwrite the output files.",
380
381
382
            "validator": boolean_validator,
            "type": "required",
        },
Pierre Paleo's avatar
Pierre Paleo committed
383
    },
384
385
386
387
388
389
390
391
392
393
394
395
396
397
    "postproc": {
        "output_histogram": {
            "default": "0",
            "help": "Whether to compute a histogram of the volume.",
            "validator": boolean_validator,
            "type": "optional",
        },
        "histogram_bins": {
            "default": "1000000",
            "help": "Number of bins for the output histogram. Default is one million. ",
            "validator": nonnegative_integer_validator,
            "type": "advanced",
        },
    },
Pierre Paleo's avatar
Pierre Paleo committed
398
399
    "resources": {
        "method": {
Pierre Paleo's avatar
Pierre Paleo committed
400
            "default": "local",
Pierre Paleo's avatar
Typos    
Pierre Paleo committed
401
            "help": "Computations distribution method. It can be:\n  - local:  run the computations on the local machine\n  - slurm: run the computations through SLURM\n  - preview: reconstruct the slices/volume as quickly as possible, possibly doing some binning.",
Pierre Paleo's avatar
Pierre Paleo committed
402
            "validator": distribution_method_validator,
Pierre Paleo's avatar
Pierre Paleo committed
403
            "type": "required",
Pierre Paleo's avatar
Pierre Paleo committed
404
        },
405
406
407
408
        "gpus": {
            "default": "1",
            "help": "Number of GPUs to use.",
            "validator": nonnegative_integer_validator,
409
            "type": "unsupported",
410
411
412
        },
        "gpu_id": {
            "default": "",
413
            "help": "For method = local only. List of GPU IDs to use. This parameter overwrites 'gpus'.\nIf left blank, exactly one GPU will be used, and the best one will be picked.",
414
            "validator": list_of_int_validator,
415
            "type": "unsupported",
416
        },
417
418
419
420
        "cpu_workers": {
            "default": "0",
            "help": "Number of 'CPU workers' for each GPU worker. It is discouraged to set this number to more than one. A value of -1 means exactly one CPU worker.",
            "validator": integer_validator,
421
            "type": "unsupported",
422
        },
Pierre Paleo's avatar
Pierre Paleo committed
423
        "memory_per_node": {
Pierre Paleo's avatar
Pierre Paleo committed
424
            "default": "90%",
425
            "help": "RAM memory per computing node, either in GB or in percent of the AVAILABLE (!= total) node memory.\nIf several workers share the same node, their combined memory usage will not exceed this number.",
Pierre Paleo's avatar
Pierre Paleo committed
426
            "validator": resources_validator,
427
            "type": "unsupported",
Pierre Paleo's avatar
Pierre Paleo committed
428
        },
429
        "threads_per_node": {
Pierre Paleo's avatar
Pierre Paleo committed
430
            "default": "100%",
431
            "help": "Number of threads to allocate on each node, either a number or a percentage of the available threads",
Pierre Paleo's avatar
Pierre Paleo committed
432
            "validator": resources_validator,
433
            "type": "unsupported",
Pierre Paleo's avatar
Pierre Paleo committed
434
        },
435
436
437
438
        "queue": {
            "default": "gpu",
            "help": "\nParameters exclusive to the 'slurm' distribution method\n------------------------------------------------------\nName of the SLURM partition ('queue'). Full list is obtained with 'scontrol show partition'",
            "validator": nonempty_string_validator,
439
            "type": "unsupported",
440
        },
Pierre Paleo's avatar
Pierre Paleo committed
441
442
        "walltime": {
            "default": "01:00:00",
443
            "help": "Time limit for the SLURM resource allocation, in the format Hours:Minutes:Seconds",
Pierre Paleo's avatar
Pierre Paleo committed
444
            "validator": walltime_validator,
445
            "type": "unsupported",
Pierre Paleo's avatar
Pierre Paleo committed
446
447
        },
    },
448
449
450
    "pipeline": {
        "save_steps": {
            "default": "",
451
            "help": "Save intermediate results. This is a list of comma-separated processing steps, for ex: flatfield, phase, sinogram.\nEach step generates a HDF5 file in the form name_file_prefix.hdf5 (ex. 'sinogram_file_prefix.hdf5')",
452
453
454
            "validator": optional_string_validator,
            "type": "optional",
        },
455
        "resume_from_step": {
456
            "default": "",
457
            "help": "Resume the processing from a previously saved processing step. The corresponding file must exist in the output directory.",
458
459
460
            "validator": optional_string_validator,
            "type": "optional",
        },
461
462
463
464
465
466
        "steps_file": {
            "default": "",
            "help": "File where the intermediate processing steps are written. By default it is empty, and intermediate processing steps are written in the same directory as the reconstructions, with a file prefix, ex. sinogram_mydataset.hdf5.",
            "validator": optional_output_file_path_validator,
            "type": "advanced",
        },
Pierre Paleo's avatar
Pierre Paleo committed
467
        "verbosity": {
468
            "default": "2",
Pierre Paleo's avatar
Pierre Paleo committed
469
            "help": "Level of verbosity of the processing. 0 = terse, 3 = much information.",
Pierre Paleo's avatar
Pierre Paleo committed
470
            "validator": logging_validator,
Pierre Paleo's avatar
Pierre Paleo committed
471
            "type": "optional",
Pierre Paleo's avatar
Pierre Paleo committed
472
473
        },
    },
474
475
    # This section will be removed in the future (for now it is deprecated)
    "about": {}
Pierre Paleo's avatar
Pierre Paleo committed
476
}
477
478
479

renamed_keys = {
    "marge": {
Pierre Paleo's avatar
Pierre Paleo committed
480
        "section": "phase",
481
482
        "new_name": "margin",
        "since": "2020.2.0",
483
484
        "message": "Option 'marge' has been renamed to 'margin' in [phase]",
    },
485
486
487
488
489
490
    "overwrite_results": {
        "section": "about",
        "new_name": "overwrite_results",
        "new_section": "output",
        "since": "2020.3.0",
        "message": "Option 'overwrite_results' was moved from section [about] to section [output]",
Pierre Paleo's avatar
Pierre Paleo committed
491
492
493
494
495
496
497
498
    },
    "nabu_config_version": {
        "section": "about",
        "new_name": "",
        "new_section": "about",
        "since": "2020.3.1",
        "message": "Option 'nabu_config_version' was removed.",
    },
499
500
501
502
503
504
505
506
507
508
509
510
511
512
    "nabu_version": {
        "section": "about",
        "new_name": "",
        "new_section": "about",
        "since": "2021.1.0",
        "message": "Option 'nabu_config' was removed.",
    },
    "verbosity": {
        "section": "about",
        "new_name": "verbosity",
        "new_section": "pipeline",
        "since": "2021.1.0",
        "message": "Option 'verbosity' was moved from section [about] to section [pipeline]",
    },
513
}