From 3ed83e5f9196ea1d83f6f7f5fdbb8c6f054acf59 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 5 Aug 2024 18:30:59 +0200 Subject: [PATCH] improve help for missing subject /task (#220) --- bidsmreye/bids_utils.py | 4 ++++ docs/questions/missing_data.question.md | 19 +++++++++++++++++++ docs/source/FAQ.md | 21 +++++++++++++++++++-- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 docs/questions/missing_data.question.md diff --git a/bidsmreye/bids_utils.py b/bidsmreye/bids_utils.py index cc1dfab..4e10bf3 100644 --- a/bidsmreye/bids_utils.py +++ b/bidsmreye/bids_utils.py @@ -73,9 +73,13 @@ def check_layout(cfg: Config, layout: BIDSLayout, for_file: str = "bold") -> Non ) if bf == []: + subjects = layout.get(return_type="id", target="subject", suffix="bold") + tasks = layout.get(return_type="id", target="task", suffix="bold") raise RuntimeError( f"Input dataset {layout.root} does not have " f"any data to process for filter\n{this_filter}.\n" + f"This dataset contains subjects: {subjects}." + f"This dataset contains tasks: {tasks}." "Is your dataset a BIDS derivative dataset?\n" "Check the FAQ for more information: " "https://bidsmreye.readthedocs.io/en/latest/FAQ.html" diff --git a/docs/questions/missing_data.question.md b/docs/questions/missing_data.question.md new file mode 100644 index 0000000..858adee --- /dev/null +++ b/docs/questions/missing_data.question.md @@ -0,0 +1,19 @@ +--- +title: "bidsmreye can not find subject / task" +alt_titles: + - bidsmreye process only one task in the bids_dir + - No Subject Found in Layout +--- + +Check the following things: + +- Have you passed the correct path to your BIDS dataset? + + This is one the most common errors, + that can very easily happen when working with a containerized version of bidsmreye + +- Is your dataset a valid preprocessed fMRI BIDS dataset? + + See [How I should structure my input data?](./faq.md#how-i-should-structure-my-input-data) + +- Try to rerun your command with the `--reset-database` option for force bidsmreye to reindex your input dataset. diff --git a/docs/source/FAQ.md b/docs/source/FAQ.md index 4e44549..d0c7303 100644 --- a/docs/source/FAQ.md +++ b/docs/source/FAQ.md @@ -1,9 +1,26 @@ # Frequently Asked Questions +- [bidsmreye can not find subject / task](#bidsmreye-can-not-find-subject--task) - [How I should structure my input data?](#how-i-should-structure-my-input-data) -- [Is the "prepare" only suitable for the datasets that have eye-tracking info?](#is-the-"prepare"-only-suitable-for-the-datasets-that-have-eye-tracking-info) +- [Is the "prepare" only suitable for the datasets that have eye-tracking info?](#is-the-prepare-only-suitable-for-the-datasets-that-have-eye-tracking-info) - [Should I use the automatically generated methods section?](#should-i-use-the-automatically-generated-methods-section) + +## bidsmreye can not find subject / task + +Check the following things: + +- Have you passed the correct path to your BIDS dataset? + + This is one the most common errors, + that can very easily happen when working with a containerized version of bidsmreye + +- Is your dataset a valid preprocessed fMRI BIDS dataset? + + See [How I should structure my input data?](./faq.md#how-i-should-structure-my-input-data) + +- Try to rerun your command with the `--reset-database` option for force bidsmreye to reindex your input dataset. + ## How I should structure my input data? @@ -49,7 +66,7 @@ that the input dataset is a derivative dataset: } ``` - + ## Is the "prepare" only suitable for the datasets that have eye-tracking info? No the `prepare` action is necessary for all datasets,