Skip to content
Snippets Groups Projects
Commit 87a5537f authored by Paul McCarthy's avatar Paul McCarthy
Browse files

getDesign method implemented, and untested.

parent 15f69c0d
No related branches found
No related tags found
No related merge requests found
...@@ -151,24 +151,39 @@ class FEATFSFDesign(object): ...@@ -151,24 +151,39 @@ class FEATFSFDesign(object):
if len(self.__evs) != self.__numEVs: if len(self.__evs) != self.__numEVs:
raise FSFError('Number of EVs does not match design.mat') raise FSFError('Number of EVs does not match design.mat')
# Load the voxelwise images now,
# so they're ready to be used by
# the getDesign method.
for ev in self.__evs:
if not isinstance(ev, (VoxelwiseEV, VoxelwiseConfoundEV)):
continue
# The path to some voxelwise
# EVs may not be present -
# see the VoxelwisEV class.
if ev.filename is not None: ev.image = fslimage.Image(ev.filename)
else: ev.image = None
def getDesign(self, x, y, z): def getDesign(self, x, y, z):
"""Returns the design matrix for the specified voxel. """Returns the design matrix for the specified voxel. """
"""
# if no vox EVs, just design = np.array(self.__design)
# return the design
pass
for ev in self.__evs:
def getVoxelEVFile(self, idx): if not isinstance(ev, (VoxelwiseEV, VoxelwiseConfoundEV)):
return self.__evs[idx].filename continue
if ev.image is None:
def getVoxelConfoundFile(self, idx): log.warning('Voxel EV image missing '
return self.__evs[idx].filename 'for ev {}'.format(ev.index))
design[:, ev.index] = ev.image.data[x, y, z, :]
return design
class EV(object): class EV(object):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment