Skip to content

Commit

Permalink
REF: remove functional images
Browse files Browse the repository at this point in the history
  • Loading branch information
ellisdg committed Jul 13, 2022
1 parent 6a3e184 commit 10c9aa8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 22 deletions.
2 changes: 1 addition & 1 deletion TEST/NoseTests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from bidsmanager.write.dataset_writer import write_dataset
from bidsmanager.read import read_csv, read_dataset
from bidsmanager.utils.utils import read_json, read_tsv
from bidsmanager.base import DataSet, Subject, Session, Image, FunctionalImage
from bidsmanager.base import DataSet, Subject, Session, Image


def get_script_directory():
Expand Down
2 changes: 1 addition & 1 deletion bidsmanager/base/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .subject import Subject
from .session import Session
from .dataset import DataSet
from .image import Image, FunctionalImage
from .image import Image
1 change: 0 additions & 1 deletion bidsmanager/base/group.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from .image import FunctionalImage
from .base import BIDSFolder


Expand Down
8 changes: 0 additions & 8 deletions bidsmanager/base/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,4 @@ def update_diffusion_files(self, move=False):
self.update_bvec(move=move)


class FunctionalImage(Image):
def __init__(self, *inputs, **kwargs):
super(FunctionalImage, self).__init__(*inputs, **kwargs)

def is_match(self, task_name=None, **kwargs):
return (not task_name or task_name == self.get_task_name()) and super(FunctionalImage, self).is_match(**kwargs)


image_entities = ("task", "acq", "ce", "dir", "rec", "run", "echo")
15 changes: 4 additions & 11 deletions bidsmanager/utils/image_utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
from bidsmanager.base.image import FunctionalImage, Image
from bidsmanager.base.image import Image


def load_image(path_to_image, modality=None, acquisition=None, task_name=None, run_number=None, path_to_sidecar=None,
bval_path=None, bvec_path=None, metadata=None, **entities):
if modality == "bold":
return FunctionalImage(modality=modality,
path=path_to_image,
sidecar_path=path_to_sidecar,
metadata=metadata,
**entities)
else:
return Image(modality=modality, path=path_to_image,
sidecar_path=path_to_sidecar, metadata=metadata, bval_path=bval_path, bvec_path=bvec_path,
**entities)
return Image(modality=modality, path=path_to_image,
sidecar_path=path_to_sidecar, metadata=metadata, bval_path=bval_path, bvec_path=bvec_path,
**entities)

0 comments on commit 10c9aa8

Please sign in to comment.