Skip to content

Commit 39e4173

Browse files
committed
Replace "study bidsmap" with "dataset bidsmap" to align with the BIDS study notion (GitHub issue #281)
1 parent 4132249 commit 39e4173

26 files changed

+102
-102
lines changed

bidscoin/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
44
The basic workflow is to run these two command-line tools:
55
6-
$ bidsmapper sourcefolder bidsfolder # This produces a study bidsmap and launches a GUI
7-
$ bidscoiner sourcefolder bidsfolder # This converts your data to BIDS according to the study bidsmap
6+
$ bidsmapper sourcefolder bidsfolder # This produces a dataset bidsmap and launches a GUI
7+
$ bidscoiner sourcefolder bidsfolder # This converts your data to BIDS according to the dataset bidsmap
88
99
The `bids` library module can be used to build plugins and interact with bidsmaps. The `bcoin` module can be
1010
used as a library as well from the command line to get help and perform generic management tasks.

bidscoin/bids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ def __init__(self, yamlfile: Path, folder: Path=templatefolder, plugins: Iterabl
918918
919919
:param yamlfile: The full path or base name of the bidsmap yaml-file
920920
:param folder: Used when yamlfile=basename and not in the pwd: yamlfile is then assumed to be in the (bids/code/bidscoin)folder. A bidsignore file in folder will be added to the bidsmap bidsignore items
921-
:param plugins: List of plugins to be used (with default options, overrules the plugin list in the study/template bidsmaps). Leave empty to use all plugins in the bidsmap
921+
:param plugins: List of plugins to be used (with default options, overrules the plugin list in the dataset/template bidsmaps). Leave empty to use all plugins in the bidsmap
922922
:param checks: Booleans to check if all (bidskeys, bids-suffixes, bids-values) in the run are present according to the BIDS schema specifications
923923
"""
924924

bidscoin/bidseditor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def __init__(self, bidsfolder: Path, input_bidsmap: BidsMap, template_bidsmap: B
276276
buttonbox.button(QDialogButtonBox.StandardButton.Save).clicked.connect(self.save_bidsmap)
277277
validatebutton = buttonbox.addButton('Validate', QDialogButtonBox.ButtonRole.ActionRole)
278278
validatebutton.setIcon(QtGui.QIcon.fromTheme('tools-check-spelling'))
279-
validatebutton.setToolTip('Test the run-items and bidsname of all normal runs in the study bidsmap (see terminal output)')
279+
validatebutton.setToolTip('Test the run-items and bidsname of all normal runs in the dataset bidsmap (see terminal output)')
280280
validatebutton.clicked.connect(self.validate_runs)
281281

282282
# Set up the main layout
@@ -994,7 +994,7 @@ def test_bidscoin(self):
994994
QMessageBox.warning(self, 'Tool test', f"BIDScoin test: Failed\nSee terminal output for more info")
995995

996996
def validate_runs(self):
997-
"""Test the runs in the study bidsmap"""
997+
"""Test the runs in the dataset bidsmap"""
998998

999999
LOGGER.info(' ')
10001000
self.output_bidsmap.check()

bidscoin/bidsmapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
"""A BIDScoin application to create a study bidsmap (See also cli/_bidsmapper.py)"""
2+
"""A BIDScoin application to create a dataset bidsmap (See also cli/_bidsmapper.py)"""
33

44
# NB: Set os.environ['DUECREDIT'] values as early as possible to capture all credits
55
import os
@@ -33,7 +33,7 @@ def bidsmapper(sourcefolder: str, bidsfolder: str, bidsmap: str, template: str,
3333
:param bidsfolder: The name of the BIDS root folder
3434
:param bidsmap: The name of the bidsmap YAML-file
3535
:param template: The name of the bidsmap template YAML-file
36-
:param plugins: Optional list of plugins that should be used (overrules the list in the study/template bidsmaps)
36+
:param plugins: Optional list of plugins that should be used (overrules the list in the dataset/template bidsmaps)
3737
:param subprefix: The prefix common for all source subject-folders
3838
:param sesprefix: The prefix common for all source session-folders
3939
:param unzip: Wildcard pattern to select tar/zip-files in the session folder. Leave empty to use the bidsmap value
@@ -134,7 +134,7 @@ def bidsmapper(sourcefolder: str, bidsfolder: str, bidsmap: str, template: str,
134134
if unpacked:
135135
shutil.rmtree(sesfolder)
136136

137-
# Save the new study bidsmap in the bidscoinfolder or launch the bidseditor UI_MainWindow
137+
# Save the new dataset bidsmap in the bidscoinfolder or launch the bidseditor UI_MainWindow
138138
if automated:
139139
bidsmap_new.save()
140140

bidscoin/cli/_bcoin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
1111
The basic workflow is to run these two tools:
1212
13-
$ bidsmapper sourcefolder bidsfolder # This produces a study bidsmap and launches a GUI
14-
$ bidscoiner sourcefolder bidsfolder # This converts your data to BIDS according to the study bidsmap
13+
$ bidsmapper sourcefolder bidsfolder # This produces a dataset bidsmap and launches a GUI
14+
$ bidscoiner sourcefolder bidsfolder # This converts your data to BIDS according to the dataset bidsmap
1515
1616
Default settings, plugins and template bidsmaps are stored in the `.bidscoin` configuration folder in your
1717
home directory (you can modify the configuration files to your needs with any plain text editor)
@@ -47,7 +47,7 @@ def get_parser() -> argparse.ArgumentParser:
4747
' bidscoin -d data/bidscoin\n'
4848
' bidscoin -t\n'
4949
' bidscoin -t my_template_bidsmap\n'
50-
' bidscoin -b my_study_bidsmap\n'
50+
' bidscoin -b my_dataset_bidsmap\n'
5151
' bidscoin -i data/my_template_bidsmap.yaml downloads/my_plugin.py\n'
5252
' bidscoin -c myproject/bids format bibtex\n'
5353
' bidscoin --tracking show\n ')
@@ -57,7 +57,7 @@ def get_parser() -> argparse.ArgumentParser:
5757
parser.add_argument('-u', '--uninstall', help='A list of template bidsmaps and/or bidscoin plugins to uninstall', nargs='+', metavar='NAME')
5858
parser.add_argument('-d', '--download', help='Download tutorial MRI data to the DOWNLOAD folder', metavar='FOLDER')
5959
parser.add_argument('-t', '--test', help='Test the bidscoin installation and template bidsmap', nargs='?', metavar='TEMPLATE', const=bidsmap_template)
60-
parser.add_argument('-b', '--bidsmaptest', help='Test the run-items and their bidsnames of all normal runs in the study bidsmap. Provide the bids-folder or the bidsmap filepath', metavar='BIDSMAP')
60+
parser.add_argument('-b', '--bidsmaptest', help='Test the run-items and their bidsnames of all normal runs in the dataset bidsmap. Provide the bids-folder or the bidsmap filepath', metavar='BIDSMAP')
6161
parser.add_argument('-c', '--credits', help='Show duecredit citations for your BIDS repository. You can also add duecredit summary arguments (without dashes), e.g. `style {apa,harvard1}` or `format {text,bibtex}`.', metavar='OPTIONS', nargs='+')
6262
parser.add_argument('-r', '--reset', help='Restore the settings, plugins and template bidsmaps in your home directory to their default values', action='store_true')
6363
parser.add_argument( '--tracking', help='Show the usage tracking info {show}, or set usage tracking to {yes} or {no}', choices=['yes','no','show'])

bidscoin/cli/_bidscoiner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ def get_parser():
2828
' bidscoiner myproject/raw myproject/bids\n'
2929
' bidscoiner -f myproject/raw myproject/bids -p sub-009 sub-030\n'
3030
' bidscoiner -f myproject/raw myproject/bids -c "--time=00:30:00 --mem=4000"\n ')
31-
parser.add_argument('sourcefolder', help='The study root folder containing the raw source data')
31+
parser.add_argument('sourcefolder', help='The dataset root folder containing the raw source data')
3232
parser.add_argument('bidsfolder', help='The destination/output folder with the bids data')
3333
parser.add_argument('-p','--participant', help='Space separated list of selected sub-# names/folders to be processed (the sub-prefix can be omitted). Otherwise all subjects in the sourcefolder will be processed', metavar='LABEL', nargs='+')
34-
parser.add_argument('-b','--bidsmap', help='The study bidsmap file with the mapping heuristics. If the bidsmap filename is just the base name (i.e. no "/" in the name) then it is assumed to be located in the current directory or in bidsfolder/code/bidscoin. Default: bidsmap.yaml', metavar='NAME', default='bidsmap.yaml')
34+
parser.add_argument('-b','--bidsmap', help='The dataset bidsmap file with the mapping heuristics. If the bidsmap filename is just the base name (i.e. no "/" in the name) then it is assumed to be located in the current directory or in bidsfolder/code/bidscoin. Default: bidsmap.yaml', metavar='NAME', default='bidsmap.yaml')
3535
parser.add_argument('-f','--force', help='Process all subjects, regardless of existing subject folders in the bidsfolder. Otherwise these subject folders will be skipped', action='store_true')
3636
parser.add_argument('-c','--cluster', help='Use the DRMAA library to submit the bidscoiner jobs to a high-performance compute (HPC) cluster. You can add an opaque DRMAA argument with native specifications for your HPC resource manager (NB: Use quotes and include at least one space character to prevent premature parsing -- see examples)', metavar='SPECS', nargs='?', const='-l walltime=00:30:00,mem=4gb', type=str)
3737
parser.add_argument('-w','--workdir', help='Optional working directory for temporary unpacking of zipped or DICOMDIR data. Defaults to the system temporary folder if not specified', metavar='PATH', default='')

bidscoin/cli/_bidseditor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def get_parser() -> argparse.ArgumentParser:
3131
bidseditor myproject/bids -b my/custom/bidsmap.yaml"""))
3232

3333
parser.add_argument('bidsfolder', help='The destination folder with the (future) bids data')
34-
parser.add_argument('-b','--bidsmap', help='The study bidsmap file with the mapping heuristics. If the bidsmap filename is just the base name (i.e. no "/" in the name) then it is assumed to be located in the current directory or in bidsfolder/code/bidscoin. Default: bidsmap.yaml', metavar='NAME', default='bidsmap.yaml')
34+
parser.add_argument('-b','--bidsmap', help='The dataset bidsmap file with the mapping heuristics. If the bidsmap filename is just the base name (i.e. no "/" in the name) then it is assumed to be located in the current directory or in bidsfolder/code/bidscoin. Default: bidsmap.yaml', metavar='NAME', default='bidsmap.yaml')
3535
parser.add_argument('-t','--template', help=f'The template bidsmap file with the default heuristics (this could be provided by your institute). If the bidsmap filename is just the base name (i.e. no "/" in the name) then it is assumed to be located in the bidscoin config folder. Default: {bidsmap_template.stem}', metavar='NAME', default=bidsmap_template)
3636

3737
return parser

bidscoin/cli/_bidsmapper.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
The bidsmapper scans your source data repository to identify different data types by matching
33
them against the run-items in the template bidsmap. Once a match is found, a mapping to BIDS
4-
output data types is made and the run-item is added to the study bidsmap. You can check and
4+
output data types is made and the run-item is added to the dataset bidsmap. You can check and
55
edit these generated bids-mappings to your needs with the (automatically launched) bidseditor.
66
Re-run the bidsmapper whenever something was changed in your data acquisition protocol and
77
edit the new data type to your needs (your existing bidsmap will be reused).
@@ -33,14 +33,14 @@ def get_parser() -> argparse.ArgumentParser:
3333
' bidsmapper myproject/raw myproject/bids -p nibabel2bids # Uses a plugin of choice\n'
3434
" bidsmapper myproject/raw myproject/bids -n patient- -m '*' # Handles DICOMDIR datasets\n"
3535
" bidsmapper myproject/raw myproject/bids -u '*.tar.gz' # Unzip tarball source files\n ")
36-
parser.add_argument('sourcefolder', help='The study root folder containing the raw source data folders')
36+
parser.add_argument('sourcefolder', help='The dataset root folder containing the raw source data folders')
3737
parser.add_argument('bidsfolder', help='The destination folder with the (future) bids data and the bidsfolder/code/bidscoin/bidsmap.yaml output file')
38-
parser.add_argument('-b','--bidsmap', help="The study bidsmap file with the mapping heuristics. If the bidsmap filename is just the base name (i.e. no '/' in the name) then it is assumed to be located in the current directory or in bidsfolder/code/bidscoin. Default: bidsmap.yaml", metavar='NAME', default='bidsmap.yaml')
38+
parser.add_argument('-b','--bidsmap', help="The dataset bidsmap file with the mapping heuristics. If the bidsmap filename is just the base name (i.e. no '/' in the name) then it is assumed to be located in the current directory or in bidsfolder/code/bidscoin. Default: bidsmap.yaml", metavar='NAME', default='bidsmap.yaml')
3939
parser.add_argument('-t','--template', help=f"The bidsmap template file with the default heuristics (this could be provided by your institute). If the bidsmap filename is just the base name (i.e. no '/' in the name) then it is assumed to be located in the bidscoin config folder. Default: {bidsmap_template.stem}", metavar='NAME', default=bidsmap_template)
40-
parser.add_argument('-p','--plugins', help='List of plugins to be used. Default: the plugin list of the study/template bidsmap', nargs='+', metavar='NAME', default=[])
41-
parser.add_argument('-n','--subprefix', help="The prefix common for all the source subject-folders (e.g. 'Pt' is the subprefix if subject folders are named 'Pt018', 'Pt019', ...). Use '*' when your subject folders do not have a prefix. Default: the value of the study/template bidsmap, e.g. 'sub-'", metavar='PREFIX')
42-
parser.add_argument('-m','--sesprefix', help="The prefix common for all the source session-folders (e.g. 'M_' is the subprefix if session folders are named 'M_pre', 'M_post', ..). Use '*' when your session folders do not have a prefix. Default: the value of the study/template bidsmap, e.g. 'ses-'", metavar='PREFIX')
43-
parser.add_argument('-u','--unzip', help='Wildcard pattern to unpack tarball/zip-files in the sub/ses sourcefolder that need to be unzipped (in a tempdir) to make the data readable. Default: the value of the study/template bidsmap', metavar='PATTERN')
40+
parser.add_argument('-p','--plugins', help='List of plugins to be used. Default: the plugin list of the dataset/template bidsmap', nargs='+', metavar='NAME', default=[])
41+
parser.add_argument('-n','--subprefix', help="The prefix common for all the source subject-folders (e.g. 'Pt' is the subprefix if subject folders are named 'Pt018', 'Pt019', ...). Use '*' when your subject folders do not have a prefix. Default: the value of the dataset/template bidsmap, e.g. 'sub-'", metavar='PREFIX')
42+
parser.add_argument('-m','--sesprefix', help="The prefix common for all the source session-folders (e.g. 'M_' is the subprefix if session folders are named 'M_pre', 'M_post', ..). Use '*' when your session folders do not have a prefix. Default: the value of the dataset/template bidsmap, e.g. 'ses-'", metavar='PREFIX')
43+
parser.add_argument('-u','--unzip', help='Wildcard pattern to unpack tarball/zip-files in the sub/ses sourcefolder that need to be unzipped (in a tempdir) to make the data readable. Default: the value of the dataset/template bidsmap', metavar='PATTERN')
4444
parser.add_argument('-s','--store', help='Store newly discovered data samples in the bidsfolder/code/provenance folder (useful for editing e.g. zipped or DICOMDIR datasets)', action='store_true')
4545
parser.add_argument('-a','--automated', help='Save the automatically generated bidsmap to disk and without interactively tweaking it with the bidseditor', action='store_true')
4646
parser.add_argument('-f','--force', help='Discard the previously saved bidsmap and log file, instead of reusing them (use this option for a fresh start)', action='store_true')

bidscoin/cli/_bidsparticipants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def get_parser():
2222
epilog='examples:\n'
2323
' bidsparticipants myproject/raw myproject/bids\n'
2424
' bidsparticipants myproject/raw myproject/bids -b mybidsmap\n ')
25-
parser.add_argument('sourcefolder', help='The study root folder containing the raw source data folders')
25+
parser.add_argument('sourcefolder', help='The dataset root folder containing the raw source data folders')
2626
parser.add_argument('bidsfolder', help='The destination/output folder with the bids data')
2727
parser.add_argument('-d','--dryrun', help='Do not save anything, only print the participants info on screen', action='store_true')
28-
parser.add_argument('-b','--bidsmap', help='The study bidsmap file with the mapping heuristics. If the bidsmap filename is just the base name (i.e. no "/" in the name) then it is assumed to be located in the current directory or in bidsfolder/code/bidscoin. Default: bidsmap.yaml', metavar='NAME', default='bidsmap.yaml')
28+
parser.add_argument('-b','--bidsmap', help='The dataset bidsmap file with the mapping heuristics. If the bidsmap filename is just the base name (i.e. no "/" in the name) then it is assumed to be located in the current directory or in bidsfolder/code/bidscoin. Default: bidsmap.yaml', metavar='NAME', default='bidsmap.yaml')
2929

3030
return parser

bidscoin/cli/_fixmeta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ class CustomFormatter(argparse.RawDescriptionHelpFormatter): pass
2525
parser.add_argument('pattern', help="Globlike recursive search pattern (relative to the subject/session folder) to select the json sidecar targets that need to be fixed, e.g. '*task-*echo-1*'")
2626
parser.add_argument('metadata', help='Dictionary with key-value pairs of metadata that need to be fixed. If value is a string, then this metadata is written to the sidecars as is, but if it is a list of `old`/`new` strings, i.e. `[old1, new1, old2, new2, ..]`, then the existing metadata is re-written, with all occurrences of substring `old` replaced by `new`', type=json.loads)
2727
parser.add_argument('-p','--participant', help='Space separated list of sub-# identifiers to be processed (the sub-prefix can be left out). If not specified then all participants will be processed', nargs='+', metavar='LABEL')
28-
parser.add_argument('-b','--bidsmap', help='Selects a custom study bidsmap file for extracting source data properties and attributes. If the bidsmap filename is just the base name (i.e. no "/" in the name) then it is assumed to be located in the current directory or in bidsfolder/code/bidscoin. Default: bidsmap.yaml or else the template bidsmap', metavar='NAME')
28+
parser.add_argument('-b','--bidsmap', help='Selects a custom dataset bidsmap file for extracting source data properties and attributes. If the bidsmap filename is just the base name (i.e. no "/" in the name) then it is assumed to be located in the current directory or in bidsfolder/code/bidscoin. Default: bidsmap.yaml or else the template bidsmap', metavar='NAME')
2929

3030
return parser

0 commit comments

Comments
 (0)