fsl.utils.image.roi

This module provides the roi() function, which can be used to extract a region-of-interest from, or expand the field-of-view of, an Image.

fsl.utils.image.roi.roi(image, bounds)[source]

Extract an ROI from the given image according to the given bounds.

This function can also be used to pad, or expand the field-of-view, of an image, by passing in negative low bound values, or high bound values which are larger than the image shape. The padded region will contain zeroes.

Parameters
  • imageImage object

  • bounds – Must be a sequence of tuples, containing the low/high bounds for each voxel dimension, where the low bound is inclusive, and the high bound is exclusive. For 4D images, the bounds for the fourth dimension are optional.

Returns

A new Image object containing the region specified by the bounds.