diff --git a/.gitignore b/.gitignore index e0d5ec9..b862b72 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +node_modules +package-lock.json +package.json + # folders outputs download diff --git a/bidsmreye/bids_utils.py b/bidsmreye/bids_utils.py index 0fb158b..0671516 100644 --- a/bidsmreye/bids_utils.py +++ b/bidsmreye/bids_utils.py @@ -41,7 +41,11 @@ def check_layout(cfg: Config, layout: BIDSLayout, for_file: str = "bold") -> Non or "DatasetType" in desc and desc["DatasetType"] != "derivative" ): - raise RuntimeError("DatasetType must be 'derivative' in dataset_description.json") + raise RuntimeError( + "DatasetType must be 'derivative' in dataset_description.json\n." + "Check the FAQ for more information: " + "https://bidsmreye.readthedocs.io/en/latest/FAQ.html" + ) this_filter = get_bids_filter_config()[for_file] @@ -71,7 +75,10 @@ def check_layout(cfg: Config, layout: BIDSLayout, for_file: str = "bold") -> Non if bf == []: raise RuntimeError( f"Input dataset {layout.root} does not have " - "any data to process for filter\n{this_filter}" + f"any data to process for filter\n{this_filter}.\n" + "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/bidsmreye/configuration.py b/bidsmreye/configuration.py index bc4dead..1dee9d0 100644 --- a/bidsmreye/configuration.py +++ b/bidsmreye/configuration.py @@ -87,8 +87,17 @@ def __attrs_post_init__(self) -> None: database_path=database_path, reset_database=self.reset_database, ) - - log.debug(f"Layout in:\n{layout_in}") + log.debug(f"Layout in:\n{layout_in.root}") + + value = layout_in.get(return_type="id", target="subject", datatype="func") + if not value: + raise RuntimeError( + f"Input dataset {layout_in.root} does not have " + f"any data to process.\n" + "Is your dataset a BIDS derivative dataset?\n" + "Check the FAQ for more information: " + "https://bidsmreye.readthedocs.io/en/latest/FAQ.html" + ) if not database_path.is_dir(): layout_in.save(database_path) diff --git a/bidsmreye/quality_control.py b/bidsmreye/quality_control.py index 1e810da..de0d7af 100644 --- a/bidsmreye/quality_control.py +++ b/bidsmreye/quality_control.py @@ -232,17 +232,11 @@ def compute_robust_outliers( points (assuming we don't want to 'remove' too many). References: - - `Rousseeuw, P. J., and Croux, C. (1993). Alternatives to the the median - absolute deviation. J. Am. Stat. Assoc. 88, 1273-1263. - `_ + - :cite:t:`rousseeuw_alternatives_1993` + - :cite:t:`carling_resistant_2000` + - :cite:t:`hoaglin_performance_1986` - - `Carling, K. (2000). Resistant outlier rules and the non-Gaussian case. - Stat. Data Anal. 33, 249:258. - `_ - - `Hoaglin, D.C., Iglewicz, B. (1987) Fine-tuning some resistant rules for - outlier labelling. J. Amer. Statist. Assoc., 82 , 1147:1149 - `_ """ if outlier_type is None: outlier_type = "S-outliers" diff --git a/bidsmreye/templates/CITATION.bib b/bidsmreye/templates/CITATION.bib index c5083d0..d461277 100644 --- a/bidsmreye/templates/CITATION.bib +++ b/bidsmreye/templates/CITATION.bib @@ -17,6 +17,7 @@ @article{deepmreye } + @article{alexander_open_2017, title = {An open resource for transdiagnostic research in pediatric mental health and learning disorders}, volume = {4}, @@ -119,3 +120,36 @@ @article{carling_resistant_2000 pages = {249--258}, file = {Submitted Version:/home/remi/Zotero/storage/VHQYXF6K/Carling - 2000 - Resistant outlier rules and the non-Gaussian case.pdf:application/pdf}, } + +@article{hoaglin_performance_1986, + title = {Performance of {Some} {Resistant} {Rules} for {Outlier} {Labeling}}, + volume = {81}, + issn = {0162-1459, 1537-274X}, + url = {http://www.tandfonline.com/doi/abs/10.1080/01621459.1986.10478363}, + doi = {10.1080/01621459.1986.10478363}, + language = {en}, + number = {396}, + urldate = {2023-05-24}, + journal = {Journal of the American Statistical Association}, + author = {Hoaglin, David C. and Iglewicz, Boris and Tukey, John W.}, + month = dec, + year = {1986}, + pages = {991--999}, +} + + +@article{rousseeuw_alternatives_1993, + title = {Alternatives to the {Median} {Absolute} {Deviation}}, + volume = {88}, + issn = {0162-1459, 1537-274X}, + url = {http://www.tandfonline.com/doi/abs/10.1080/01621459.1993.10476408}, + doi = {10.1080/01621459.1993.10476408}, + language = {en}, + number = {424}, + urldate = {2023-05-24}, + journal = {Journal of the American Statistical Association}, + author = {Rousseeuw, Peter J. and Croux, Christophe}, + month = dec, + year = {1993}, + pages = {1273--1283}, +} diff --git a/docs/questions/validation.question.md b/docs/questions/validation.question.md index 7c7e9c3..d96a6ec 100644 --- a/docs/questions/validation.question.md +++ b/docs/questions/validation.question.md @@ -5,12 +5,44 @@ alt_titles: - "What input format does bidsmreye expect?" --- -bidsmreye requires your input fmri data: - - - to be minimally preprocessed - - with filenames and structure that conforms to a BIDS derivative dataset. +bidsmreye requires a BIDS **preprocessed** dataset as input. Two bids apps are available to generate those types of preprocessed data: - [fmriprep](https://fmriprep.org/en/stable/) - [bidspm](https://bidspm.readthedocs.io/en/latest/general_information.html) + +bidsmreye requires your input fmri data: + + - to be minimally preprocessed + - with [filenames and structure that conforms to a BIDS derivative dataset](https://bids-specification.readthedocs.io/en/latest/derivatives/imaging.html#preprocessed-coregistered-andor-resampled-volumes). + +More specifically the dataset should look like this: + +``` +dataset_description.json +sub-{sub} + [ses-{session}] + func (func_dir) + sub-{sub}[_ses-{session}]_task-{task}[_acq-{acq}][_ce-{ce}][_dir-{dir}][_rec-{rec}][_run-{run_index}]_space-{space}[_res-{res}]_desc-preproc_bold.nii[.gz] +[participants.tsv] +[README] +[CHANGES] +[LICENSE] +``` + +- Filename entities, files or directories between square brackets + (for example, `[_ses-