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

Warnings if voxel EV files do not exist. Voxel confound EVs are named

according to their original file path.
parent b1ad0825
No related branches found
No related tags found
No related merge requests found
...@@ -260,8 +260,11 @@ class VoxelwiseEV(NormalEV): ...@@ -260,8 +260,11 @@ class VoxelwiseEV(NormalEV):
""" """
NormalEV.__init__(self, realIdx, origIdx, title) NormalEV.__init__(self, realIdx, origIdx, title)
if op.exists(filename): self.filename = filename if op.exists(filename):
else: self.filename = None self.filename = filename
else:
log.warning('Voxelwise EV file does not exist: '.format(filename))
self.filename = None
class ConfoundEV(EV): class ConfoundEV(EV):
...@@ -337,8 +340,12 @@ class VoxelwiseConfoundEV(EV): ...@@ -337,8 +340,12 @@ class VoxelwiseConfoundEV(EV):
EV.__init__(self, index, title) EV.__init__(self, index, title)
self.voxIndex = voxIndex self.voxIndex = voxIndex
if op.exists(filename): self.filename = filename if op.exists(filename):
else: self.filename = None self.filename = filename
else:
log.warning('Voxelwise confound EV file '
'does not exist: '.format(filename))
self.filename = None
def getFirstLevelEVs(featDir, settings, designMat): def getFirstLevelEVs(featDir, settings, designMat):
...@@ -388,9 +395,8 @@ def getFirstLevelEVs(featDir, settings, designMat): ...@@ -388,9 +395,8 @@ def getFirstLevelEVs(featDir, settings, designMat):
# original EV index. # original EV index.
else: else:
# The addExt function will # The addExt function will raise an
# raise an error if the # error if the file does not exist.
# file does not exist.
filename = op.join( filename = op.join(
featDir, 'designVoxelwiseEV{}'.format(origIdx + 1)) featDir, 'designVoxelwiseEV{}'.format(origIdx + 1))
filename = fslimage.addExt(filename, True) filename = fslimage.addExt(filename, True)
...@@ -475,9 +481,12 @@ def getFirstLevelEVs(featDir, settings, designMat): ...@@ -475,9 +481,12 @@ def getFirstLevelEVs(featDir, settings, designMat):
raise FSFError('Unsupported voxelwise confound ordering ' raise FSFError('Unsupported voxelwise confound ordering '
'({} -> {})'.format(startIdx, voxConfLocs)) '({} -> {})'.format(startIdx, voxConfLocs))
# Create the voxelwise confound EVs # Create the voxelwise confound EVs.
# We make a name for the EV from the
# file name.
for i, (f, l) in enumerate(zip(voxConfFiles, voxConfLocs)): for i, (f, l) in enumerate(zip(voxConfFiles, voxConfLocs)):
evs.append(VoxelwiseConfoundEV(len(evs), i, 'voxconf', f)) title = op.basename(fslimage.removeExt(f))
evs.append(VoxelwiseConfoundEV(len(evs), i, title, f))
# Have motion parameters been added # Have motion parameters been added
# as regressors to the design matrix? # as regressors to the design matrix?
......
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