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

Started working on adding support for Melodic analyses. Just skeletons

and stubs so far.
parent 55622458
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ following functions are provided:
isFEATDir
getFEATDir
hasMelodicDir
loadDesign
loadContrasts
loadSettings
......@@ -30,6 +31,7 @@ The following functions return the names of various files of interest:
getDataFile
getResidualFile
getMelodicFile
getPEFile
getCOPEFile
getZStatFile
......@@ -104,6 +106,13 @@ def getFEATDir(path):
return None
def hasMelodicDir(featdir):
"""Returns ``True`` if the data for the given FEAT directory has had
MELODIC run on it, ``False`` otherwise.
"""
return op.exists(getMelodicFile(featdir))
def loadDesign(featdir):
"""Loads the design matrix from a FEAT directory.
......@@ -441,6 +450,13 @@ def getDataFile(featdir):
return glob.glob((op.join(featdir, 'filtered_func_data.*')))[0]
def getMelodicFile(featdir):
"""Returns the name of the file in the FEAT results which contains the
melodic components. This file can be loaded as a :class:`.MelodicImage`.
"""
return op.join(featdir, 'filtered_func_data.ica', 'melodic_IC.nii.gz')
def getResidualFile(featdir):
"""Returns the name of the file in the FEAT results which contains
the model fit residuals (typically called ``res4d.nii.gz``).
......
#!/usr/bin/env python
#
# melodicimage.py - An Image subclass which has some MELODIC-specific
# functionality.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""This module provides the :class:`MelodicImage` class, an :class:`.Image`
sub-class which encapsulates data from a MELODIC analysis.
"""
import image as fslimage
import melodicresults as melresults
class MelodicImage(fslimage.Image):
"""
"""
def __init__(self, path):
"""
"""
pass
#!/usr/bin/env python
#
# melodicresults.py - Utility functions for loading/querying the contents of a
# MELODIC analysis directory.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""This module provides a set of functions for accessing the contents of a
MELODIC analysis directory. These functions are primarily intended to be used
by the :class:`.MELODICImage` class, but are available for other uses. The
following functions are provided:
.. autosummary::
nosignatures:
isMELODICDir
getMELODICDir
getICFile
getNumComponents
getComponentTimeSeries
"""
def isMELODICDir(path):
"""
"""
# A MELODIC directory:
# - Must be called *.ica
# - Must contain melodic_IC.nii.gz
# - Must contain melodic_mix
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