File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -88,9 +88,14 @@ def process_extra_commands(outdir, args):
88
88
def main (argv = None ):
89
89
parser = get_parser ()
90
90
args = parser .parse_args (argv )
91
+ # To be done asap so anything random is deterministic
92
+ if args .random_seed is not None :
93
+ import random
94
+ random .seed (args .random_seed )
95
+ import numpy
96
+ numpy .random .seed (args .random_seed )
91
97
if args .debug :
92
98
lgr .setLevel (logging .DEBUG )
93
-
94
99
if args .files and args .subjs :
95
100
raise ValueError ("Unable to processes `--subjects` with files" )
96
101
@@ -173,7 +178,8 @@ def get_parser():
173
178
parser .add_argument ('--minmeta' , action = 'store_true' ,
174
179
help = 'Exclude dcmstack meta information in sidecar '
175
180
'jsons' )
176
-
181
+ parser .add_argument ('--random-seed' , type = int , default = None ,
182
+ help = 'Random seed to initialize RNG' )
177
183
submission = parser .add_argument_group ('Conversion submission options' )
178
184
submission .add_argument ('-q' , '--queue' , default = None ,
179
185
help = 'select batch system to submit jobs to instead'
You can’t perform that action at this time.
0 commit comments