Skip to content

Commit

Permalink
NF - added add_json_args to the arguments, format the output json
Browse files Browse the repository at this point in the history
  • Loading branch information
gabknight committed Dec 3, 2024
1 parent 1f7e21f commit 56a6bae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/scil_volume_stats_in_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import numpy as np

from scilpy.image.labels import get_data_as_labels, get_stats_in_label
from scilpy.io.utils import (add_overwrite_arg, add_verbose_arg,
from scilpy.io.utils import (add_json_args, add_overwrite_arg, add_verbose_arg,
assert_inputs_exist, assert_headers_compatible)
from scilpy.utils.filenames import split_name_with_nii

Expand All @@ -43,7 +43,7 @@ def _build_arg_parser():
metavar='file',
help='Metrics nifti filename. List of the names of the '
'metrics file, \nin nifti format.')

add_json_args(p)
add_verbose_arg(p)
add_overwrite_arg(p)

Expand Down Expand Up @@ -90,7 +90,7 @@ def main():

if len(args.metrics_file_list) == 1:
json_stats = json_stats[metric_name]
print(json.dumps(json_stats))
print(json.dumps(json_stats, indent=args.indent, sort_keys=args.sort_keys))


if __name__ == "__main__":
Expand Down

0 comments on commit 56a6bae

Please sign in to comment.