|
@@ -157,4 +157,45 @@ In order to replace the original structural images with the defaced once ([as re
|
|
|
### Resources
|
|
|
|
|
|
* ["Pydeface defaces structural data only?!"](https://neurostars.org/t/pydeface-defaces-structural-data-only/903) - Discussion on neurostars.org if any other data than structural acquisitions should be defaced (short answer: no!)
|
|
|
-* ["Is/how much fmriprep (freesurfer et al) is resilient to “defacing”?"](https://neurostars.org/t/is-how-much-fmriprep-freesurfer-et-al-is-resilient-to-defacing/2642) - Discussion on neurostars.org if `fMRIPrep` works well with defaced data (short answer: yes!)
|
|
|
+* ["Is/how much fmriprep (freesurfer et al) is resilient to “defacing”?"](https://neurostars.org/t/is-how-much-fmriprep-freesurfer-et-al-is-resilient-to-defacing/2642) - Discussion on neurostars.org if `fMRIPrep` works well with defaced data (short answer: yes!)
|
|
|
+
|
|
|
+## Step 3: Adding additional information to the BIDS dataset
|
|
|
+
|
|
|
+### Code and software
|
|
|
+
|
|
|
+First, we created a virtual environment using Python version 3.8.5 to install all dependencies and required packages.
|
|
|
+
|
|
|
+A list of all required packages can be found in `requirements.txt` (created using `pip freeze > requirements.txt`) and installed via `pip install -r requirements.txt`.
|
|
|
+
|
|
|
+```bash
|
|
|
+mkvirtualenv highspeed-bids -p $(which python3)
|
|
|
+````
|
|
|
+
|
|
|
+```bash
|
|
|
+(highspeed-bids) lip-osx-003854:highspeed-bids wittkuhn$ python --version
|
|
|
+Python 3.8.5
|
|
|
+````
|
|
|
+
|
|
|
+#### Updating `dataset_description.json`: `python highspeed-bids-description.py`
|
|
|
+
|
|
|
+`highspeed-bids-description.py` is a short Python script that loads the `dataset_description.json` file that is pre-generated by HeuDiConv and populates it with the relevant study informtion.
|
|
|
+
|
|
|
+```{python, echo=TRUE, code=readLines(file.path(path_root, "code", "bids_conversion", "highspeed-bids-description.py")), eval=FALSE, python.reticulate=FALSE}
|
|
|
+```
|
|
|
+
|
|
|
+#### Updating the `.json` files of fieldmap data: `python highspeed-bids-fieldmaps.py`
|
|
|
+
|
|
|
+During later pre-processing of MRI data with `fMRIPrep`, we want to use our fieldmap data for distortion correction.
|
|
|
+To ensure that `fMRIPrep` detects and uses the fieldmap data, we need to add the `IntendedFor` field to the `.json` files of the fieldmap data and provide relative paths to the functional task data (see [here](https://bids-specification.readthedocs.io/en/latest/04-modality-specific-files/01-magnetic-resonance-imaging-data.html#fieldmap-data) for more information).
|
|
|
+
|
|
|
+This is done using the `code/bids_conversion/highspeed-bids-fieldmaps.py` file.
|
|
|
+To detect the provencance of the run command in our DataLad dataset, we run:
|
|
|
+
|
|
|
+```bash
|
|
|
+datalad run -m "create IntendedFor fields in fieldmap .json files" \
|
|
|
+--input "./*/*/*/*.nii.gz" --output "./*/*/fmap/*.json" \ "python3 code/code/bids_conversion/highspeed_bids_fieldmaps.py ."
|
|
|
+```
|
|
|
+
|
|
|
+```{python, echo=TRUE, code=readLines(file.path(path_root, "code", "bids_conversion", "highspeed-bids-fieldmaps.py")), eval=FALSE, python.reticulate=FALSE}
|
|
|
+```
|
|
|
+
|