From 8b9ad339870ff6d7b49bfc6987e408e50a8f5f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Cl=C3=A9net?= Date: Fri, 4 Oct 2024 16:04:47 +0200 Subject: [PATCH] Adding documentation for the visualizer --- README.md | 33 ++++++++++++++++++++++++++++++++- bids_prov/visualize.py | 4 ++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bbae4081d..342d0e99b 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ Camille Maumet ([@cmaumet](https://github.com/cmaumet)) and Satrajit Ghosh ([@sa - Cyril Regan ([@cyril-data](https://github.com/cyril-data))πŸ’»πŸ‘€πŸ“– πŸ› +- Boris ClΓ©net ([@bclenet](https://github.com/bclenet))πŸ’»πŸ“–πŸ› + This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! @@ -80,7 +82,36 @@ Mature building blocks of NIDM: [New features (to be included)](new_features.md) -## Run parsers on the SPM, FSL and AFNI data +## Using the code + +### Visualize your BIDSprov data + +To visualize your BIDSprov data, perform the following steps : +1. [clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) the code inside a `BEP028_BIDSprov` directory ; +2. in a terminal, change the current directory + +`cd BEP028_BIDSprov` + +3. install the `bids_prov` python package : + +`pip install .` + +4. you should be able to launch the visualizer on your .jsonld files with the command `bids_prov_visualizer` + +`bids_prov_visualizer --input_file graph.jsonld --output_file graph` + +``` +usage: bids_prov_visualizer [-h] --input_file INPUT_FILE [--output_file OUTPUT_FILE] + +options: + -h, --help show this help message and exit + --input_file INPUT_FILE + input BIDSprov data as a .jsonld file + --output_file OUTPUT_FILE + output .png file showing BIDSprov graph +``` + +### Run parsers on the SPM, FSL and AFNI data To obtain data in **bids-prov format**, you can use the developed parsers. * [Tutorial](https://github.com/bids-standard/BEP028_BIDSprov/blob/master/bids_prov/README.md) diff --git a/bids_prov/visualize.py b/bids_prov/visualize.py index ad7408265..5f8bd900d 100644 --- a/bids_prov/visualize.py +++ b/bids_prov/visualize.py @@ -114,8 +114,8 @@ def main(filename: str, output_file=None, omit_details=True) -> None: def entry_point(): """ A command line tool for the visualize module """ parser = argparse.ArgumentParser() - parser.add_argument("--input_file", type=str, default="res.jsonld", help="data jsonld file ") - parser.add_argument("--output_file", type=str, default="res.png", help="output dir where results are written") + parser.add_argument("--input_file", type=str, help="input BIDSprov data as a .jsonld file ", required=True) + parser.add_argument("--output_file", type=str, default="output_graph.png", help="output .png file showing BIDSprov graph") opt = parser.parse_args() main(opt.input_file, output_file=opt.output_file, omit_details=True)