| | |
- ArgHandler
- Argument
- Function
-
- CompositeFunction
- ManifoldFile
- Matrix
- SectionProxy
- Splodge
- dManifold
- dManifoldIterator
- dSection
- dSectionIterator
- dSectionPointer
- doublePoint
- intPoint
class Argument |
| |
|
| |
Methods defined here:
- __del__(...)
- __init__(self, *args)
Data and non-method functions defined here:
- __doc__ = None
- __module__ = 'RUMBA'
|
class Matrix |
| |
The matrix class facilitates performing matrix math on fMRI data. A Matrix
is actually a thin wrapper (adaptor) about a dManifold. Like dManifold,
Matrix supports 2d container operations
copy()
Returns: Matrix
Description: returns a deep copy
size()
Returns: int
Description: returns number of items in container
begin()
Returns: dManifoldIterator
Description: returns an iterator to the start of the
container
end()
Returns: dManifoldIterator
Description: returns an iterator that is "one off the
end" of the container.
__getitem__(int offset)
Usage: M[offset]
Returns: float
Description: One dimensional indexing for container
traversal
__getitem__((int space, int time))
Usage: M[row,column]
Returns: float
Description: Access rows and columns
__getitem__((Ellipsis, int y))
Usage: M[...,y]
Returns: dSection
Description: Returns the y_th column
__getitem__((int x, Ellipsis))
Usage: M[x,...]
Returns: dSection
Description: Returns the x_th row
__getitem__((int x,slice))
Usage: M[x,i:j]
Returns: dManifold
Description: Return a copy of the subsection [i,j) of
the x_th column
__getitem__((Ellipsis, slice))
Usage: M[...,i:j]
Returns: type(M)
Description: Return the sub matrix corresponding to
columns i to j-1
__setitem__((int offset, double val))
Usage: M[offset] = val
Returns: None
Description: Sequential write access
__setitem__((int row, int column, double val))
Usage: M[row,column] = val
Returns: None
Description: Write access
In addition to the 2d container interface, Matrix supports
the following constructors:
Matrix(string)
Load Matrix from a file
Matrix(int rows,int cols)
Create a matrix with a given number of rows and columns
The following additional members are supported:
int rows()
Returns: int
Description: number of rows
cols()
Returns: int
Description: number of columnes
toManifold()
Returns: dManifold
Description: returns underlying dManifold
__getitem__((slice,int))
Usage: M[i:j,x]
Returns: Matrix
Description: Returns column matrix consisting of rows i...j-1 at column x
__getitem__((slice,Ellipsis))
Usage: M[i:j,...]
Returns: Matrix
Description: Returns j-i x M.cols() matrix consisting of rows i...j-1
Matrix also supports the following arithmatic:
__add__(Matrix N)
Usage: M + N
Returns: Matrix
__iadd__(Matrix N)
Usage: M += N
Returns: Matrix
__sub__(Matrix N)
Usage: M-N
Returns: Matrix
__isub__(Matrix N)
Usage: M -= N
Returns: Matrix
__mul__(Matrix N)
Usage: M*N
Returns: Matrix
__mul__(float x)
Usage: M*x
Returns: Matrix
__rmul__(float x)
Usage: x*M
Returns: Matrix
__imul__(float x)
Usage: M*=x
Returns: Matrix |
| |
Methods defined here:
- __add__(...)
- __del__(...)
- __getitem__(...)
- __iadd__(...)
- __imul__(...)
- __init__(self, *args)
- __isub__(...)
- __mul__(...)
- __rmul__(...)
- __setitem__(...)
- __str__(...)
- __sub__(...)
Data and non-method functions defined here:
- __doc__ = '\n\nThe matrix class facilitates performing mat...oat x)\n\tUsage: M*=x\n\tReturns: Matrix\n\n\n\n'
- __module__ = 'RUMBA'
|
class dManifold |
| |
dManifold is a class used to represent neuro-imaging data.
It also facilitates the loading and saving of data in many
different formats. The main content of the class is a 4
dimensional data set.
There are three ways that one mat to access the points
of a dManifold: the more intuitive way is to use (x,y,z,t)
coordinates. Another viewpoint is that each point has
an index corresponding to an ordering on the points --
that is, you can view it as a 1 dimensional array. This is
convenient for writing loops that traverse the data set.
Finally, one can use (space,time) coordinates. This is
useful for writing functions that need to iterate over
time series.
The Manifold class also facilitates sub Manifold extraction/drop-in.
This discussion would not be complete without a description
of the loading and saving which is useful in itself. These
operations facilitate loading and saving files from
different formats. The load constructor and save method decide
appropriate formats from the filename given.
Interface:
The dManifold class implements the following 2 dimensional
container interface. This interface is also implemented by
the Matrix class. The main difference is that the 2
dimensional coordinates refer to space and time in the
context of dManifold objects, and rows/columns in the
context of matrices.
copy()
Returns: dManifold
Description: returns a deep copy
size()
Returns: int
Description: returns number of items in container
begin()
Returns: dManifoldIterator
Description: returns an iterator to the start of the
container
end()
Returns: dManifoldIterator
Description: returns an iterator that is "one off the
end" of the container.
__getitem__(int offset)
Usage: M[offset]
Returns: float
Description: One dimensional indexing for container
traversal
__getitem__((int space, int time))
Usage: M[space,time]
Returns: float
Description: Access data in space/time coordinates
__getitem__((Ellipsis, int y))
Usage: M[...,y]
Returns: dSection
Description: Returns the y_th spatial volume.
__getitem__((int x, Ellipsis))
Usage: M[x,...]
Returns: dSection
Description: Returns the x_th time series
__getitem__((int x,slice))
Usage: M[x,i:j]
Returns: dManifold
Description: Return a copy of the subsection [i,j) of
the x_th time series.
__getitem__((Ellipsis, slice))
Usage: M[...,i:j]
Returns: type(M)
Description: Return the subset of points for which
i <= t < j
__setitem__((int offset, double val))
Usage: M[offset] = val
Returns: None
Description: Sequential write access
__setitem__((int space, int time, double val))
Usage: M[space,time] = val
Returns: None
Description: Write access in terms of space,time
coordinates
Construction: The following consructors are supported:
dManifold(int x,int y,int z,int t)
Description: Construct a dManifold with dimensions x*y*z*t,
where x,y and z are spatial dimensions, and t is the
temporal extent
dManifold(intPoint)
Description: Convenience function. Same as above.
dManifold(string)
Description: Load a data set from a file. The string is the
filename. If the data contains a header and an image file,
the name of either file will suffice.
Member functions for dealing with 4 dimensional data:
The class supports a number of methods for accessing
information about the 4 dimensional data structure.
width():
Returns: int
Description: Returns width
height()
Returns: int
Description: Returns height
depth()
Returns: int
Returns depth
timepoints()
Returns: int
Returns number of timepoints.
pixels()
Returns total number of spatial locations. Same as
M.width()*M.height()*M.depth()
extent()
Returns an intPoint containing space-time dimensions.
__getitem__((int x, int y, int z, int t))
Returns: float
Usage: M[x,y,z,t]
__setitem__((int x, int y, int z, int t, double val))
Returns: None
Usage: M[x,y,z,t] = val
__getitem__(a0,a1,a2,a3)
where a0,a1,a2,a3 are either ... , int, or int:int
Returns: dManifold
Usage:
M[...,1,2,2:3]
M[1,1,2,2:3]
Description: Allows convenient selection of subsets of
data. One can specify a range [i,j) with the notation
i:j, or all data points in a given dimension with the
notation "..."
For example,
M[... , 2, 3:6, 2]
returns the subset of points for which y=2, 3<=z<6, t=2.
The resulting data set is size M.width()*2*3*1
Accessing Headers:
getHeader(string name)
Returns: Splodge
Description: Gets header with name.
headerData()
Returns: dictionary whose keys are strings, values are
Splodges.
Saving to disk:
save(string filename)
Returns: None
Description: Saves data to filename.
Realignment:
Matrix matchRigid(dManifold standard, dManifold reslice, dManifold mask, int timebudget= 10 );
Matrix matchRigid(dManifold standard, dManifold reslice, int timebudget = 10 );
Matrix matchAffine(dManifold standard, dManifold reslice, dManifold mask, int timebudget= 10 );
Matrix matchAffine(dManifold standard, dManifold reslice, int timebudget = 10 );
Matrix matchMaskAffine(dManifold standard, dManifold reslice, dManifold mask, int timebudget= 10 );
Matrix matchMaskAffine(dManifold standard, dManifold reslice, int timebudget = 10 );
Matrix matchRatioAffine(dManifold standard, dManifold reslice, dManifold mask, int =256, int = 10);
Matrix matchRatioAffine(dManifold standard, dManifold reslice, int partitions=256, int timebudget= 10);
Matrix matchRatioAffine(Matrix start_params,dManifold standard, dManifold reslice, dManifold mask, int partitions=256, int timebudget= 10);
Matrix matchRatioAffine(Matrix start_params,dManifold standard, dManifold reslice, int partitions=256, int timebudget= 10);
Matrix matchPolynomial ( dManifold standard,dManifold reslice, dManifold mask, int degree, int timebudget= 10);
Matrix matchPolynomial ( dManifold standard,dManifold reslice, int degree, int timebudget= 10);
Compute parameters for realigning too data sets.
matchRigid: use 6 parameter rigid body least squares model
matchAffine: use 12 parameter affine least squares model
matchPolynomial: use polynomial least squares model (30-168 parameters)
matchRatioAffine: use 12 parameter model with AIR-like cost function.
standard: reference data set
reslice: data set to be resliced
timebudget: units for computing. Each unit of timebudget corresponds to one
complete scan of the data set. Since the data set is subsampled, a timebudget
of 1 still allows many iterations of the algorithm.
mask: spatial mask of pixels to ignore.
degree: polynomial degree.
partitions: number of partitions to segment data into.
Reslicing:
enum InterpolationType { Trilinear = 0 };
dManifold resliceRigid
(Matrix params, dManifold data, InterpolationType type, intPoint outextent, doublePoint outdims );
dManifold resliceAffine
(Matrix params, dManifold data, InterpolationType type, intPoint outextent, doublePoint outdims );
dManifold reslicePolynomial
(Matrix params , dManifold data, InterpolationType type, intPoint outextent, doublePoint outdims );
dManifold resliceRigid
(Matrix params , dManifold data , InterpolationType type);
dManifold resliceAffine
(Matrix params , dManifold data , InterpolationType type);
dManifold reslicePolynomial
(Matrix params , dManifold data , InterpolationType type);
Utility functions:
double maximum(dManifold);
returns the maximum value in the data set
minimum(dManifold);
returns the minimum value in the data set
normalize(double lower, double upper, dManifold data);
range-normalizes dataset. |
| |
Methods defined here:
- __del__(...)
- __getitem__(...)
- __init__(self, *args)
- __setitem__(...)
- __str__(...)
Data and non-method functions defined here:
- __doc__ = '\ndManifold is a class used to represent neuro-...Manifold data);\n\nrange-normalizes dataset.\n\n'
- __module__ = 'RUMBA'
|
|