qsirecon.interfaces package

class qsirecon.interfaces.ConformDwi(from_file=None, resource_monitor=None, **inputs)[source]

Bases: SimpleInterface

Conform a series of dwi images to enable merging. Performs three basic functions: #. Orient image to requested orientation #. Validate the qform and sform, set qform code to 1 #. Flip bvecs accordingly #. Do nothing to the bvals Note: This is not as nuanced as fmriprep’s version

Mandatory Inputs:

dwi_file (a pathlike object or string representing a file) – Dwi image.

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

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

  • orientation (‘LPS’ or ‘LAS’) – (Nipype default value: LPS)

Outputs:
  • bval_file (a pathlike object or string representing an existing file) – Conformed bval file.

  • bvec_file (a pathlike object or string representing an existing file) – Conformed bvec file.

  • dwi_file (a pathlike object or string representing an existing file) – Conformed dwi image.

  • out_report (a pathlike object or string representing an existing file) – HTML segment containing warning.

class qsirecon.interfaces.DerivativesDataSink(allowed_entities=None, out_path_base=None, **inputs)[source]

Bases: DerivativesDataSink

Store derivative files.

A child class of the niworkflows DerivativesDataSink, using QSIRecon’s configuration files.

Mandatory Inputs:
  • in_file (a list of items which are a pathlike object or string representing an existing file) – The object to be saved.

  • source_file (a list of items which are a pathlike object or string representing a file) – The source file(s) to extract entities from.

Optional Inputs:
  • base_directory (a string or os.PathLike object) – Path to the base directory for storing data.

  • check_hdr (a boolean) – Fix headers of NIfTI outputs. (Nipype default value: True)

  • compress (a list of items which are a boolean or None) – Whether in_file should be compressed (True), uncompressed (False) or left unmodified (None, default). (Nipype default value: [])

  • data_dtype (a string) – NumPy datatype to coerce NIfTI data to, or source to match the input file dtype.

  • dismiss_entities (a list of items which are a string or None) – A list entities that will not be propagated from the source file. (Nipype default value: [])

  • meta_dict (a dictionary with keys which are a string and with values which are any value) – An input dictionary containing metadata.

Outputs:
  • compression (a list of items which are a boolean or None) – Whether in_file should be compressed (True), uncompressed (False) or left unmodified (None).

  • fixed_hdr (a list of items which are a boolean) – Whether derivative header was fixed.

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

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

out_path_base = ''
class qsirecon.interfaces.ValidateImage(from_file=None, resource_monitor=None, **inputs)[source]

Bases: SimpleInterface

Check the correctness of x-form headers (matrix and code) This interface implements the following logic: +——————-+——————+——————+——————+————————————————+ | valid quaternions | qform_code > 0 | sform_code > 0 | qform == sform | actions | +===================+==================+==================+==================+================================================+ | True | True | True | True | None | +——————-+——————+——————+——————+————————————————+ | True | True | False | * | sform, scode <- qform, qcode | +——————-+——————+——————+——————+————————————————+ | * | * | True | False | qform, qcode <- sform, scode | +——————-+——————+——————+——————+————————————————+ | * | False | True | * | qform, qcode <- sform, scode | +——————-+——————+——————+——————+————————————————+ | * | False | False | * | sform, qform <- best affine; scode, qcode <- 1 | +——————-+——————+——————+——————+————————————————+ | False | * | False | * | sform, qform <- best affine; scode, qcode <- 1 | +——————-+——————+——————+——————+————————————————+

Mandatory Inputs:

in_file (a pathlike object or string representing an existing file) – Input image.

Outputs:
  • out_file (a pathlike object or string representing an existing file) – Validated image.

  • out_report (a pathlike object or string representing an existing file) – HTML segment containing warning.

Submodules