Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env python
#
# featimage.py - An Image subclass which has some FEAT-specific functionality.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""This module provides the :class:`FeatImage` class, a subclass of
:class:`.Image` designed for the ``filtered_func_data`` file of a FEAT
analysis.
"""
import os.path as op
import image as fslimage
def isFEATData(path):
keys = ['.feat{}filtered_func_data' .format(op.sep),
'.gfeat{}filtered_func_data'.format(op.sep)]
isfeat = any([k in path for k in keys])
return isfeat
class FEATImage(fslimage.Image):
def __init__(self, image, **kwargs):
fslimage.Image.__init__(self, image, **kwargs)
if not isFEATData(self.dataSource):
raise ValueError('{} does not appear to be data from a '
'FEAT analysis'.format(self.dataSource))
# A FEATImage is an Image which has
# some extra utility methods, something
# like all of the below things:
# def numParameterEstimates(self):
# return 0
# def numCOPEs(self):
# return 0
# def getParameterEstimate(self, num):
# pass
# def getFullModelFit(self):
# pass
# def getPartialModelFIt(self, contrast):
# pass
# def getCOPEs(self):
# pass
# def getZStats(self):
# pass
# def getThresholdedZStats(self):
# pass
# def getSomethingForClusters(self):
# pass
# # Return a copy of this image, transformed
# # to the specified spaced (e.g. MNI152,
# # structural, functional, etc)
# def getInSpace(self, space):
# pass