NIPY logo

Site Navigation

NIPY Community

Table Of Contents

This Page

core.image.roi

Module: core.image.roi

Inheritance diagram for nipy.core.image.roi:

Template region of interest (ROI) module

Classes

ContinuousROI

class nipy.core.image.roi.ContinuousROI(coordinate_system, bfn, args=None, ndim=3)

Bases: nipy.core.image.roi.ROI

Create an ROI with a binary function in a given coordinate system.

Methods

tocoordmap
todiscrete
__init__(coordinate_system, bfn, args=None, ndim=3)
Parameters :
coordinate_system : TODO

TODO

bfn : TODO

TODO

args : TODO

TODO

ndim : int

TODO

tocoordmap(coordmap)

Return a CoordinateMapROI instance at the voxels in the ROI.

Parameters :
coordmap : TODO

TODO

Returns :

CoordinateMapROI

todiscrete(voxels)

Return a DiscreteROI instance at the voxels in the ROI.

Parameters :
voxels : TODO

TODO

Returns :

DiscreteROI

CoordinateMapROI

class nipy.core.image.roi.CoordinateMapROI(coordinate_system, voxels, coordmap)

Bases: nipy.core.image.roi.DiscreteROI

Methods

feature
mask
next
pool
__init__(coordinate_system, voxels, coordmap)
Parameters :
coordinate_system : TODO

TODO

voxels : TODO

TODO

coordmap : TODO

TODO

feature(fn, **extra)

Return a feature of an image within the ROI. Feature args are ‘args’, while extra are for the readall method. Default is to reduce a ufunc over the ROI. Any other operations should be able to ignore superfluous keywords arguments, i.e. use extra.

Parameters :
fn : TODO

TODO

extra : ``dict

TODO

Returns :

DiscreteROI

Raises ValueError:
 

TODO

Raises NotImplementedError:
 

TODO

mask()
Returns :``numpy.ndarray`
next()
Returns :TODO
pool(image)

Pool data from an image over the ROI – return fn evaluated at each voxel.

Parameters :
image : image.Image

TODO

Returns :

TODO

Raises ValueError:
 

TODO

DiscreteROI

class nipy.core.image.roi.DiscreteROI(coordinate_system, voxels)

Bases: nipy.core.image.roi.ROI

TODO

Methods

feature
next
pool
__init__(coordinate_system, voxels)
Parameters :
coordinate_system : TODO

TODO

voxels : TODO

TODO

feature(fn, **extra)

Return a feature of an image within the ROI. Feature args are ‘args’, while extra are for the readall method. Default is to reduce a ufunc over the ROI. Any other operations should be able to ignore superfluous keywords arguments, i.e. use extra.

Parameters :
fn : TODO

TODO

extra : ``dict

TODO

Returns :

DiscreteROI

Raises ValueError:
 

TODO

Raises NotImplementedError:
 

TODO

next()
Returns :TODO
pool(fn, **extra)

Pool data from an image over the ROI – return fn evaluated at each voxel.

Parameters :
fn : TODO

TODO

extras : dict

TODO

Returns :

TODO

ROI

class nipy.core.image.roi.ROI(coordinate_system)

Bases: object

This is the basic ROI class, which we model as basically a function defined on Euclidean space, i.e. R^3. For practical purposes, this function is evaluated on the range of a Mapping instance.

__init__(coordinate_system)
Parameters :
coordinate_system : TODO

TODO

ROISequence

class nipy.core.image.roi.ROISequence

Bases: list

TODO

Methods

append
count
extend
index
insert
pop
remove
reverse
sort
__init__()

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

append

L.append(object) – append object to end

count

L.count(value) -> integer – return number of occurrences of value

extend

L.extend(iterable) – extend list by appending elements from the iterable

index

L.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.

insert

L.insert(index, object) – insert object before index

pop

L.pop([index]) -> item – remove and return item at index (default last). Raises IndexError if list is empty or index is out of range.

remove

L.remove(value) – remove first occurrence of value. Raises ValueError if the value is not present.

reverse

L.reverse() – reverse IN PLACE

sort

L.sort(cmp=None, key=None, reverse=False) – stable sort IN PLACE; cmp(x, y) -> -1, 0, 1

ROIall

class nipy.core.image.roi.ROIall(coordinate_system, voxels, coordmap)

Bases: nipy.core.image.roi.CoordinateMapROI

An ROI for an entire coordmap. Save time by avoiding compressing, etc.

Methods

feature
mask
next
pool
__init__(coordinate_system, voxels, coordmap)
Parameters :
coordinate_system : TODO

TODO

voxels : TODO

TODO

coordmap : TODO

TODO

feature(fn, **extra)

Return a feature of an image within the ROI. Feature args are ‘args’, while extra are for the readall method. Default is to reduce a ufunc over the ROI. Any other operations should be able to ignore superfluous keywords arguments, i.e. use extra.

Parameters :
fn : TODO

TODO

extra : ``dict

TODO

Returns :

DiscreteROI

Raises ValueError:
 

TODO

Raises NotImplementedError:
 

TODO

mask(image)
Parameters :
image : TODO

TODO

Return :

``numpy.ndarray`

next()
Returns :TODO
pool(image)
Parameters :image : image.Image
Returns :None

Functions

nipy.core.image.roi.roi_ellipse_fn(center, form, a=1.0)

Ellipse determined by regions where a quadratic form is <= a. The quadratic form is given by the inverse of the ‘form’ argument, so a sphere of radius 10 can be specified as {‘form’:10**2 * identity(3), ‘a’:1} or {‘form’:identity(3), ‘a’:100}.

Form must be positive definite.

Parameters :
form : TODO

TODO

a : float

TODO

Returns :

TODO

nipy.core.image.roi.roi_from_array_sampling_coordmap(data, coordmap)

Return a CoordinateMapROI from an array (data) on a coordmap. interpolation. Obvious ways to extend this.

Parameters :
data : TODO

TODO

coordmap : TODO

TODO

Returns :

CoordinateMapROI

nipy.core.image.roi.roi_sphere_fn(center, radius)
Parameters :
center : TODO

TODO

radius : TODO

TODO

Returns :

TODO