qsiprep.interfaces.eddy module

Prepare files for TOPUP and eddy

class qsiprep.interfaces.eddy.Eddy2SPMMotion(from_file=None, resource_monitor=None, **inputs)[source]

Bases: SimpleInterface

Optional Inputs:

eddy_motion (a pathlike object or string representing an existing file)

Outputs:

spm_motion_file (a pathlike object or string representing an existing file)

class qsiprep.interfaces.eddy.ExtendedEddy(**inputs)[source]

Bases: Eddy

Wrapped executable: eddy_openmp.

Mandatory Inputs:
  • in_acqp (a pathlike object or string representing an existing file) – File containing acquisition parameters. Maps to a command-line argument: --acqp=%s.

  • in_bval (a pathlike object or string representing an existing file) – File containing the b-values for all volumes in –imain. Maps to a command-line argument: --bvals=%s.

  • in_bvec (a pathlike object or string representing an existing file) – File containing the b-vectors for all volumes in –imain. Maps to a command-line argument: --bvecs=%s.

  • in_file (a pathlike object or string representing an existing file) – File containing all the images to estimate distortions for. Maps to a command-line argument: --imain=%s.

  • in_index (a pathlike object or string representing an existing file) – File containing indices for all volumes in –imain into –acqp and –topup. Maps to a command-line argument: --index=%s.

  • in_mask (a pathlike object or string representing an existing file) – Mask to indicate brain. Maps to a command-line argument: --mask=%s.

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • cnr_maps (a boolean) – Output CNR-Maps. Maps to a command-line argument: --cnr_maps.

  • dont_peas (a boolean) – Do NOT perform a post-eddy alignment of shells. Maps to a command-line argument: --dont_peas.

  • dont_sep_offs_move (a boolean) – Do NOT attempt to separate field offset from subject movement. Maps to a command-line argument: --dont_sep_offs_move.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • estimate_move_by_susceptibility (a boolean) – Estimate how susceptibility field changes with subject movement. Maps to a command-line argument: --estimate_move_by_susceptibility.

  • fep (a boolean) – Fill empty planes in x- or y-directions. Maps to a command-line argument: --fep.

  • field (a pathlike object or string representing an existing file) – Non-topup derived fieldmap scaled in Hz. Maps to a command-line argument: --field=%s.

  • field_mat (a pathlike object or string representing an existing file) – Matrix specifying the relative positions of the fieldmap, –field, and the first volume of the input file, –imain. Maps to a command-line argument: --field_mat=%s.

  • flm (‘quadratic’ or ‘linear’ or ‘cubic’) – First level EC model. Maps to a command-line argument: --flm=%s. (Nipype default value: quadratic)

  • fudge_factor (a float) – Fudge factor for hyperparameter error variance. Maps to a command-line argument: --ff=%s. (Nipype default value: 10.0)

  • fwhm (a float) – FWHM for conditioning filter when estimating the parameters. Maps to a command-line argument: --fwhm=%s.

  • in_topup_fieldcoef (a pathlike object or string representing an existing file) – Topup results file containing the field coefficients. Maps to a command-line argument: --topup=%s. Requires inputs: in_topup_movpar.

  • in_topup_movpar (a pathlike object or string representing an existing file) – Topup results file containing the movement parameters (movpar.txt). Requires inputs: in_topup_fieldcoef.

  • initrand (a boolean) – Resets rand for when selecting voxels. Maps to a command-line argument: --initrand.

  • interp (‘spline’ or ‘trilinear’) – Interpolation model for estimation step. Maps to a command-line argument: --interp=%s. (Nipype default value: spline)

  • is_shelled (a boolean) – Override internal check to ensure that date are acquired on a set of b-value shells. Maps to a command-line argument: --data_is_shelled.

  • json (a string or os.PathLike object referring to an existing file) – Name of .json text file with information about slice timing. Maps to a command-line argument: --json=%s. Mutually exclusive with inputs: slice_order. Requires inputs: mporder.

  • mbs_ksp (an integer) – Knot-spacing for MBS field estimation. Maps to a command-line argument: --mbs_ksp=%smm. Requires inputs: estimate_move_by_susceptibility.

  • mbs_lambda (an integer) – Weighting of regularisation for MBS estimation. Maps to a command-line argument: --mbs_lambda=%s. Requires inputs: estimate_move_by_susceptibility.

  • mbs_niter (an integer) – Number of iterations for MBS estimation. Maps to a command-line argument: --mbs_niter=%s. Requires inputs: estimate_move_by_susceptibility.

  • method (‘jac’ or ‘lsr’) – Final resampling method (jacobian/least squares). Maps to a command-line argument: --resamp=%s. (Nipype default value: jac)

  • mporder (an integer) – Order of slice-to-vol movement model. Maps to a command-line argument: --mporder=%s. Requires inputs: use_cuda.

  • multiband_factor (an integer) – Multi-band factor. Maps to a command-line argument: --mb=%s.

  • multiband_offset (0 or 1 or -1) – Multi-band offset (-1 if bottom slice removed, 1 if top slice removed. Maps to a command-line argument: --mb_offs=%d. Requires inputs: multiband_factor.

  • niter (an integer) – Number of iterations. Maps to a command-line argument: --niter=%s. (Nipype default value: 5)

  • num_threads (an integer) – Maps to a command-line argument: --nthr=%d. (Nipype default value: 1)

  • nvoxhp (an integer) – # of voxels used to estimate the hyperparameters. Maps to a command-line argument: --nvoxhp=%s. (Nipype default value: 1000)

  • out_base (a string) – Basename for output image. Maps to a command-line argument: --out=%s. (Nipype default value: eddy_corrected)

  • outlier_nstd (an integer) – Number of std off to qualify as outlier. Maps to a command-line argument: --ol_nstd. Requires inputs: repol.

  • outlier_nvox (an integer) – Min # of voxels in a slice for inclusion in outlier detection. Maps to a command-line argument: --ol_nvox. Requires inputs: repol.

  • outlier_pos (a boolean) – Consider both positive and negative outliers if set. Maps to a command-line argument: --ol_pos. Requires inputs: repol.

  • outlier_sqr (a boolean) – Consider outliers among sums-of-squared differences if set. Maps to a command-line argument: --ol_sqr. Requires inputs: repol.

  • outlier_type (‘sw’ or ‘gw’ or ‘both’) – Type of outliers, slicewise (sw), groupwise (gw) or both (both). Maps to a command-line argument: --ol_type. Requires inputs: repol.

  • output_type (‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’) – FSL output type.

  • repol (a boolean) – Detect and replace outlier slices. Maps to a command-line argument: --repol.

  • residuals (a boolean) – Output Residuals. Maps to a command-line argument: --residuals.

  • session (a pathlike object or string representing an existing file) – File containing session indices for all volumes in –imain. Maps to a command-line argument: --session=%s.

  • slice2vol_interp (‘trilinear’ or ‘spline’) – Slice-to-vol interpolation model for estimation step. Maps to a command-line argument: --s2v_interp=%s. Requires inputs: mporder.

  • slice2vol_lambda (an integer) – Regularisation weight for slice-to-vol movement (reasonable range 1-10). Maps to a command-line argument: --s2v_lambda=%d. Requires inputs: mporder.

  • slice2vol_niter (an integer) – Number of iterations for slice-to-vol. Maps to a command-line argument: --s2v_niter=%d. Requires inputs: mporder.

  • slice_order (a string or os.PathLike object referring to an existing file) – Name of text file completely specifying slice/group acquisition. Maps to a command-line argument: --slspec=%s. Mutually exclusive with inputs: json. Requires inputs: mporder.

  • slm (‘none’ or ‘linear’ or ‘quadratic’) – Second level EC model. Maps to a command-line argument: --slm=%s. (Nipype default value: none)

  • use_cuda (a boolean) – Run eddy using cuda gpu.

Outputs:
  • out_cnr_maps (a pathlike object or string representing an existing file) – Path/name of file with the cnr_maps.

  • out_corrected (a pathlike object or string representing an existing file) – 4D image file containing all the corrected volumes.

  • out_movement_over_time (a pathlike object or string representing an existing file) – Text file containing translations (mm) and rotations (radians) for each excitation.

  • out_movement_rms (a pathlike object or string representing an existing file) – Summary of the ‘total movement’ in each volume.

  • out_outlier_free (a pathlike object or string representing an existing file) – 4D image file not corrected for susceptibility or eddy-current distortions or subject movement but with outlier slices replaced.

  • out_outlier_map (a pathlike object or string representing an existing file) – Matrix where rows represent volumes and columns represent slices. “0” indicates that scan-slice is not an outlier and “1” indicates that it is.

  • out_outlier_n_sqr_stdev_map (a pathlike object or string representing an existing file) – Matrix where rows represent volumes and columns represent slices. Values indicate number of standard deivations off the square root of the mean squared difference between observation and prediction is.

  • out_outlier_n_stdev_map (a pathlike object or string representing an existing file) – Matrix where rows represent volumes and columns represent slices. Values indicate number of standard deviations off the mean difference between observation and prediction is.

  • out_outlier_report (a pathlike object or string representing an existing file) – Text file with a plain language report on what outlier slices eddy has found.

  • out_parameter (a pathlike object or string representing an existing file) – Text file with parameters defining the field and movement for each scan.

  • out_residuals (a pathlike object or string representing an existing file) – Path/name of file with the residuals.

  • out_restricted_movement_rms (a pathlike object or string representing an existing file) – Summary of the ‘total movement’ in each volume disregarding translation in the PE direction.

  • out_rotated_bvecs (a pathlike object or string representing an existing file) – File containing rotated b-values for all volumes.

  • out_shell_alignment_parameters (a pathlike object or string representing an existing file) – Text file containing rigid body movement parameters between the different shells as estimated by a post-hoc mutual information based registration.

  • out_shell_pe_translation_parameters (a pathlike object or string representing an existing file) – Text file containing translation along the PE-direction between the different shells as estimated by a post-hoc mutual information based registration.

  • outlier_free_data (a pathlike object or string representing an existing file) – the original data given by –imain not corrected for susceptibility or EC-induced distortions or subject movement, but with outlier slices replaced by the Gaussian Process predictions.

  • outlier_map (a pathlike object or string representing an existing file) – All numbers are either 0, meaning that scan-slice is not an outliers, or 1 meaning that it is.

  • outlier_n_sqr_stdev_map (a pathlike object or string representing an existing file) – How many standard deviations off the square root of the mean squared difference between observation and prediction is.

  • outlier_n_stdev_map (a pathlike object or string representing an existing file) – How many standard deviations off the mean difference between observation and prediction is.

  • shell_PE_translation_parameters (a pathlike object or string representing an existing file) – The translation along the PE-direction between the different shells.

class qsiprep.interfaces.eddy.GatherEddyInputs(from_file=None, resource_monitor=None, **inputs)[source]

Bases: SimpleInterface

Manually prepare inputs for TOPUP and eddy.

Inputs
rpe_b0: str

path to a file (3D or 4D) containing b=0 images with the reverse PE direction

dwi_file: str

path to a 4d DWI nifti file

bval_file: str

path to the bval file

bvec_file: str

path to the bvec file

Mandatory Inputs:

eddy_config (a pathlike object or string representing an existing file)

Optional Inputs:
  • b0_threshold (an integer) – (Nipype default value: 100)

  • bval_file (a pathlike object or string representing an existing file)

  • bvec_file (a pathlike object or string representing an existing file)

  • dwi_file (a pathlike object or string representing an existing file)

  • epi_fmaps (a list of items which are a pathlike object or string representing an existing file) – Files from fmaps/ for distortion correction.

  • json_file (a pathlike object or string representing an existing file)

  • original_files (a list of items which are a pathlike object or string representing an existing file)

  • raw_image_sdc (a boolean) – (Nipype default value: True)

  • topup_max_b0s_per_spec (an integer) – (Nipype default value: 1)

  • topup_requested (a boolean) – (Nipype default value: False)

Outputs:
  • b0_tsv (a pathlike object or string representing an existing file)

  • eddy_acqp (a pathlike object or string representing an existing file)

  • eddy_first (a pathlike object or string representing an existing file)

  • eddy_indices (a pathlike object or string representing an existing file)

  • forward_transforms (a list of items which are any value)

  • forward_warps (a list of items which are any value)

  • json_file (a pathlike object or string representing an existing file)

  • multiband_factor (an integer)

  • pre_topup_image (a pathlike object or string representing an existing file)

  • topup_config (a string)

  • topup_datain (a pathlike object or string representing an existing file)

  • topup_first (a pathlike object or string representing an existing file)

  • topup_imain (a pathlike object or string representing an existing file)

  • topup_report (a string) – Description of where data came from.

qsiprep.interfaces.eddy.boilerplate_from_eddy_config(eddy_config, fieldmap_type, pepolar_method)[source]

Write boilerplate text based on an eddy config dict.

qsiprep.interfaces.eddy.topup_boilerplate(fieldmap_type, pepolar_method)[source]

Write boilerplate text based on fieldmaps