Warning: This document is for an old version of niworkflows. The main version is master.

niworkflows.interfaces.images module

Image tools interfaces.

class niworkflows.interfaces.images.Conform(from_file=None, resource_monitor=None, **inputs)[source]

Bases: nipype.interfaces.base.core.SimpleInterface

Conform a series of T1w images to enable merging.

Performs two basic functions:

  1. Orient to RAS (left-right, posterior-anterior, inferior-superior)

  2. Resample to target zooms (voxel sizes) and shape (number of voxels)

Note that the output transforms are voxel-to-voxel; the RAS-to-RAS transform is the identity transform.

input_spec

alias of niworkflows.interfaces.images._ConformInputSpec

output_spec

alias of niworkflows.interfaces.images._ConformOutputSpec

class niworkflows.interfaces.images.IntraModalMerge(from_file=None, resource_monitor=None, **inputs)[source]

Bases: nipype.interfaces.base.core.SimpleInterface

Calculate an average of the inputs.

If the input is 3D, returns the original image. Otherwise, splits the images and merges them after head-motion correction with FSL mcflirt.

input_spec

alias of niworkflows.interfaces.images._IntraModalMergeInputSpec

output_spec

alias of niworkflows.interfaces.images._IntraModalMergeOutputSpec

class niworkflows.interfaces.images.RegridToZooms(from_file=None, resource_monitor=None, **inputs)[source]

Bases: nipype.interfaces.base.core.SimpleInterface

Change the resolution of an image (regrid).

input_spec

alias of niworkflows.interfaces.images._RegridToZoomsInputSpec

output_spec

alias of niworkflows.interfaces.images._RegridToZoomsOutputSpec

class niworkflows.interfaces.images.RobustAverage(from_file=None, resource_monitor=None, **inputs)[source]

Bases: nipype.interfaces.base.core.SimpleInterface

Robustly estimate an average of the input.

input_spec

alias of niworkflows.interfaces.images._RobustAverageInputSpec

output_spec

alias of niworkflows.interfaces.images._RobustAverageOutputSpec

class niworkflows.interfaces.images.SignalExtraction(from_file=None, resource_monitor=None, **inputs)[source]

Bases: nipype.interfaces.base.core.SimpleInterface

Extract mean signals from a time series within a set of ROIs.

This interface is intended to be a memory-efficient alternative to nipype.interfaces.nilearn.SignalExtraction. Not all features of nilearn.SignalExtraction are implemented at this time.

input_spec

alias of niworkflows.interfaces.images._SignalExtractionInputSpec

output_spec

alias of niworkflows.interfaces.images._SignalExtractionOutputSpec

class niworkflows.interfaces.images.TemplateDimensions(from_file=None, resource_monitor=None, **inputs)[source]

Bases: nipype.interfaces.base.core.SimpleInterface

Finds template target dimensions for a series of T1w images, filtering low-resolution images, if necessary.

Along each axis, the minimum voxel size (zoom) and the maximum number of voxels (shape) are found across images.

The max_scale parameter sets a bound on the degree of up-sampling performed. By default, an image with a voxel size greater than 3x the smallest voxel size (calculated separately for each dimension) will be discarded.

To select images that require no scaling (i.e. all have smallest voxel sizes), set max_scale=1.

input_spec

alias of niworkflows.interfaces.images._TemplateDimensionsInputSpec

output_spec

alias of niworkflows.interfaces.images._TemplateDimensionsOutputSpec

niworkflows.interfaces.images.normalize_xform(img)[source]

Set identical, valid qform and sform matrices in an image.

Selects the best available affine (sform > qform > shape-based), and coerces it to be qform-compatible (no shears).

The resulting image represents this same affine as both qform and sform, and is marked as NIFTI_XFORM_ALIGNED_ANAT, indicating that it is valid, not aligned to template, and not necessarily preserving the original coordinates.

If header would be unchanged, returns input image.

niworkflows.interfaces.images.reorient(in_file, newpath=None)[source]

Reorient Nifti files to RAS.