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

Doing away with the cluster results type conversion - I don't see how

having everything floating point would be a problem. Also fixed little
bug in FeatTimeSeries - overlay was being set to None.
parent 215aaa77
No related branches found
No related tags found
No related merge requests found
......@@ -365,43 +365,42 @@ def loadClusterResults(featdir, settings, contrast):
def __init__(self, **kwargs):
for name, val in kwargs.items():
attrName, atype = colmap[name]
attrName = colmap[name]
if val is not None:
val = atype(val)
val = float(val)
setattr(self, attrName, val)
# This dict provides a mapping between
# Cluster object attribute names, and
# the corresponding column name in the
# cluster.txt file. And the value type
# is thrown in as well, for good measure.
# cluster.txt file.
colmap = {
'Cluster Index' : ('index', int),
'Voxels' : ('nvoxels', int),
'P' : ('p', float),
'-log10(P)' : ('logp', float),
'Z-MAX' : ('zmax', float),
'Z-MAX X (vox)' : ('zmaxx', int),
'Z-MAX Y (vox)' : ('zmaxy', int),
'Z-MAX Z (vox)' : ('zmaxz', int),
'Z-COG X (vox)' : ('zcogx', int),
'Z-COG Y (vox)' : ('zcogy', int),
'Z-COG Z (vox)' : ('zcogz', int),
'Z-MAX X (mm)' : ('zmaxx', float),
'Z-MAX Y (mm)' : ('zmaxy', float),
'Z-MAX Z (mm)' : ('zmaxz', float),
'Z-COG X (mm)' : ('zcogx', float),
'Z-COG Y (mm)' : ('zcogy', float),
'Z-COG Z (mm)' : ('zcogz', float),
'COPE-MAX' : ('copemax', float),
'COPE-MAX X (vox)' : ('copemaxx', int),
'COPE-MAX Y (vox)' : ('copemaxy', int),
'COPE-MAX Z (vox)' : ('copemaxz', int),
'COPE-MAX X (mm)' : ('copemaxx', float),
'COPE-MAX Y (mm)' : ('copemaxy', float),
'COPE-MAX Z (mm)' : ('copemaxz', float),
'COPE-MEAN' : ('copemean', float)}
'Cluster Index' : 'index',
'Voxels' : 'nvoxels',
'P' : 'p',
'-log10(P)' : 'logp',
'Z-MAX' : 'zmax',
'Z-MAX X (vox)' : 'zmaxx',
'Z-MAX Y (vox)' : 'zmaxy',
'Z-MAX Z (vox)' : 'zmaxz',
'Z-COG X (vox)' : 'zcogx',
'Z-COG Y (vox)' : 'zcogy',
'Z-COG Z (vox)' : 'zcogz',
'Z-MAX X (mm)' : 'zmaxx',
'Z-MAX Y (mm)' : 'zmaxy',
'Z-MAX Z (mm)' : 'zmaxz',
'Z-COG X (mm)' : 'zcogx',
'Z-COG Y (mm)' : 'zcogy',
'Z-COG Z (mm)' : 'zcogz',
'COPE-MAX' : 'copemax',
'COPE-MAX X (vox)' : 'copemaxx',
'COPE-MAX Y (vox)' : 'copemaxy',
'COPE-MAX Z (vox)' : 'copemaxz',
'COPE-MAX X (mm)' : 'copemaxx',
'COPE-MAX Y (mm)' : 'copemaxy',
'COPE-MAX Z (mm)' : 'copemaxz',
'COPE-MEAN' : 'copemean'}
# An error will be raised if the
# cluster file does not exist (e.g.
......
......@@ -275,13 +275,13 @@ class TimeSeriesPanel(plotpanel.OverlayPlotPanel):
# If this is an image in a FEAT directory, but the
# filtered_func_data for that FEAT directory has
# not been loaded, we show nothing.
if not isinstance(overlay, fslfeatimage.FEATImage) and \
featImage is None:
return None, None, None
if not isinstance(overlay, fslfeatimage.FEATImage):
if featImage is None: return None, None, None
else: overlay = featImage
# If the filtered_func for this FEAT analysis
# has been loaded, we show its time series.
overlay = featImage
ts = plotting.FEATTimeSeries(self,
overlay,
self._displayCtx)
......
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