Skip to content

Commit

Permalink
Merge pull request Open-Minds-Lab#34 from sinhaharsh/main
Browse files Browse the repository at this point in the history
Skipping physiological continuous recordings
  • Loading branch information
raamana authored Mar 8, 2024
2 parents 6a2ff66 + 5a0e19c commit 8f9cb96
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 5 additions & 5 deletions MRdataset/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ def _process(self, folder):
sequences.append(seq)
else:
if name not in SUPPORTED_BIDS_DATATYPES:
logger.error(f'MRdataset primarily supports '
f'{SUPPORTED_BIDS_DATATYPES}'
f'It seems the parameters in '
f'this sequence are invalid or '
f'not supported yet. Skipping it.')
logger.warning(f'MRdataset primarily supports '
f'{SUPPORTED_BIDS_DATATYPES} .'
f'It seems the parameters in '
f'this sequence are invalid or '
f'not supported yet. Skipping it.')
return sequences

@staticmethod
Expand Down
9 changes: 9 additions & 0 deletions MRdataset/dicom_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ def is_bids_file(filename: Union[str, Path]):
return False
if 'sourcedata' in str(filename):
return False

# TODO: Add support for physiological and other continuous
# recordings. Skip for now.
# See : https://bids-specification.readthedocs.io/en/stable/modality-specific-files/physiological-and-other-continuous-recordings.html # noqa
# Example dataset on OpenNeuro : ds002785
if '_physio.' in str(filename):
return False
if '_stim.' in str(filename):
return False
# Regular expression pattern
pattern = r'sub-[^_]+'
# Extracting substring using regex
Expand Down

0 comments on commit 8f9cb96

Please sign in to comment.