Skip to content

Commit 82b7bef

Browse files
committed
Put json back in
1 parent 68f6491 commit 82b7bef

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

scripts/scil_fibertube_score_tractogram.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def _build_arg_parser():
105105
help='If set, all random values will be generated \n'
106106
'using the specified seed. [%(default)s]')
107107

108+
add_json_args(p)
108109
add_verbose_arg(p)
109110
add_overwrite_arg(p)
110111

@@ -202,7 +203,8 @@ def main():
202203
'mae_med': np.median(mean_errors),
203204
}
204205
with open(args.out_metrics, 'w') as outfile:
205-
json.dump(metrics, outfile)
206+
json.dump(metrics, outfile,
207+
indent=args.indent, sort_keys=args.sort_keys)
206208

207209
if args.save_error_tractogram:
208210
sft = StatefulTractogram.from_sft(error_tractogram, truth_sft)

scripts/scil_fibertube_tracking.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def _build_arg_parser():
156156
'be saved at the specified location (must be .txt). If not given, \n'
157157
'the config will be printed in the console.')
158158

159+
add_json_args(out_g)
159160
add_overwrite_arg(out_g)
160161
add_processes_arg(p)
161162
add_verbose_arg(p)
@@ -274,10 +275,12 @@ def main():
274275
}
275276
if args.out_config:
276277
with open(args.out_config, 'w') as outfile:
277-
json.dump(config, outfile)
278+
json.dump(config, outfile,
279+
indent=args.indent, sort_keys=args.sort_keys)
278280
else:
279281
print('Config:\n',
280-
json.dumps(config))
282+
json.dumps(config, indent=args.indent,
283+
sort_keys=args.sort_keys))
281284

282285

283286
if __name__ == "__main__":

scripts/scil_tractogram_filter_collisions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def _build_arg_parser():
137137
help='If set, all random values will be generated \n'
138138
'using the specified seed. [%(default)s]')
139139

140+
add_json_args(p)
140141
add_overwrite_arg(p)
141142
add_verbose_arg(p)
142143

@@ -244,7 +245,8 @@ def main():
244245
}
245246

246247
with open(args.out_metrics, 'w') as outfile:
247-
json.dump(metrics, outfile)
248+
json.dump(metrics, outfile,
249+
indent=args.indent, sort_keys=args.sort_keys)
248250

249251
if args.out_max_voxel_rotation is not None:
250252
max_voxel_rotated_transform = np.r_[np.c_[

0 commit comments

Comments
 (0)