qsiprep.interfaces.tortoise module
Wrappers for the TORTOISE programs.
- class qsiprep.interfaces.tortoise.ConcatenateDIFFPREPGroups(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterfaceRecombine the two per-PE-direction DIFFPREP outputs into one series.
The series is restored to the original (merged) volume order.
Each group was corrected by its own DIFFPREP run, so the two corrected 4D files live in different corrected spaces – that is expected and correct; reconciling those two spaces is exactly DRBUDDI’s job. This node only restores the per-volume order (so
original_filesstill lines up with the recombined series that DRBUDDI re-splits) and stitches the rotated bmatrix and per-volume transforms to match. The emitted triple is a drop-in for a single DIFFPREP node’scorrected_dwi_file/corrected_bmtxt_file/transformations_file, so every downstream node is unchanged.- Mandatory Inputs:
group1_bmtxt_file (a pathlike object or string representing an existing file)
group1_dwi_file (a pathlike object or string representing an existing file)
group1_transformations_file (a pathlike object or string representing an existing file)
group2_bmtxt_file (a pathlike object or string representing an existing file)
group2_dwi_file (a pathlike object or string representing an existing file)
group2_transformations_file (a pathlike object or string representing an existing file)
group_assignments (a list of items which are an integer) – Per-volume group id (1 or 2) in the original merged order, as produced by SplitDWIsByDistortionGroup.
- Outputs:
corrected_bmtxt_file (a pathlike object or string representing an existing file)
corrected_dwi_file (a pathlike object or string representing an existing file)
transformations_file (a pathlike object or string representing an existing file)
- class qsiprep.interfaces.tortoise.DIFFPREP(**inputs)[source]
Bases:
TORTOISECommandLineWrapped executable:
TORTOISEProcess.TORTOISE V4 DIFFPREP motion + eddy-current correction.
Runs the
TORTOISEProcessbinary starting from the Import step (so the proc.nii/proc.bmtxt/proc.json working files get staged) with all stages other than motion+eddy (and optionally the EPI/T2Wregstage) disabled via their own flags. See_base_step_flagsfor why--step import(not--step motioneddy) is required. Emits the per-volume corrected DWI, rotated bmatrix, and 24-parameter transform file.- Mandatory Inputs:
bmtxt_file (a pathlike object or string representing an existing file) – Sibling TORTOISE 6-column bmatrix file. Found by TORTOISEProcess from the .nii’s basename; not passed as its own argstr.
correction_mode (‘motion’ or ‘quadratic’ or ‘cubic’) – Motion & eddy correction mode forwarded to TORTOISE. “motion” = rigid only; “quadratic” = rigid + quadratic eddy (recommended); “cubic” = rigid + cubic eddy. Maps to a command-line argument:
-c %s.dwi_file (a pathlike object or string representing an existing file) – Uncompressed 4D NIfTI passed to TORTOISEProcess as the UP image. A sibling
.bmtxtand.jsonmust be present. Maps to a command-line argument:-u %s.json_file (a pathlike object or string representing an existing file) – Sibling BIDS JSON sidecar with PhaseEncodingDirection. Found by TORTOISEProcess from the .nii’s basename; not passed as its own argstr.
- Optional Inputs:
args (a string) – Additional parameters to the command. Maps to a command-line argument:
%s.b0_id (an integer) – Index of b=0 volume to use as the registration target. -1 (default) lets TORTOISE pick the best one. Maps to a command-line argument:
--b0_id %d. (Nipype default value:-1)disable_itk_threads (a boolean) – Maps to a command-line argument:
--disable_itk_threads. (Nipype default value:True)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:
{})epi_mode (‘off’ or ‘T2Wreg’) – TORTOISE –epi mode. “off”: no in-TORTOISE SDC (default). “T2Wreg”: structural EPI correction using –structural_image. (Nipype default value:
off)epi_working_res (a float) – Resolution (mm) of the EPIREG registration grid (see DRBUDDI). Requires a patched TORTOISE that exposes –epi_working_res. Maps to a command-line argument:
--epi_working_res %g.epireg_initial_field (a pathlike object or string representing an existing file) – Initial EPI displacement field for T2Wreg, in the b=0 world frame (e.g. the warp derived from a GRE fieldmap); the registration refines it. Maps to a command-line argument:
--EPIREG_initial_field %s.extra_args (a list of items which are a string) – Additional flags appended verbatim to the TORTOISEProcess command. Use to access TORTOISE knobs not surfaced as first-class fields (e.g. [”–big_delta”, “0.030”]). (Nipype default value:
[])gpu_cpu_ratio (an integer) – Volumes the GPU processes per pass, against one per CPU thread. Maps to a command-line argument:
--gpu_cpu_ratio %d.grad_nonlin (a pathlike object or string representing an existing file) – Gradwarp displacement field (the TORTOISE “_inv” convention, i.e. the field qsiprep builds), so the T2Wreg stage registers a gradwarp-corrected b=0. The motion/eddy stage does not consume it. Maps to a command-line argument:
--grad_nonlin %s.is_human_brain (a boolean) – Whether the data is an in-vivo human brain. Enables iterative SHORE-prediction refinement. Maps to a command-line argument:
--is_human_brain %d. (Nipype default value:True)keep_initial_transform_fixed (a boolean) – Hold epireg_initial_field fixed through the multi-resolution pyramid, so each stage learns a residual on top of it instead of low-passing and re-estimating it. Maps to a command-line argument:
--DRBUDDI_keep_initial_transform_fixed %d.ncores (an integer) – Absolute number of CPU cores TORTOISE may use. Maps to a command-line argument:
--ncores %d.niter (an integer) – Number of iterations for the high-b / SHORE-prediction refinement loop. Zero disables all iterative correction, which is much faster. Left unset by default so TORTOISE picks its own default. Maps to a command-line argument:
--niter %d.num_threads (an integer) – Number of OMP threads.
rot_eddy_center (‘isocenter’ or ‘center_voxel’ or ‘center_slice’) – Rotation and eddy-currents center. Maps to a command-line argument:
--rot_eddy_center %s. (Nipype default value:isocenter)structural_image (a pathlike object or string representing an existing file) – T2w structural image for –epi T2Wreg (must NOT be a T1w). Required when epi_mode == “T2Wreg”.
use_cuda (a boolean) – Run the CUDA build of this TORTOISE tool (<cmd>_cuda) instead of the CPU build. The GPU must be exposed to the container (docker –gpus all / apptainer –nv). Results are NOT identical to the CPU build. (Nipype default value:
False)
- Outputs:
b0_up_corrected_image (a pathlike object or string representing a file) – B=0 after the EPI correction (for the SDC report).
b0_up_image (a pathlike object or string representing a file) – B=0 before the EPI correction (for the SDC report).
corrected_bmtxt_file (a pathlike object or string representing an existing file) – Motion-rotated 6-col bmatrix.
corrected_dwi_file (a pathlike object or string representing an existing file) – Motion + eddy corrected 4D DWI, in the input grid.
sdc_warp (a pathlike object or string representing a file) – EPI (susceptibility) displacement field, in the DWI world frame.
structural_image (a pathlike object or string representing a file) – The T2w TORTOISE actually registered against.
transformations_file (a pathlike object or string representing an existing file) – Per-volume 24-parameter Okan-quadratic transforms as written by DIFFPREP.
- class qsiprep.interfaces.tortoise.DIFFPREPMotionParams(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterfaceExtract SPM-style motion parameters from DIFFPREP’s 24-parameter transform file.
The output is a 6-column motion-parameters file.
The output columns are the leading 6 parameters of TORTOISE’s
OkanQuadraticTransformin SPM realignment-parameter order (translation_x/y/z in mm, rotation_x/y/z as Euler angles in radians), converted from TORTOISE’s native LPS to RAS+ so they match the eddy/SHORELine motion files (which qsiprep now also exports in RAS viaget_ras_motion_params()). The remaining 18 Okan parameters encode the eddy-current polynomial + rotation/eddy centre and are intentionally dropped – they are not rigid head motion.- Mandatory Inputs:
transformations_file (a pathlike object or string representing an existing file) – DIFFPREP _moteddy_transformations.txt file with 24 columns per volume.
- Outputs:
diffprep_ec_file (a pathlike object or string representing an existing file)
spm_motion_file (a pathlike object or string representing an existing file)
- class qsiprep.interfaces.tortoise.DIFFPREPSplitOutputs(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterfaceSplit TORTOISE’s corrected 4D DWI + 6-col bmatrix into per-volume files.
The outputs match the qsiprep contract: per-volume dwi/bval/bvec triples plus a list of identity ITK transforms (DIFFPREP has already baked the motion+eddy correction into the volumes, so downstream apply-transform nodes must be no-ops).
- Mandatory Inputs:
corrected_bmtxt_file (a pathlike object or string representing an existing file)
corrected_dwi_file (a pathlike object or string representing an existing file)
- Optional Inputs:
b0_threshold (an integer) – (Nipype default value:
100)- Outputs:
b0_indices (a list of items which are an integer)
bval_files (a list of items which are a pathlike object or string representing an existing file)
bvec_files (a list of items which are a pathlike object or string representing an existing file)
dwi_files (a list of items which are a pathlike object or string representing an existing file)
forward_transforms (a list of items which are a pathlike object or string representing an existing file)
- class qsiprep.interfaces.tortoise.DRBUDDI(**inputs)[source]
Bases:
TORTOISECommandLineWrapped executable:
DRBUDDI.- Mandatory Inputs:
blip_down_image (a pathlike object or string representing an existing file) – Maps to a command-line argument:
-d %s.blip_up_image (a pathlike object or string representing an existing file) – Maps to a command-line argument:
-u %s.blip_up_json (a pathlike object or string representing an existing file) – Maps to a command-line argument:
--up_json %s.fieldmap_type (‘epi’ or ‘rpe_series’)
- Optional Inputs:
args (a string) – Additional parameters to the command. Maps to a command-line argument:
%s.blip_assignments (a list of items which are any value)
blip_down_bmat (a pathlike object or string representing an existing file)
blip_up_bmat (a pathlike object or string representing an existing file)
disable_initial_rigid (a boolean) – DRBUDDI performs an initial registration between the up and down data.This registration starts with rigid, followed by a quick diffeomorphic and finalized by another rigid. This parameter, when set to 1 disables all these registrations. Default: False. Maps to a command-line argument:
--DRBUDDI_disable_initial_rigid %d.disable_itk_threads (a boolean) – Maps to a command-line argument:
--disable_itk_threads. (Nipype default value:True)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:
{})epi_working_res (a float) – Resolution (mm) of the internal registration grid used by DRBUDDI and EPIREG. TORTOISE otherwise derives it from the structural (or the DWI when no structural is given) divided by 1.3 until the mean is <= 1mm, which upsamples well past the acquired resolution: 1.7mm data becomes a 0.77mm grid, 9.5x the memory for no evident gain. Requires a patched TORTOISE that exposes –epi_working_res. Maps to a command-line argument:
--epi_working_res %g.estimate_learning_rate_per_iteration (a boolean) – Flat to estimate learning rate at every iteration. Makes DRBUDDI slower but better results. Default: False. Maps to a command-line argument:
--DRBUDDI_estimate_LR_per_iteration %d.initial_fixed_transform (a pathlike object or string representing an existing file) – Initial displacement field for the up (blip-up) data, in the b=0 world frame. Maps to a command-line argument:
--DRBUDDI_initial_fixed_transform %s.initial_moving_transform (a pathlike object or string representing an existing file) – Initial displacement field for the down (blip-down) data, in the b=0 world frame. Maps to a command-line argument:
--DRBUDDI_initial_moving_transform %s.keep_initial_transform_fixed (a boolean) – Hold the initial transforms fixed through the multi-resolution pyramid, so each stage learns a residual on top of them instead of low-passing and re-estimating them. Maps to a command-line argument:
--DRBUDDI_keep_initial_transform_fixed %d.num_threads (an integer) – Number of OMP threads. Maps to a command-line argument:
--ncores %d.sloppy (a boolean) – Use underpowered (sloppy) registration for speed. Maps to a command-line argument:
--DRBUDDI_stage [learning_rate={0.4},cfs={4:2:1},field_smoothing={9:0},metrics={MSJac:CC},restrict_constrain={1:1}].start_with_diffeomorphic_for_rigid_reg (a boolean) – DRBUDDI performs an initial registration between the up and down data. This registration starts with rigid, followed by a quick diffeomorphic and finalized by another rigid. This parameter, when set to 1 disables the very initial rigid registration and starts with the quick diffemorphic. This is helpful with VERY DISTORTED data, for which the initial rigid registration is problematic. Default: False. Maps to a command-line argument:
--DRBUDDI_start_with_diffeomorphic_for_rigid_reg.structural_image (a list of items which are a pathlike object or string representing an existing file) – Maps to a command-line argument:
-s %s.synth_shell_bval (a float) – B-value of the shell synthesized for the DRBUDDI target (0 = off). Maps to a command-line argument:
--DRBUDDI_synth_shell_bval %g.synth_shell_ndirs (an integer) – Number of directions in the synthesized shell (default 30). Maps to a command-line argument:
--DRBUDDI_synth_shell_ndirs %d.tensor_fit_bval_max (an integer) – Up to which b-value should be used for DRBUDDI’s tensor fitting. Default: 0 , meaning use all b-values. Maps to a command-line argument:
--DRBUDDI_DWI_bval_tensor_fitting %d.use_cuda (a boolean) – Run the CUDA build of this TORTOISE tool (<cmd>_cuda) instead of the CPU build. The GPU must be exposed to the container (docker –gpus all / apptainer –nv). Results are NOT identical to the CPU build. (Nipype default value:
False)
- Outputs:
bdown_to_bup_rigid_trans_h5 (a pathlike object or string representing an existing file)
blip_down_FA (a pathlike object or string representing an existing file)
blip_down_b0 (a pathlike object or string representing an existing file)
blip_down_b0_corrected (a pathlike object or string representing an existing file)
blip_down_b0_corrected_jac (a pathlike object or string representing an existing file)
blip_down_b0_quad (a pathlike object or string representing an existing file)
blip_up_FA (a pathlike object or string representing an existing file)
blip_up_b0 (a pathlike object or string representing an existing file)
blip_up_b0_corrected (a pathlike object or string representing an existing file)
blip_up_b0_corrected_jac (a pathlike object or string representing an existing file)
blip_up_b0_quad (a pathlike object or string representing an existing file)
deformation_finv (a pathlike object or string representing an existing file)
deformation_minv (a pathlike object or string representing an existing file)
structural_image (a pathlike object or string representing an existing file)
undistorted_reference (a pathlike object or string representing an existing file)
- class qsiprep.interfaces.tortoise.DRBUDDIAggregateOutputs(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterface- Mandatory Inputs:
fieldmap_type (‘epi’ or ‘rpe_series’)
- Optional Inputs:
args (a string) – Additional parameters to the command. Maps to a command-line argument:
%s.bdown_to_bup_rigid_trans_h5 (a pathlike object or string representing an existing file)
blip_assignments (a list of items which are any value)
blip_down_FA (a pathlike object or string representing an existing file)
blip_down_b0 (a pathlike object or string representing an existing file)
blip_down_b0_corrected (a pathlike object or string representing an existing file)
blip_down_b0_corrected_jac (a pathlike object or string representing an existing file)
blip_down_b0_quad (a pathlike object or string representing an existing file)
blip_up_FA (a pathlike object or string representing an existing file)
blip_up_b0 (a pathlike object or string representing an existing file)
blip_up_b0_corrected (a pathlike object or string representing an existing file)
blip_up_b0_corrected_jac (a pathlike object or string representing an existing file)
blip_up_b0_quad (a pathlike object or string representing an existing file)
deformation_finv (a pathlike object or string representing an existing file) – Blip up to b0_corrected.
deformation_minv (a pathlike object or string representing an existing file)
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:
{})num_threads (an integer) – Number of OMP threads.
structural_image (a pathlike object or string representing an existing file)
undistorted_reference (a pathlike object or string representing an existing file)
wm_seg (a pathlike object or string representing an existing file) – White matter segmentation image.
- Outputs:
b0_ref (a pathlike object or string representing an existing file)
down_fa_corrected_image (a pathlike object or string representing an existing file)
sdc_scaling_images (a list of items which are a pathlike object or string representing an existing file) – Per-volume LSR signal-redistribution ratios, TORTOISE’s default for reverse phase-encoded data: b0_corrected_final / blip_<up|down>_b0_corrected (FINALDATA.cxx, the LSR branch).
sdc_warps (a list of items which are a pathlike object or string representing an existing file)
up_fa_corrected_image (a pathlike object or string representing an existing file)
- class qsiprep.interfaces.tortoise.GatherDRBUDDIInputs(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterface- Mandatory Inputs:
dwi_series_pedir (‘i’ or ‘i-’ or ‘j’ or ‘j-’ or ‘k’ or ‘k-’)
fieldmap_type (‘epi’ or ‘rpe_series’)
- Optional Inputs:
args (a string) – Additional parameters to the command. Maps to a command-line argument:
%s.b0_threshold (an integer) – (Nipype default value:
100)bval_files (a list of items which are a pathlike object or string representing an existing file or a pathlike object or string representing an existing file)
bvec_files (a list of items which are a pathlike object or string representing an existing file or a pathlike object or string representing an existing file)
dwi_files (a list of items which are a pathlike object or string representing an existing file)
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:
{})epi_fmaps (a list of items which are a pathlike object or string representing an existing file) – Files from fmaps/ for distortion correction.
num_threads (an integer) – Number of OMP threads.
original_files (a list of items which are a pathlike object or string representing an existing file)
sidecars (a dictionary with keys which are any value and with values which are any value) – Per-file PE/readout metadata from the grouping model, to spare sidecar reads.
- Outputs:
blip_assignments (a list of items which are any value)
blip_down_bmat (a pathlike object or string representing an existing file)
blip_down_image (a pathlike object or string representing an existing file)
blip_up_bmat (a pathlike object or string representing an existing file)
blip_up_image (a pathlike object or string representing an existing file)
blip_up_json (a pathlike object or string representing an existing file)
report (a string)
- class qsiprep.interfaces.tortoise.Gibbs(**kwargs)[source]
Bases:
SeriesPreprocReport,TORTOISECommandLineWrapped executable:
Gibbs.- Mandatory Inputs:
in_file (a string or os.PathLike object referring to an existing file) – Maps to a command-line argument:
%s(position: 0).kspace_coverage (a float) – Maps to a command-line argument:
%.4f(position: 2).phase_encoding_dir (0 or 1) – 0: horizontal, 1:vertical. Maps to a command-line argument:
%d(position: 3).
- Optional Inputs:
args (a string) – Additional parameters to the command. Maps to a command-line argument:
%s.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:
{})mask (a pathlike object or string representing a file)
min_w (an integer)
nmse_text (a string or os.PathLike object)
nsh (an integer) – Maps to a command-line argument:
%d(position: 4).num_threads (an integer) – Number of OMP threads. Maps to a command-line argument:
--ncores %d.out_file (a string or os.PathLike object) – Maps to a command-line argument:
%s(position: 1).out_report (a pathlike object or string representing a file) – Filename for the visual report. (Nipype default value:
report)
- Outputs:
nmse_text (a string or os.PathLike object) – Nmse between input and output volumes.
out_file (a pathlike object or string representing an existing file)
out_report (a pathlike object or string representing a file) – Filename for the visual report.
- class qsiprep.interfaces.tortoise.SplitDWIsByDistortionGroup(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterfaceRe-split a merged reverse-PE DWI series back into its two phase-encoding groups.
This lets DIFFPREP be run once per direction on the already-merged series.
DIFFPREP models a single phase axis against a single b=0 reference for the whole file (
TORTOISEProcessruns DIFFPREP once per PE direction, seeTORTOISE.cxxfor(int PE=0;PE<2;PE++)). qsiprep concatenates the two PE directions into one 4D file for FSL eddy inpre_hmc; feeding that concatenation to a single DIFFPREP run silently mis-corrects, so we undo the merge here (keeping pre_hmc’s per-PE denoising + b0 harmonization) and emit one single-PE series per group. The merge is intentionally left in place – DRBUDDI re-splits the recombined series itself and relies on the shared b0-intensity scale the merge established.- Mandatory Inputs:
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) – Merged 4D DWI from pre_hmc (already denoised + b0-harmonized across the two PE directions). This is the file DIFFPREP must NOT see as a whole.
original_files (a list of items which are a pathlike object or string representing an existing file) – One original BIDS file per volume; the distortion group of each volume is read from these (same partition GatherDRBUDDIInputs uses).
pe_axis (‘i’ or ‘j’ or ‘k’) – Phase-encoding axis (no sign). The first-appearing group is labelled ‘+’ and the second ‘-’. DIFFPREP is sign-agnostic on the axis (DIFFPREP.cxx maps both ‘j’ and ‘j-’ to “vertical”), so this sign only documents provenance; it does not change the eddy model.
- Optional Inputs:
b0_threshold (an integer) – (Nipype default value:
100)sidecars (a dictionary with keys which are any value and with values which are any value) – Per-file PE/readout metadata from the grouping model, to spare sidecar reads.
- Outputs:
group1_bval_file (a pathlike object or string representing an existing file)
group1_bvec_file (a pathlike object or string representing an existing file)
group1_dwi_file (a pathlike object or string representing an existing file)
group1_pe_dir (a string)
group2_bval_file (a pathlike object or string representing an existing file)
group2_bvec_file (a pathlike object or string representing an existing file)
group2_dwi_file (a pathlike object or string representing an existing file)
group2_pe_dir (a string)
group_assignments (a list of items which are an integer) – Per-volume group id (1 or 2) in merged order.
- class qsiprep.interfaces.tortoise.SynthesizeDWIs(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterfaceFit a MAPMRI model to a corrected DWI and synthesize “ideal” volumes.
An “ideal” volume is synthesized at every measured gradient, for slice-wise QC.
Runs
EstimateTensor->EstimateMAPMRI->SynthesizeDWIsFromMAPMRIentirely within the node’s working directory, copying the DWI and its.bmtxtsibling intoruntime.cwdwith a fixed stem so output discovery is unambiguous.- Mandatory Inputs:
bmtxt_file (a pathlike object or string representing an existing file) – Corrected 6-col TORTOISE bmtxt.
dwi_file (a pathlike object or string representing an existing file) – Corrected 4D DWI (TORTOISE output).
mask_file (a pathlike object or string representing an existing file) – Brain mask (any grid; resampled to DWI).
- Optional Inputs:
map_order (an integer) – MAPMRI order for the QC model fit. (Nipype default value:
4)num_threads (an integer) – OMP threads for the TORTOISE estimators.
- Outputs:
per_volume_synth (a list of items which are a pathlike object or string representing an existing file) – Per-volume synthesized images.
qc_mask (a pathlike object or string representing an existing file) – Brain mask resampled onto the corrected DWI grid.
synth_dwi_file (a pathlike object or string representing an existing file) – 4D model-synthesized DWI at the corrected gradients.
- class qsiprep.interfaces.tortoise.TORTOISECommandLine(**inputs)[source]
Bases:
CommandLineSupport for TORTOISE commands that utilize OpenMP.
Sets the environment variable ‘OMP_NUM_THREADS’ to the number of threads specified by the input num_threads.
Subclasses that ship a CUDA build set
_cuda_cmdand expose ause_cudainput; see_use_cuda().- Optional Inputs:
args (a string) – Additional parameters to the command. Maps to a command-line argument:
%s.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:
{})num_threads (an integer) – Number of OMP threads.
- run(**inputs)[source]
Execute this interface.
This interface will not raise an exception if runtime.returncode is non-zero.
- Parameters:
cwd (specify a folder where the interface should be run)
inputs (allows the interface settings to be updated)
- Returns:
results – A copy of the instance that was executed, provenance information and, if successful, results
- Return type:
- class qsiprep.interfaces.tortoise.TORTOISEConvert(from_file=None, resource_monitor=None, **inputs)[source]
Bases:
SimpleInterface- Mandatory Inputs:
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)
- Optional Inputs:
mask_file (a pathlike object or string representing an existing file)
- Outputs:
bmtxt_file (a pathlike object or string representing an existing file)
dwi_file (a pathlike object or string representing an existing file)
mask_file (a pathlike object or string representing an existing file)
- qsiprep.interfaces.tortoise.bmtxt_to_fsl(bmtxt_file, working_dir=None)[source]
Convert a TORTOISE 6-col bmtxt file to FSL bval/bvec text files.
Wraps the upstream
TORTOISEBmatrixToFSLBVecsbinary, which writes sibling files with extensions.bvecsand.bvals. Returns(bval_path, bvec_path).
- qsiprep.interfaces.tortoise.generate_diffprep_boilerplate(correction_mode, t2wreg_target=None, gradwarped=False)[source]
Generate methods boilerplate describing the DIFFPREP HMC backend.
correction_modecomes from--diffprep-config(defaultquadratic), so the transform model has to be named from it rather than assumed.t2wreg_target('t2w'or'synb0') adds the EPI stage.
- qsiprep.interfaces.tortoise.generate_drbuddi_boilerplate(fieldmap_type, t2w_sdc, with_topup=False, initialized=False)[source]
Generate boilerplate that describes how DRBUDDI is being used.
initializedsays DRBUDDI starts from a field-map-derived deformation, whose estimation is described by the workflow that precedes this one.
- qsiprep.interfaces.tortoise.lsr_ratio(reference_file, blip_b0_corrected_file)[source]
Compute TORTOISE’s LSR weight for one blip:
b0_corrected_final / blip_b0_corrected.Voxels where the ratio is not a finite number (the corrected b=0 is zero or the reference is) get a weight of 1, matching
FINALDATA’s LSR branch, which fills its ratio image with 1 and overwrites only where the division yields a number.
- qsiprep.interfaces.tortoise.sloppy_epi_working_res()[source]
Return DRBUDDI/EPIREG working-grid kwargs for
--sloppy, else empty.Returned as kwargs so a stock (unpatched) TORTOISE is unaffected in normal runs – the flag is only emitted when
--sloppyis set.
- qsiprep.interfaces.tortoise.split_into_up_and_down_niis(dwi_files, bval_files, bvec_files, original_images, prefix, make_bmat=True, assignments_only=False, sidecars=None)[source]
Split the concatenated output from pre_hmc_wf into “up” and “down” nifti files.
The outputs are decompressed nifti files with float32 datatypes.