NIPY logo

Site Navigation

NIPY Community

Table Of Contents

This Page

core.image.image_list

Module: core.image.image_list

Inheritance diagram for nipy.core.image.image_list:

ImageList

class nipy.core.image.image_list.ImageList(images=None)

Bases: object

Class to contain ND image as list of (N-1)D images

Methods

from_image
next
__init__(images=None)

A lightweight implementation of a list of images.

Parameters :

images : iterable

a iterable and sliceale object whose items are meant to be images, this is checked by asserting that each has a coordmap attribute

>>> import numpy as np :

>>> from nipy.testing import funcfile :

>>> from nipy.core.api import Image, ImageList :

>>> from nipy.io.api import load_image :

>>> funcim = load_image(funcfile) :

>>> ilist = ImageList(funcim) :

>>> sublist = ilist[2:5] :

Slicing an ImageList returns a new ImageList :

>>> isinstance(sublist, ImageList) :

True :

Indexing an ImageList returns a new Image :

>>> newimg = ilist[2] :

>>> isinstance(newimg, Image) :

True :

>>> isinstance(newimg, ImageList) :

False :

>>> np.asarray(sublist).shape :

(3, 2, 20, 20) :

>>> np.asarray(newimg).shape :

(2, 20, 20) :

classmethod from_image(klass, image, axis=0)
next()