Inheritance diagram for nipy.algorithms.registration.groupwise_registration:
Motion correction / motion correction with slice timing
Routines implementing motion correction and motion correction combined with slice-timing.
See:
Roche, Alexis (2011) A four-dimensional registration algorithm with application to joint correction of motion and slice timing in fMRI. Medical Imaging, IEEE Transactions on; 30:1546–1554
Bases: nipy.algorithms.registration.groupwise_registration.Realign4d
Methods
estimate([loops, between_loops, align_runs, ...]) | |
resample([r, align_runs]) | Return the resampled run number r as a 4d nipy-like image. |
Spatiotemporal realignment class for fMRI series. This class is similar to Realign4d but provides a more flexible API for initialization in order to make it easier to declare slice acquisition times for standard sequences.
Warning: this class is deprecated; please use SpaceTimeRealign instead.
Parameters: | images : image or list of images
slice_order : str or array-like
tr : float
tr_slices : float
start : float
time_interp: bool :
interleaved : bool
slice_times : None, str or array-like
slice_info : None or tuple, optional
|
---|
Return the resampled run number r as a 4d nipy-like image. Returns all runs as a list of images if r == None.
Bases: object
Class to represent a sequence of 3d scans (possibly acquired on a slice-by-slice basis).
Object remains empty until the data array is actually loaded in memory.
Parameters: | data : nd array or proxy (function that actually gets the array) |
---|
Methods
free_data() | |
get_data() | |
get_shape() | |
scanner_time(zv, t) | tv = scanner_time(zv, t) |
z_to_slice(z) | Account for the fact that slices may be stored in reverse |
Configure fMRI acquisition time parameters.
tv = scanner_time(zv, t) zv, tv are grid coordinates; t is an actual time value.
Account for the fact that slices may be stored in reverse order wrt the scanner coordinate system convention (slice 0 == bottom of the head)
Bases: object
Methods
estimate([loops, between_loops, align_runs, ...]) | |
resample([r, align_runs]) | Return the resampled run number r as a 4d nipy-like image. |
Spatiotemporal realignment class for series of 3D images.
The algorithm performs simultaneous motion and slice timing correction for fMRI series or other data where slices are not acquired simultaneously.
Parameters: | images : image or list of images
tr : float
slice_times : None or array-like
slice_info : None or tuple, optional
|
---|
Return the resampled run number r as a 4d nipy-like image. Returns all runs as a list of images if r == None.
Bases: object
Methods
align_to_refscan() | The motion_estimate method aligns scans with an online template so that spatial transforms map some average head space to the scanner space. |
estimate_instant_motion(t) | Estimate motion parameters at a particular time. |
estimate_motion() | Optimize motion parameters for the whole sequence. |
init_instant_motion(t) | Pre-compute and cache some constants (at fixed time) for repeated computations of the alignment energy. |
resample(t) | Resample a particular time frame on the (sub-sampled) working grid. |
resample_full_data() | |
set_fmin(optimizer, stepsize, **kwargs) | Return the minimization function |
set_transform(t, pc) |
The motion_estimate method aligns scans with an online template so that spatial transforms map some average head space to the scanner space. To conventionally redefine the head space as being aligned with some reference scan, we need to right compose each head_average-to-scanner transform with the refscan’s ‘to head_average’ transform.
Estimate motion parameters at a particular time.
Optimize motion parameters for the whole sequence. All the time frames are initially resampled according to the current space/time transformation, the parameters of which are further optimized sequentially.
Pre-compute and cache some constants (at fixed time) for repeated computations of the alignment energy.
The idea is to decompose the average temporal variance via:
V = (n-1)/n V* + (n-1)/n^2 (x-m*)^2
with x the considered volume at time t, and m* the mean of all resampled volumes but x. Only the second term is variable when
one volumes while the others are fixed. A similar decomposition is used for the global variance, so we end up with:
V/V0 = [nV* + (x-m*)^2] / [nV0* + (x-m0*)^2]
Resample a particular time frame on the (sub-sampled) working grid.
x,y,z,t are “head” grid coordinates X,Y,Z,T are “scanner” grid coordinates
Return the minimization function
Bases: nipy.algorithms.registration.groupwise_registration.Realign4d
Methods
estimate([loops, between_loops, align_runs, ...]) | |
resample([r, align_runs]) | Return the resampled run number r as a 4d nipy-like image. |
Spatial registration of time series with no time interpolation
Parameters: | images : image or list of images
affine_class : Affine class, optional
|
---|
Return the resampled run number r as a 4d nipy-like image. Returns all runs as a list of images if r == None.
Bases: nipy.algorithms.registration.groupwise_registration.Realign4d
Methods
estimate([loops, between_loops, align_runs, ...]) | |
resample([r, align_runs]) | Return the resampled run number r as a 4d nipy-like image. |
Spatiotemporal realignment class for fMRI series.
This class gives a high-level interface to Realign4d
Parameters: | images : image or list of images
tr : float
slice_times : str or callable or array-like
slice_info : int or length 2 sequence
affine_class : Affine class, optional
|
---|
Return the resampled run number r as a 4d nipy-like image. Returns all runs as a list of images if r == None.
Parameters: | runs : list of Image4d objects |
---|---|
Returns: | transforms : list
transforms map an ‘ideal’ 4d grid (conventionally aligned with the : first scan of the first run) to the ‘acquisition’ 4d grid for each : run : |
Resample a 4D image according to the specified sequence of spatial transforms, using either 4D interpolation if time_interp is True and 3D interpolation otherwise.
Realign a single run in space and time.
Parameters: | im4d : Image4d instance speedup : int or sequence
|
---|