Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion setup-commands/xnat2bids/xnat2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def copyScanBidsFiles(destDirBase, bidsScanList):
for f in scan.sourceFiles:
shutil.copy(f, destDir)

version = "1.0"
version = "1.1"
args = docopt(__doc__, version=version)

inputDir = args['<inputDir>']
Expand All @@ -201,6 +201,11 @@ def copyScanBidsFiles(destDirBase, bidsScanList):
# First check if the input directory is a session directory
sessionBidsScans = bidsifySession(inputDir)

# BIDS specification 1.2.1: Every BIDS dataset MUST include the dataset_description.json file
sessionBidsJsonPath = os.path.join(inputDir, 'RESOURCES', 'BIDS', 'dataset_description.json')
if os.path.exists(sessionBidsJsonPath):
shutil.copy(sessionBidsJsonPath, outputDir)

bidsSubjectMap = {}
if sessionBidsScans:
subject = getSubjectForBidsScans(sessionBidsScans)
Expand Down