Skip to content

Commit

Permalink
[FIX][DOC] Modify the name of variables in the client and documentati…
Browse files Browse the repository at this point in the history
…on to fit actual possibilities for `create-subjects-visits` (aramis-lab#1437)
  • Loading branch information
AliceJoubert authored Feb 21, 2025
1 parent 40b72ab commit 4b7773f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 5 additions & 9 deletions clinica/iotools/utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
"bids_directory", type=click.Path(exists=True, resolve_path=True)
)

current_directory = click.argument(
"current_directory", type=click.Path(exists=True, resolve_path=True)
)


@click.group("iotools")
def cli() -> None:
Expand Down Expand Up @@ -124,22 +120,22 @@ def check_missing_processing(


@cli.command()
@current_directory
@click.argument("input_directory", type=click.Path(exists=True, resolve_path=True))
@click.argument("output_tsv", type=click.Path(resolve_path=True))
def create_subjects_visits(current_directory: str, output_tsv: str) -> None:
"""Export participants with their sessions."""
def create_subjects_visits(input_directory: str, output_tsv: str) -> None:
"""Export participants with their sessions from a BIDS or a CAPS directory"""
from os import makedirs
from os.path import basename, dirname

from clinica.iotools.utils.data_handling import create_subs_sess_list
from clinica.utils.inputs import determine_caps_or_bids
from clinica.utils.stream import cprint

is_bids = determine_caps_or_bids(current_directory)
is_bids = determine_caps_or_bids(input_directory)
output_directory = dirname(output_tsv)
makedirs(output_directory, exist_ok=True)
create_subs_sess_list(
current_directory, output_directory, basename(output_tsv), is_bids_dir=is_bids
input_directory, output_directory, basename(output_tsv), is_bids_dir=is_bids
)
cprint(f"The TSV file was saved to {output_tsv}.")

Expand Down
4 changes: 2 additions & 2 deletions docs/IOTools/create_subjects_visits.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
A TSV file with two columns (`participant_id` and `session_id`) containing the list of visits for each subject can be created as follows:

```shell
clinica iotools create-subjects-visits BIDS_DIRECTORY OUTPUT_TSV
clinica iotools create-subjects-visits INPUT_DIRECTORY OUTPUT_TSV
```

where:

- `BIDS_DIRECTORY`: input folder of a BIDS compliant dataset,
- `INPUT_DIRECTORY`: input folder, which can be a BIDS compliant dataset or a CAPS ;
- `OUTPUT_TSV`: output TSV file containing the subjects with their sessions.

Here is an example of the file generated by this tool:
Expand Down

0 comments on commit 4b7773f

Please sign in to comment.