Skip to content

Commit

Permalink
Merge pull request #663 from arnaudbore/ENH_bids_validator
Browse files Browse the repository at this point in the history
[BF] Bids validate
  • Loading branch information
arnaudbore authored Jan 5, 2023
2 parents 7e1e9d8 + c972e95 commit cf023d6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/scil_validate_bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ def get_data(layout, nSub, dwis, t1s, fs, default_readout, clean):
related_files_suffixes = []
for curr_related in related_files:
related_files_suffixes.append(curr_related.entities['suffix'])
if dwi_direction == get_opposite_phase_encoding_direction(related_files[0].entities[direction_key]):
PE[1] = conversion[related_files[0].entities[direction_key]]
topup_suffix[curr_related.entities['suffix']][1] = related_files[0].path
if dwi_direction == get_opposite_phase_encoding_direction(curr_related.entities[direction_key]):
PE[1] = conversion[curr_related.entities[direction_key]]
topup_suffix[curr_related.entities['suffix']][1] = curr_related.path
else:
topup_suffix[curr_related.entities['suffix']][0] = related_files[0].path
topup_suffix[curr_related.entities['suffix']][0] = curr_related.path

if related_files_suffixes.count('epi') > 2 or related_files_suffixes.count('sbref') > 2:
topup_suffix = {'epi': ['', ''], 'sbref': ['', '']}
Expand Down Expand Up @@ -272,8 +272,9 @@ def get_data(layout, nSub, dwis, t1s, fs, default_readout, clean):
elif len(t1_nSess) == 0:
logging.info('No T1 file found.')
else:
t1_paths = [curr_t1.path for curr_t1 in t1_nSess]
logging.info('More than one T1 file found.'
' [{}]'.format(','.join(t1_nSess)))
' [{}]'.format(','.join(t1_paths)))

return {'subject': nSub,
'session': nSess,
Expand Down

0 comments on commit cf023d6

Please sign in to comment.