Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BIDS EEG import bug fix] This fixes a bug happening during the file type determination #512

Merged
merged 2 commits into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion python/lib/imaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from nilearn import plotting
from nilearn import image

import lib.exitcode


__license__ = "GPLv3"

Expand Down Expand Up @@ -73,7 +75,8 @@ def determine_file_type(self, file):
# if the file type cannot be found in the database, exit now
file_type = None
for type in imaging_file_types:
if type['type'] in file:
regex_match = r'' + type['type'] + r'(\.gz)?$'
if re.search(regex_match, file):
file_type = type['type']

# exits if could not find a file type
Expand Down
1 change: 0 additions & 1 deletion python/lib/mri.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ def fetch_and_insert_nifti_file(self, nifti_file, derivatives=None):
)
print(self.data_dir + pic_rel_path)
if os.path.exists(self.data_dir + 'pic/' + pic_rel_path):
print("INNNN")
imaging.insert_parameter_file(file_id, 'check_pic_filename', pic_rel_path)

return {'file_id': file_id, 'file_path': file_path}
Expand Down
5 changes: 4 additions & 1 deletion python/lib/physiological.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import os
import subprocess

import lib.exitcode

__license__ = "GPLv3"


Expand Down Expand Up @@ -72,7 +74,8 @@ def determine_file_type(self, file):
# if the file type cannot be found in the database, exit now
file_type = None
for type in imaging_file_types:
if type['type'] in file:
regex_match = r'' + type['type'] + r'(\.gz)?$'
if re.search(regex_match, file):
file_type = type['type']

# exits if could not find a file type
Expand Down