Skip to content

Commit 0b15a3e

Browse files
committed
Make stripping the suffix from bids-values in run-items optional (GitHub issue #265)
1 parent 630c466 commit 0b15a3e

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

bidscoin/bids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ def strip_suffix(self):
545545

546546
# See if we have a suffix for this datatype
547547
bids = self.bids
548-
if 'suffix' in bids and bids['suffix']:
548+
if 'suffix' in bids and bids['suffix'] and self.options.get('stripsuffix','y').lower() in ('y', 'yes'):
549549
suffix = bids['suffix'].lower()
550550
else:
551551
return

bidscoin/heuristics/bidsmap_bids2bids.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Options:
2727
unknowntypes: [extra_data] # A list of datatypes that are converted to BIDS-like datatype folders
2828
ignoretypes: [exclude] # A list of datatypes that are excluded / not converted to BIDS
2929
anon: y # Set this anonymization flag to 'y' to round off age and discard acquisition date from the metadata
30+
stripsuffix: y # Strips off the suffix from bids-values (to reduce redundancy within filenames)
3031
unzip: # Wildcard pattern to select tarball/zip-files in the source folders that need to be unzipped (in a tempdir) to expose the data, e.g. '*.tar.gz'
3132
plugins: # List of plugins with plugin-specific key-value pairs (that can be used by the plugin)
3233
nibabel2bids:

bidscoin/heuristics/bidsmap_dccn.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Options:
2828
unknowntypes: [extra_data] # A list of datatypes that are converted to BIDS-like datatype folders
2929
ignoretypes: [exclude] # A list of datatypes that are excluded / not converted to BIDS
3030
anon: y # Set this anonymization flag to 'y' to round off age and discard acquisition date from the metadata
31+
stripsuffix: y # Strips off the suffix from bids-values (to reduce redundancy within filenames)
3132
unzip: # Wildcard pattern to select tarball/zip-files in the source folders that need to be unzipped (in a tempdir) to expose the data, e.g. '*.tar.gz'
3233
plugins: # List of plugins with plugin-specific key-value pairs (that can be used by the plugin)
3334
dcm2niix2bids: # See dcm2niix -h and https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#General_Usage for more info

bidscoin/heuristics/bidsmap_sst.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Options:
2727
unknowntypes: [extra_data] # A list of datatypes that are converted to BIDS-like datatype folders
2828
ignoretypes: [exclude] # A list of datatypes that are excluded / not converted to BIDS
2929
anon: y # Set this anonymization flag to 'y' to round off age and discard acquisition date from the metadata
30+
stripsuffix: y # Strips off the suffix from bids-values (to reduce redundancy within filenames)
3031
unzip: # Wildcard pattern to select tarball/zip-files in the source folders that need to be unzipped (in a tempdir) to expose the data, e.g. '*.tar.gz'
3132
plugins: # List of plugins with plugin-specific key-value pairs (that can be used by the plugin)
3233
dcm2niix2bids: # See dcm2niix -h and https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#General_Usage for more info

bidscoin/heuristics/schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"unknowntypes": { "type": ["array"] },
2424
"ignoretypes": { "type": ["array"] },
2525
"anon": { "type": ["string", "null"] },
26+
"stripsuffix": { "type": ["string", "null"] },
2627
"unzip": { "type": ["string", "null"] }
2728
},
2829
"additionalProperties": false

0 commit comments

Comments
 (0)