Exemple #1
0
    def from_image(klass, fourdimage, volume_start_times=None, slice_times=None, axis="t"):
        """Create an FmriImageList from a 4D Image by
        extracting 3d images along the 't' axis.

        Parameters
        ----------
        fourdimage: a 4D Image
        volume_start_times: start time of each frame. It can be specified
                            either as an ndarray with len(images) elements
                            or as a single float, the TR. Defaults to
                            the diagonal entry of slowest moving dimension
                            of Affine transform
        slice_times: ndarray specifying offset for each slice of each frame

        """
        if fourdimage.ndim != 4:
            raise ValueError("expecting a 4-dimensional Image")
        image_list = ImageList.from_image(fourdimage, axis="t")
        return klass(images=image_list.list, volume_start_times=volume_start_times, slice_times=slice_times)