Skip to content

Commit

Permalink
making bids mri files
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperVanDenBosch committed Sep 15, 2023
1 parent 2878cf7 commit 0201560
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Empty file added demos/demo_fmri.ipynb
Empty file.
4 changes: 1 addition & 3 deletions demos/fmri_mur32.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
- [x] install fmriprep on worker
- [x] fmriprep 01-06
- [ ] fmriprep 07-14
roi as a bool descriptor?
- [ ] roi as a bool descriptor?
"""
from os.path import expanduser
Expand Down
10 changes: 7 additions & 3 deletions src/rsatoolbox/io/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
if TYPE_CHECKING:
from numpy.typing import NDArray
from pandas import DataFrame
import nibabel


class BidsFile:

def __init__(self, fpath: str) -> None:
self.fpath = fpath

def get_events(self) -> DataFrame:
return pandas.DataFrame()

Expand All @@ -27,8 +29,9 @@ def get_sibling(self, desc: str) -> BidsFile:

class BidsMriFile(BidsFile):

def __init__(self, nibabel) -> None:
def __init__(self, fpath: str, nibabel) -> None:
self.nibabel = nibabel
super().__init__(fpath)

def get_data(self) -> NDArray:
return numpy.array([])
Expand Down Expand Up @@ -65,4 +68,5 @@ def find_mri_derivative_files(self,
for task in tasks:
subset += [f for f in fpaths if f'task-{task}' in f]
fpaths = subset
return fpaths
nibabel = import_nibabel()
return [BidsMriFile(f, nibabel) for f in fpaths]
3 changes: 3 additions & 0 deletions src/rsatoolbox/io/fmriprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ def to_descriptors(self) -> Dict:
Dict: kwargs for DatasetBase
"""
return dict()

def __repr__(self) -> str:
return f'<{self.__class__.__name__}>'

0 comments on commit 0201560

Please sign in to comment.