Repository: cpp-lln-lab/bidsMReye (language: python)

Issue:
update boutiques description



Discussion / hints:

Fix patch:
diff --git a/Makefile b/Makefile
index 3d6b542..01140b9 100644
--- a/Makefile
+++ b/Makefile
@@ -139,6 +139,9 @@ generalize: ## demo: predicts labels of MOAE dataset
 				--model 1_guided_fixations \
 				-vv
 
+# run demo via boutiques
+demo_boutiques: tests/data/moae_fmriprep
+	bosh exec launch --no-container boutiques/bidsmreye_0.4.0.json boutiques/invocation.json
 
 ## ds002799
 .PHONY: get_ds002799_dat
diff --git a/README.md b/README.md
index 4cd0cd6..aa01f23 100644
--- a/README.md
+++ b/README.md
@@ -100,19 +100,6 @@ Note that you might need to install cudnn first
 conda install -c conda-forge cudnn
 ```
 
-#### ANTsPy installation issues
-
-If installation of [ANTsPy](https://github.com/ANTsX/ANTsPy) fails try to manually install it via:
-
-<!-- may help on windows ? -->
-
-```bash
-git clone https://github.com/ANTsX/ANTsPy
-cd ANTsPy
-pip install CMake
-python3 setup.py install
-```
-
 ### Dev install
 
 Clone this repository.
diff --git a/boutiques/README.md b/boutiques/README.md
index e0d0ce4..0a5e1d7 100644
--- a/boutiques/README.md
+++ b/boutiques/README.md
@@ -7,6 +7,4 @@ BIDS app and an example of invocation.
 ## How to use
 
 * Install Boutiques: `pip install boutiques`
-* Run the example: `bosh ./bids-app-example.json -i ./invocation.json -e -d`
-  (assumes `ds001` is a valid dataset in the current working
-  directory.)
+* Run the example: `bosh boutiques/bidsmreye_0.4.0.json -i boutiques/invocation.json -e -d`
diff --git a/boutiques/bidsmreye.json b/boutiques/bidsmreye.json
deleted file mode 100644
index eafb91d..0000000
--- a/boutiques/bidsmreye.json
+++ /dev/null
@@ -1,104 +0,0 @@
-{
-    "name": "bidsmreye",
-    "command-line": "run.py [InputDataset] [OutputLocation] [AnalysisLevel] [ParticipantLabel] [Action]",
-    "container-image": {
-        "image": "bids/example",
-        "type": "docker"
-    },
-    "description": "See https://github.com/Remi-Gau/bidsNighres.git",
-    "inputs": [
-        {
-            "description": "The directory with the input dataset formatted according to the BIDS standard.",
-            "id": "InputDataset",
-            "name": "Input datasets",
-            "value-key": "[InputDataset]",
-            "type": "File",
-            "list": false,
-            "optional": false,
-            "command-line-flag": "--input-datasets"
-        },
-        {
-            "description": "The directory where the output files should be stored. If you are running a group level analysis, this folder should be prepopulated with the results of the participant level analysis.",
-            "id": "OutputLocation",
-            "name": "Output location",
-            "value-key": "[OutputLocation]",
-            "type": "File",
-            "list": false,
-            "optional": false,
-            "command-line-flag": "--output-location"
-        },
-        {
-            "description": "Level of the analysis that will be performed. Multiple participant level analyses can be run independently (in parallel).",
-            "id": "AnalysisLevel",
-            "name": "Analysis level",
-            "value-key": "[AnalysisLevel]",
-            "type": "String",
-            "optional": false,
-            "list": false,
-            "value-choices": [
-                "subject",
-                "dataset"
-            ],
-            "default": "subject",
-            "command-line-flag": "--analysis-level"
-        },
-        {
-            "description": "The label(s) of the participant(s) that should be analyzed. The label corresponds to sub-<participant_label> from the BIDS spec (so it does not include \"sub-\"). If this parameter is not provided all subjects will be analyzed. Multiple participants can be specified with a space separated list.",
-            "id": "SubjectLabel",
-            "name": "Subject labels",
-            "value-key": "[SubjectLabel]",
-            "type": "String",
-            "list": true,
-            "optional": false,
-            "command-line-flag": "--participant-label"
-        },
-        {
-            "description": "Action to perform",
-            "id": "Action",
-            "name": "Action",
-            "value-key": "[Action]",
-            "type": "String",
-            "list": false,
-            "value-choices": [
-                "prepare",
-                "generalize",
-                "all"
-            ],
-            "optional": false,
-            "command-line-flag": "--action"
-        },
-        {
-            "description": " Path to a JSON file to filter input file",
-            "id": "BidsFileFilter",
-            "name": "Bids file filter",
-            "value-key": "[BidsFileFilter]",
-            "type": "File",
-            "default": "",
-            "list": false,
-            "optional": true,
-            "command-line-flag": "--action"
-        },
-        {
-            "description": "for debugging",
-            "id": "DryRun",
-            "name": "Dry run",
-            "value-key": "[DryRun]",
-            "type": "File",
-            "default": false,
-            "list": false,
-            "optional": true,
-            "command-line-flag": "--action"
-        }
-    ],
-    "output-files": [
-        {
-            "description": "The directory where the output files should be stored. If you are running a group level analysis, this folder should be prepopulated with the results of the participant level analysis.",
-            "id": "OutputLocation",
-            "name": "Output location",
-            "optional": false,
-            "path-template": "OutputLocation"
-        }
-    ],
-    "schema-version": "0.5",
-    "tool-version": "dev"
-}
diff --git a/boutiques/bidsmreye_0.4.0.json b/boutiques/bidsmreye_0.4.0.json
new file mode 100644
index 0000000..7824419
--- /dev/null
+++ b/boutiques/bidsmreye_0.4.0.json
@@ -0,0 +1,233 @@
+{
+    "name": "bidsmreye",
+    "description": "bids app using deepMReye to decode eye motion for fMRI time series data",
+    "tool-version": "0.4.0",
+    "schema-version": "0.5",
+    "command-line": "bidsmreye [VERSION] [BIDS_DIR] [OUTPUT_DIR] [ANALYSIS_LEVEL] [COMMAND] [PARTICIPANT_LABEL] [TASK] [RUN] [SPACE] [LOG_LEVEL] [DEBUG] [RESET_DATABASE] [BIDS_FILTER_FILE] [FORCE] [NON_LINEAR_COREG] [MODEL]",
+    "inputs": [
+        {
+            "name": "version",
+            "id": "version",
+            "description": "show program's version number and exit",
+            "type": "String",
+            "optional": true,
+            "command-line-flag": "--version",
+            "value-key": "[VERSION]"
+        },
+        {
+            "name": "bids_dir",
+            "id": "bids_dir",
+            "description": "Fullpath to the directory with the input dataset formatted according to the BIDS standard. The dataset should contain 'minimally processed' (meaning at least 'realigned'). The output of fMRIprep or bidspm should be acceptable inputs. For \"qc\", this lust be the fullpath to the directory with the output generated by bidsmreye that should be quality controlled.",
+            "type": "String",
+            "list": true,
+            "optional": false,
+            "value-key": "[BIDS_DIR]"
+        },
+        {
+            "name": "output_dir",
+            "id": "output_dir",
+            "description": "Fullpath to the directory where the output files will be stored.",
+            "type": "String",
+            "list": true,
+            "optional": false,
+            "value-key": "[OUTPUT_DIR]"
+        },
+        {
+            "name": "analysis_level",
+            "id": "analysis_level",
+            "description": "Level of the analysis that will be performed.Multiple participant level analyses can be run independently(in parallel) using the same ``output_dir``.",
+            "type": "String",
+            "list": true,
+            "optional": false,
+            "default-value": "participant",
+            "value-key": "[ANALYSIS_LEVEL]",
+            "value-choices": [
+                "participant",
+                "group"
+            ]
+        },
+        {
+            "name": "participant_label",
+            "id": "participant_label",
+            "description": "The label(s) of the participant(s) that should be analyzed. The label corresponds to sub-<participant_label> from the BIDS spec (so it does not include \"sub-\"). If this parameter is not provided, all subjects will be analyzed. Multiple participants can be specified with a space separated list.",
+            "type": "String",
+            "list": true,
+            "optional": true,
+            "command-line-flag": "--participant_label",
+            "value-key": "[PARTICIPANT_LABEL]"
+        },
+        {
+            "name": "task",
+            "id": "task",
+            "description": "The label of the task that will be analyzed. The label corresponds to task-<task_label> from the BIDS spec so it does not include \"task-\").",
+            "type": "String",
+            "list": true,
+            "optional": true,
+            "command-line-flag": "--task",
+            "value-key": "[TASK]"
+        },
+        {
+            "name": "run",
+            "id": "run",
+            "description": "The label of the run that will be analyzed. The label corresponds to run-<task_label> from the BIDS spec so it does not include \"run-\").",
+            "type": "String",
+            "list": true,
+            "optional": true,
+            "command-line-flag": "--run",
+            "value-key": "[RUN]"
+        },
+        {
+            "name": "space",
+            "id": "space",
+            "description": "The label of the space that will be analyzed. The label corresponds to space-<space_label> from the BIDS spec (so it does not include \"space-\").",
+            "type": "String",
+            "list": true,
+            "optional": true,
+            "command-line-flag": "--space",
+            "value-key": "[SPACE]"
+        },
+        {
+            "name": "log_level",
+            "id": "log_level",
+            "description": "Log level",
+            "type": "String",
+            "optional": true,
+            "command-line-flag": "-v",
+            "value-key": "[LOG_LEVEL]"
+        },
+        {
+            "name": "debug",
+            "id": "debug",
+            "description": "Switch to debug mode",
+            "type": "Flag",
+            "optional": true,
+            "command-line-flag": "--debug",
+            "value-key": "[DEBUG]"
+        },
+        {
+            "name": "reset_database",
+            "id": "reset_database",
+            "description": "Resets the database of the input dataset.",
+            "type": "Flag",
+            "optional": true,
+            "command-line-flag": "--reset_database",
+            "value-key": "[RESET_DATABASE]"
+        },
+        {
+            "name": "bids_filter_file",
+            "id": "bids_filter_file",
+            "description": "A JSON file describing custom BIDS input filters using PyBIDS. For further details, please check out TBD.",
+            "type": "String",
+            "optional": true,
+            "command-line-flag": "--bids_filter_file",
+            "value-key": "[BIDS_FILTER_FILE]"
+        },
+        {
+            "name": "force",
+            "id": "force",
+            "description": "Overwrite previous output.",
+            "type": "Flag",
+            "optional": true,
+            "command-line-flag": "--force",
+            "value-key": "[FORCE]"
+        },
+        {
+            "name": "non_linear_coreg",
+            "id": "non_linear_coreg",
+            "description": "Uses a more aggressive (and non-linear) alignment procedure to the deepmreye template.",
+            "type": "Flag",
+            "optional": true,
+            "command-line-flag": "--non_linear_coreg",
+            "value-key": "[NON_LINEAR_COREG]"
+        },
+        {
+            "name": "model",
+            "id": "model",
+            "description": "Model to use. Default model: 1to6.",
+            "type": "String",
+            "optional": true,
+            "default-value": "1to6",
+            "command-line-flag": "--model",
+            "value-key": "[MODEL]",
+            "value-choices": [
+                "1_guided_fixations",
+                "2_pursuit",
+                "3_openclosed",
+                "3_pursuit",
+                "4_pursuit",
+                "5_free_viewing",
+                "1to5",
+                "1to6"
+            ]
+        },
+        {
+            "name": "command",
+            "id": "command",
+            "description": "Choose a subcommand",
+            "type": "String",
+            "optional": false,
+            "value-key": "[COMMAND]",
+            "value-choices": [
+                "prepare",
+                "generalize",
+                "all",
+                "qc"
+            ],
+            "value-requires": {
+                "prepare": [],
+                "generalize": [],
+                "all": [],
+                "qc": []
+            },
+            "value-disables": {
+                "prepare": [
+                    "model"
+                ],
+                "generalize": [
+                    "reset_database",
+                    "debug",
+                    "force",
+                    "non_linear_coreg",
+                    "log_level",
+                    "run",
+                    "space",
+                    "bids_filter_file",
+                    "participant_label",
+                    "task"
+                ],
+                "all": [
+                    "reset_database",
+                    "debug",
+                    "force",
+                    "non_linear_coreg",
+                    "log_level",
+                    "model",
+                    "run",
+                    "space",
+                    "bids_filter_file",
+                    "participant_label",
+                    "task"
+                ],
+                "qc": [
+                    "reset_database",
+                    "debug",
+                    "force",
+                    "non_linear_coreg",
+                    "log_level",
+                    "model",
+                    "run",
+                    "space",
+                    "bids_filter_file",
+                    "participant_label",
+                    "task"
+                ]
+            }
+        }
+    ],
+    "tags": {},
+    "suggested-resources": {
+        "cpu-cores": 1,
+        "ram": 1,
+        "walltime-estimate": 60
+    }
+}
diff --git a/boutiques/invocation.json b/boutiques/invocation.json
index 8dca7e6..45b02e1 100644
--- a/boutiques/invocation.json
+++ b/boutiques/invocation.json
@@ -1,9 +1,18 @@
 {
-    "bids_dir": "ds001",
-    "output_dir_name": "example-output",
-    "analysis_level": "subject",
-    "participant_label": [
-        "01"
+    "bids_dir": [
+        "./tests/data/moae_fmriprep"
     ],
-    "action": "segment"
+    "output_dir": [
+        "./outputs/moae_fmriprep/derivatives"
+    ],
+    "analysis_level": [
+        "participant"
+    ],
+    "command": "all",
+    "log_level": "-vv",
+    "debug": false,
+    "reset_database": true,
+    "force": false,
+    "non_linear_coreg": true,
+    "model": "1_guided_fixations"
 }
diff --git a/pyproject.toml b/pyproject.toml
index d382650..7a5b0ab 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -142,8 +142,8 @@ disallow_untyped_defs = true
 exclude = ['tests/']
 no_implicit_optional = true
 plugins = [
-    "pydantic.mypy",
-    "numpy.typing.mypy_plugin"
+    "numpy.typing.mypy_plugin",
+    "pydantic.mypy"
 ]
 warn_redundant_casts = true
 warn_unused_ignores = true
diff --git a/tools/create_boutiques_descriptor.py b/tools/create_boutiques_descriptor.py
new file mode 100644
index 0000000..1faf21b
--- /dev/null
+++ b/tools/create_boutiques_descriptor.py
@@ -0,0 +1,28 @@
+import boutiques.creator as bc
+
+from bidsmreye._parsers import common_parser
+
+newDescriptor = bc.CreateDescriptor(common_parser(), execname="bidsmreye")
+
+# newDescriptor.save("bidsmreye_0.4.0.json")
+
+cmd = (
+    "$PWD/tests/data/moae_fmriprep "
+    "$PWD/outputs/moae_fmriprep/derivatives "
+    "participant "
+    "all "
+    "--reset_database --non_linear_coreg --model 1_guided_fixations -vv"
+)
+cmd = cmd.split(" ")
+
+print(cmd)
+
+parser = common_parser()
+
+args = parser.parse_args(cmd)
+invoc = newDescriptor.createInvocation(args)
+
+# Then, if you want to save them to a file...
+# import json
+# with open('my-inputs.json', 'w') as fhandle:
+#     fhandle.write(json.dumps(invoc, indent=4))


Test patch:
diff --git a/.github/workflows/system_tests.yml b/.github/workflows/system_tests.yml
index 04b543a..ed58000 100644
--- a/.github/workflows/system_tests.yml
+++ b/.github/workflows/system_tests.yml
@@ -17,41 +17,33 @@ env:
 
 jobs:
     system_test:
-
         runs-on: ubuntu-latest
-
         strategy:
             matrix:
                 python-version: ['3.11']
-
+                cmd: [demo, demo_boutiques]
+            fail-fast: false
         steps:
-
         -   name: Clone repo
             uses: actions/checkout@v4
-
         -   name: Set up Python ${{ matrix.python-version }}
             uses: actions/setup-python@v5
             with:
                 python-version: ${{ matrix.python-version }}
-
         -   name: Install dependencies
             run: |
                 sudo apt-get update -y
                 sudo apt-get install -y git-annex
                 python -m pip install --upgrade pip setuptools
-                pip install datalad
-
+                pip install datalad boutiques
         -   name: Install bidsmreye
             run: |
                 pip install .
-
         -   name: Datalad WTF
             run: |
                 datalad wtf
-
-        -   name: Run demo
-            run: make demo
-
+        -   name: Run ${{ matrix.cmd }}
+            run: make ${{ matrix.cmd }}
         -   name: Re run demo (should be faster)
             run: |
                 make prepare