Skip to content

Commit

Permalink
Error on missing acq time
Browse files Browse the repository at this point in the history
  • Loading branch information
laemtl committed Oct 19, 2021
1 parent 3e3a196 commit 43ab615
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion python/bids_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ def read_and_insert_bids(bids_dir, config_file, verbose, createcand, createvisit
scan_data.to_df()
for scan_data in bids_reader.bids_layout.get_collections('session', 'scans')
])
visit_date = min(scans_data['acq_time'])

if len(scans_data.get('acq_time')) == 0:
message = '\n\tERROR: Can\'t find scans acquisition time data'
print(message)
sys.exit(lib.exitcode.BIDS_SCANS_ACQ_TIME_MISSING)

visit_date = min(scans_data.get('acq_time'))

# greps BIDS session's info for the candidate from LORIS
# Creates the session if it does not exist yet in LORIS and createvisit is set to true.
Expand Down
5 changes: 3 additions & 2 deletions python/lib/exitcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
UNKNOWN_PROTOCOL = 84 # if unknown acq protocol for the file to insert


CANDIDATE_MISMATCH = 181
BIDS_CANDIDATE_MISMATCH = 182
CANDIDATE_MISMATCH = 181
BIDS_CANDIDATE_MISMATCH = 182
BIDS_SCANS_ACQ_TIME_MISSING = 183

0 comments on commit 43ab615

Please sign in to comment.