Open michellewang opened 1 month ago
We also decided to no longer have Nipoppy-specific default values in the descriptor files themselves -- instead they will be stored in the default/sample invocation files
It turns out that this is trickier than initially thought, because Boutiques will surround the container command with quotes (for security purposes). I have opened an issue for that, let's see if they respond.
Tentative descriptor modifications (for future reference):
{
"command-line": "[CONTAINER_WRAPPER] dcm2bids [DICOM_DIR] [PARTICIPANT] [SESSION] [CONFIG] [OUTPUT_DIR] [AUTO_EXTRACT_ENTITIES] [BIDS_VALIDATE] [FORCE_DCM2BIDS] [SKIP_DCM2NIIX] [CLOBBER] [LOG_LEVEL] [VERSION]",
"inputs": [
{
"id": "container_wrapper",
"name": "container_wrapper",
"description": "The full container command to run the tool, for example 'apptainer run container.sif'. By default this does not add anything to the command line",
"optional": true,
"type": "String",
"value-key": "[CONTAINER_WRAPPER]",
"default-value": null
}
]
}
Corresponding invocation:
{
"container_wrapper": "[[NIPOPPY_CONTAINER_COMMAND]] [[NIPOPPY_FPATH_CONTAINER]]",
"dicom_dir": [
"[[NIPOPPY_DPATH_SOURCEDATA]]/[[NIPOPPY_PARTICIPANT]]/[[NIPOPPY_SESSION]]"
],
"participant": "[[NIPOPPY_PARTICIPANT]]",
"session": "[[NIPOPPY_SESSION_SHORT]]",
"config": "[[DCM2BIDS_CONFIG_FILE]]",
"output_dir": "[[NIPOPPY_DPATH_BIDS]]"
}
Doesn't work because whatever is in "container_wrapper"
gets surrounded by single quotes :/
After chatting with Mathieu at OHBM brainhack, we found a workaround using environment variables (e.g. replace [[NIPOPPY_CONTAINER_COMMAND]]
with $NIPOPPY_CONTAINER_COMMAND
and setting the environment variables before running bosh
[[NIPOPPY_CONTAINER_COMMAND]] [[NIPOPPY_FPATH_CONTAINER]]
in the"command-line"
field.[CONTAINER_COMMAND]
andFPATH_CONTAINER
, with defaults being[[NIPOPPY_CONTAINER_COMMAND]]
and[[NIPOPPY_FPATH_CONTAINER]]
)