qsiprep.workflows.dwi.merge module

Merge and denoise dwi images

qsiprep.workflows.dwi.merge.closest_odd(x)[source]
qsiprep.workflows.dwi.merge.gen_denoising_boilerplate()[source]

Generate a methods boilerplate for the denoising workflow.

qsiprep.workflows.dwi.merge.get_acq_parameters_df(dwi_file_list, layout)[source]

Figure out what the

qsiprep.workflows.dwi.merge.get_merged_parameter(parameter_df, parameter_name, selection_mode='all')[source]

Return a single parameter from a parameter dataframe.

qsiprep.workflows.dwi.merge.init_dwi_denoising_wf(source_file, partial_fourier, phase_encoding_direction, n_volumes, use_phase, do_biascorr, name='denoise_wf')[source]

Build a workflow to denoise a DWI series.

Parameters:
  • source_file (str) – path to the original dwi file

  • partial_fourier (float) – fraction of k-space acquired

  • phase_encoding_direction (str) – direction of phase encoding

  • n_volumes (int) – number of volumes in the DWI series. Used to determine the window size for denoising if dwidenoise is used and the ‘auto’ option is selected.

  • use_phase (bool) – True if phase data are available for the DWI scan. If True, and denoise_method is dwidenoise, then dwidenoise will be run on the complex-valued data.

  • do_biascorr (bool) – If True run dwi_biascorrect

  • name (str) – name of the workflow

Inputs:
  • dwi_file – path to the dwi file

  • bval_file – path to the bval file

  • bvec_file – path to the bvec file

  • dwi_phase_file – path to the dwi phase file (optional)

Outputs:
  • dwi_file – path to the denoised dwi file

  • bval_file – path to the denoised bval file

  • bvec_file – path to the denoised bvec file

  • noise_image – path to the noise image

  • bias_image – path to the bias image

  • confounds – path to the confounds file

qsiprep.workflows.dwi.merge.init_merge_and_denoise_wf(raw_dwi_files, orientation, source_file, do_biascorr, calculate_qc=False, phase_id='same', name='merge_and_denoise_wf')[source]

(Source code)

Parameters:

raw_dwi_files (list) – list of raw (in their original BIDS directory) dwi nifti files

Outputs:
  • merged_image – dwi series, conformed, denoised if requested

  • merged_raw_image – dwi series, conformed, raw

  • merged_bval – bvals from merged images

  • merged_bvec – bvecs from merged images

  • merged_json – JSON file containing slice timings for slice2vol

  • noise_image – image(s) created by dwidenoise

  • original_files – names of the original files for each volume

  • qc_summary – DSI Studio QC text file