fsl.data.featimage¶
This module provides the FEATImage class, a subclass of
Image designed to encapsulate data from a FEAT analysis.
This module also provides the modelFit() function.
-
class
fsl.data.featimage.FEATImage(*args, **kwargs)[source]¶ Bases:
fsl.data.image.ImageAn
Imagewhich contains the input data from a FEAT analysis.The
FEATImageclass makes use of the functions defined in thefeatanalysismodule.An example of using the
FEATImageclass:import fsl.data.featimage as featimage # You can pass in the name of the # .feat directory, or the filtered_func_data # file contained within that directory. img = featimage.FEATImage('myanalysis.feat/filtered_func_data.nii.gz') # Query information about the FEAT analysis print(img.numEVs()) print(img.contrastNames()) print(img.numPoints()) # Get the model fit residuals res4d = img.getResiduals() # Get the full model fit for voxel # [23, 30, 42] (in this example, we # have 4 EVs - the first argument # is a contrast vector). img.fit([1, 1, 1, 1], [23, 30, 42], fullModel=True)
-
__init__(path, **kwargs)[source]¶ Create a
FEATImageinstance.- Parameters
path – A FEAT analysis directory, or the input data image file contained within such a directory.
kwargs – Passed to the
Imageconstructor.
-
getAnalysisName()[source]¶ Returns the FEAT analysis name, which is the FEAT directory name, minus the
.feat/.gfeatsuffix.
-
isFirstLevelAnalysis()[source]¶ Returns
Trueif the FEAT analysis described bysettingsis a first level analysis,Falseotherwise.
-
getTopLevelAnalysisDir()[source]¶ Returns the path to the higher level analysis directory of which this FEAT analysis is a part, or
Noneif this analysis is not part of another analysis.
-
getReportFile()[source]¶ Returns the path to the FEAT report - see
featanalysis.getReportFile().
-
hasStats()[source]¶ Returns
Trueif the analysis for thisFEATImagecontains a statistical analysis.
-
getDesign(voxel=None)[source]¶ Returns the analysis design matrix as a
numpyarray with shape \(numPoints\times numEVs\). SeeFEATFSFDesign.getDesign().
-
numPoints()[source]¶ Returns the number of points (e.g. time points, number of subjects, etc) in the analysis.
-
clusterResults(contrast)[source]¶ Returns the clusters found in the analysis.
See :func:.featanalysis.loadClusterResults`
-
fit(contrast, xyz)[source]¶ Calculates the model fit for the given contrast vector at the given voxel. See the
modelFit()function.- Parameters
contrast – The contrast vector (pass all 1s for a full model fit).
xyz – Coordinates of the voxel to calculate the model fit for.
-
partialFit(contrast, xyz)[source]¶ Calculates and returns the partial model fit for the specified contrast vector at the specified voxel.
See
fit()for details on the arguments.
-
__module__= 'fsl.data.featimage'¶
-
-
fsl.data.featimage.modelFit(data, design, contrast, pes, firstLevel=True)[source]¶ Calculates the model fit to the given data for the given contrast vector.
- Parameters
data – The input data
design – The design matrix
contrast – The contrast vector (pass all 1s for a full model fit)
pes – Parameter estimates for each EV in the design matrix
firstLevel – If
True(the default), the mean of the input data is added to the result.
- Returns
The best fit of the model to the data.