Skip to content

Commit

Permalink
Update set file path override and chunks logic - bugfix (#1051)
Browse files Browse the repository at this point in the history
  • Loading branch information
laemtl authored Mar 15, 2024
1 parent 8b20077 commit 25d9fb6
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions python/lib/eeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,27 +513,27 @@ def fetch_and_insert_eeg_files(self, derivatives=False, detect=True):
eeg_file_info, eeg_file_data
)

if self.loris_bids_root_dir:
# If we copy the file in assembly_bids and
# if the EEG file was a set file, then update the filename for the .set
# and .fdt files in the .set file so it can find the proper file for
# visualization and analyses
if file_type == 'set':
set_full_path = os.path.join(self.data_dir, eeg_path)
width_fdt_file = True if 'fdt_file' in eeg_file_data.keys() else False

file_paths_updated = utilities.update_set_file_path_info(set_full_path, width_fdt_file)
if not file_paths_updated:
message = "WARNING: cannot update the set file " + eeg_path + " path info"
print(message)

inserted_eegs.append({
'file_id': physio_file_id,
'file_path': eeg_path,
'eegjson_file_path': eegjson_file_path,
'fdt_file_path': fdt_file_path,
'original_file_data': eeg_file,
})
if self.loris_bids_root_dir:
# If we copy the file in assembly_bids and
# if the EEG file was a set file, then update the filename for the .set
# and .fdt files in the .set file so it can find the proper file for
# visualization and analyses
if file_type == 'set':
set_full_path = os.path.join(self.data_dir, eeg_path)
width_fdt_file = True if 'fdt_file' in eeg_file_data.keys() else False

file_paths_updated = utilities.update_set_file_path_info(set_full_path, width_fdt_file)
if not file_paths_updated:
message = "WARNING: cannot update the set file " + eeg_path + " path info"
print(message)

inserted_eegs.append({
'file_id': physio_file_id,
'file_path': eeg_path,
'eegjson_file_path': eegjson_file_path,
'fdt_file_path': fdt_file_path,
'original_file_data': eeg_file,
})

return inserted_eegs

Expand Down

0 comments on commit 25d9fb6

Please sign in to comment.