Skip to content

Commit

Permalink
Update cubids.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Jan 17, 2025
1 parent 284ba6a commit 336155e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cubids/cubids.py
Original file line number Diff line number Diff line change
Expand Up @@ -1867,6 +1867,17 @@ def build_path(filepath, out_entities, out_dir, schema):
WARNING: DATATYPE CHANGE DETECTED
'/output/sub-01/ses-01/perf/sub-01_ses-01_acq-VAR_asl.nii.gz'
The datatype change is subject to false positives.
>>> build_path(
... "/input/sub-01/ses-01/func/sub-01_ses-01_task-meg_bold.nii.gz",
... {"datatype": "func", "acquisition": "VAR", "suffix": "bold"},
... "/output",
... schema,
... )
WARNING: DATATYPE CHANGE DETECTED
'/output/sub-01/ses-01/func/sub-01_ses-01_task-meg_acq-VAR_bold.nii.gz'
It expects a longitudinal structure, so providing a cross-sectional filename won't work.
XXX: This is a bug.
Expand Down Expand Up @@ -1920,6 +1931,8 @@ def build_path(filepath, out_entities, out_dir, schema):

# CHECK TO SEE IF DATATYPE CHANGED
# datatype may be overridden/changed if the original file is located in the wrong folder.
# XXX: This check for the datatype is fragile and should be improved.
# For example, what if we have sub-01/func/sub-01_task-anatomy_bold.nii.gz?
dtype_orig = ""
for dtype in valid_datatypes:
if dtype in filepath:
Expand Down

0 comments on commit 336155e

Please sign in to comment.