Skip to content

Commit

Permalink
Update things.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Oct 14, 2023
1 parent 305b990 commit 23a5f09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xcp_d/utils/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def collect_run_data(layout, bold_file, cifti, primary_anat, target_space):
return run_data


def write_dataset_description(fmri_dir, xcpd_dir):
def write_dataset_description(fmri_dir, xcpd_dir, custom_confounds_folder=None):
"""Write dataset_description.json file for derivatives.
Parameters
Expand Down Expand Up @@ -711,6 +711,12 @@ def write_dataset_description(fmri_dir, xcpd_dir):

dset_desc["DatasetLinks"]["xcp_d"] = str(xcpd_dir)

if custom_confounds_folder:
if "custom_confounds" in dset_desc["DatasetLinks"].keys():
LOGGER.warning("'custom_confounds' is already a dataset link. Overwriting.")

dset_desc["DatasetLinks"]["custom_confounds"] = str(custom_confounds_folder)

xcpd_dset_description = os.path.join(xcpd_dir, "dataset_description.json")
if os.path.isfile(xcpd_dset_description):
with open(xcpd_dset_description, "r") as fo:
Expand Down
2 changes: 2 additions & 0 deletions xcp_d/workflows/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@ def init_postproc_derivatives_wf(
)

def _postproc_to_source(out_file, output_dir):
import os

from xcp_d.utils.utils import _out_file_to_source

return _out_file_to_source(out_file, "xcp_d", os.path.join(output_dir, "xcp_d"))
Expand Down

0 comments on commit 23a5f09

Please sign in to comment.