class_docstr: Class to implement image list interface for FMRI time series
  
  Allows metadata such as volume and slice times
docstr: An implementation of an fMRI image as in ImageList
  
  Parameters
  ----------
  images : iterable
     an iterable object whose items are meant to be images; this is
     checked by asserting that each has a `coordmap` attribute and a
     ``get_fdata`` method.  Note that Image objects are not iterable by
     default; use the ``from_image`` classmethod or ``iter_axis`` function
     to convert images to image lists - see examples below for the latter.
  volume_start_times: None or float or (N,) ndarray
      start time of each frame. It can be specified either as an ndarray
      with ``N=len(images)`` elements or as a single float, the TR. None
      results in ``np.arange(len(images)).astype(np.float64)``
  slice_times: None or (N,) ndarray
      specifying offset for each slice of each frame, from the frame start
      time.
  
  See Also
  --------
  nipy.core.image_list.ImageList
  
  Examples
  --------
  >>> from nipy.testing import funcfile
  >>> from nipy.io.api import load_image
  >>> from nipy.core.api import iter_axis
  >>> funcim = load_image(funcfile)
  >>> iterable_img = iter_axis(funcim, 't')
  >>> fmrilist = FmriImageList(iterable_img)
  >>> print(fmrilist.get_list_data(axis=0).shape)
  (20, 17, 21, 3)
  >>> print(fmrilist[4].shape)
  (17, 21, 3)
docstr_tok: ["An","implementation","of","an","fMRI","image","as","in","ImageList","Parameters","--","--","--","--","--","images",":","iterable","an","iterable","object","whose","items","are","meant","to","be","images",";","this","is","checked","by","asserting","that","each","has","a","`","coordmap","`","attribute","and","a","``","get_fdata","``","method",".","Note","that","Image","objects","are","not","iterable","by","default",";","use","the","``","from_image","``","classmethod","or","``","iter_axis","``","function","to","convert","images","to","image","lists","-","see","examples","below","for","the","latter",".","volume_start_times",":","None","or","float","or","(","N",",",")","ndarray","start","time","of","each","frame",".","It","can","be","specified","either","as","an","ndarray","with","``","N=len","(","images",")","``","elements","or","as","a","single","float",",","the","TR",".","None","results","in","``","np.arange","(","len","(","images",")",")",".astype","(","np.float64",")","``","slice_times",":","None","or","(","N",",",")","ndarray","specifying","offset","for","each","slice","of","each","frame",",","from","the","frame","start","time",".","See","Also","--","--","--","--","nipy.core.image_list.ImageList","Examples","--","--","--","--",">",">",">","from","nipy.testing","import","funcfile",">",">",">","from","nipy.io.api","import","load_image",">",">",">","from","nipy.core.api","import","iter_axis",">",">",">","funcim","=","load_image","(","funcfile",")",">",">",">","iterable_img","=","iter_axis","(","funcim",",","'t","'",")",">",">",">","fmrilist","=","FmriImageList","(","iterable_img",")",">",">",">","print","(","fmrilist.get_list_data","(","axis=0",")",".shape",")","(","20",",","17",",","21",",","3",")",">",">",">","print","(","fmrilist","[","4","]",".shape",")","(","17",",","21",",","3",")"]
code: def __init__(
      self, images=None, volume_start_times=None, slice_times=None
  ):
      """
      An implementation of an fMRI image as in ImageList
  
      Parameters
      ----------
      images : iterable
         an iterable object whose items are meant to be images; this is
         checked by asserting that each has a `coordmap` attribute and a
         ``get_fdata`` method.  Note that Image objects are not iterable by
         default; use the ``from_image`` classmethod or ``iter_axis`` function
         to convert images to image lists - see examples below for the latter.
      volume_start_times: None or float or (N,) ndarray
          start time of each frame. It can be specified either as an ndarray
          with ``N=len(images)`` elements or as a single float, the TR. None
          results in ``np.arange(len(images)).astype(np.float64)``
      slice_times: None or (N,) ndarray
          specifying offset for each slice of each frame, from the frame start
          time.
  
      See Also
      --------
      nipy.core.image_list.ImageList
  
      Examples
      --------
      >>> from nipy.testing import funcfile
      >>> from nipy.io.api import load_image
      >>> from nipy.core.api import iter_axis
      >>> funcim = load_image(funcfile)
      >>> iterable_img = iter_axis(funcim, 't')
      >>> fmrilist = FmriImageList(iterable_img)
      >>> print(fmrilist.get_list_data(axis=0).shape)
      (20, 17, 21, 3)
      >>> print(fmrilist[4].shape)
      (17, 21, 3)
      """
      ImageList.__init__(self, images=images)
      if volume_start_times is None:
          volume_start_times = 1.0
      v = np.asarray(volume_start_times)
      length = len(self.list)
      if v.shape == (length,):
          self.volume_start_times = volume_start_times
      else:
          v = float(volume_start_times)
          self.volume_start_times = np.arange(length) * v
      self.slice_times = slice_times
  
file_path: nipy/nipy/modalities/fmri/fmri.py
imports: import numpy
  from ...core.api import ImageList
label_desc: Use image node_id 1 to create a new FmriImageList object from inherited base classes: ImageList with example: obj = FmriImageList(images, volume_start_times, slice_times)