src.original.preprocessing.MG_LU package
Submodules
src.original.preprocessing.MG_LU.TOPED_fsl_commands module
- class src.original.preprocessing.MG_LU.TOPED_fsl_commands.TOPED(distribution: str, user: str, linux_workdir: str)[source]
Bases:
object- run_command(command: str, workdir: str)[source]
Run a generic FSL command through WSL. Parameters:
command : str The FSL command to execute. workdir : str The working directory in the Linux filesystem where the command should be executed.
- run_eddy(dwi_path: str, mask_path: str, acq_parameter_path: str, index_path: str, bvecs_path: str, bvals_path: str, topup_base: str, slspec_path: str | None = None, b_range: int | None = None, flm: str | None = None, slm: str | None = None, niter: int | None = None, fwhm: str | None = None, resamp: str | None = None, fep: bool | None = None, repol: bool | None = None, estimate_move_by_susceptibility: bool | None = None, mporder: int | None = None, patient_id: str | None = None, output_dir: str | None = None, json_path: str | None = None, interp: str | None = None, nvoxhp: int | None = None, ff: float | None = None, dont_sep_offs_move: bool | None = None, dont_peas: bool | None = None, ol_nstd: float | None = None, ol_nvox: int | None = None, ol_type: str | None = None, ol_ss: str | None = None, ol_pos: bool | None = None, ol_sqr: bool | None = None, s2v_niter: int | None = None, s2v_lambda: float | None = None, s2v_interp: str | None = None, mbs_niter: int | None = None, mbs_lambda: float | None = None, mbs_ksp: float | None = None, cnr_maps: bool | None = None, residuals: bool | None = None, data_is_shelled: bool | None = None, nthr: int | None = None) str[source]
Run FSL Eddy. Parameters:
dwi_path : str Path to the input DWI image. This is the stack to be corrected by Eddy & TOPUP. mask_path : str Path to the mask image. acqparams_path : str Path to acquisition parameters file index_path : str Path to index file bvecs_path : str Path to bvecs file bvals_path : str Path to bvals file topup_base : str Base name used for topup output. is is automatically set by TOUP in the linux working directory and is used as input for Eddy. output_dir : str Output directory bunch of optional Eddy flags (set to None to use FSL defaults).
- Returns:
(Eddy + TOPUP) Corrected DWI image (path to output image)
- run_topup(b0_path: str, acq_parameter_path: str, config_file_path: str | None = None, nthr: int | None = None, logout: str | None = None, dfout: str | None = None, jacout: str | None = None, patient_id: str | None = None, output_dir: str | None = None) str[source]
Run FSL TOPUP on a stack of b0 images. Parameters:
b0_path : str The path to the b0 image to process with TOPUP. acq_parameter_path : str Path to the acquisition parameters file. config_file_path : str, optional Path to the TOPUP configuration file, by default None, which uses the default FSL config b02b0.cnf. nthr : int, optional Number of threads to use, by default None (uses default_threads)
- Returns:
whatever specified in the TOPUP command output (dfout, iout, jacout) Corrected image, fieldmap, and Jacobian determinant paths are generated in the Linux working directory.