How to use the sdcflows.interfaces.fmap.get_trt function in sdcflows

To help you get started, we’ve selected a few sdcflows examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nipreps / dmriprep / dmriprep / workflows / fmap / base.py View on Github external
"""Initialize a barebones TOPUP implementation."""
    from nipype.interfaces.afni import Automask
    from nipype.interfaces.fsl.epi import TOPUP
    from niworkflows.interfaces.nibabel import MergeSeries
    from sdcflows.interfaces.fmap import get_trt
    from ...interfaces.images import RescaleB0
    wf = Workflow(name=name)

    inputnode = pe.Node(niu.IdentityInterface(fields=["metadata", "in_data"]),
                        name="inputnode")
    outputnode = pe.Node(niu.IdentityInterface(fields=["fieldmap", "corrected", "corrected_mask"]),
                         name="outputnode")

    concat_blips = pe.Node(MergeSeries(), name="concat_blips")
    readout_time = pe.MapNode(niu.Function(
        input_names=["in_meta", "in_file"], function=get_trt), name="readout_time",
        iterfield=["in_meta", "in_file"], run_without_submitting=True
    )

    topup = pe.Node(TOPUP(config=_pkg_fname(
        "dmriprep", f"data/flirtsch/b02b0{'_quick' * debug}.cnf")), name="topup")

    pre_mask = pe.Node(Automask(dilate=1, outputtype="NIFTI_GZ"),
                       name="pre_mask")
    rescale_corrected = pe.Node(RescaleB0(), name="rescale_corrected")
    post_mask = pe.Node(Automask(outputtype="NIFTI_GZ"),
                        name="post_mask")
    wf.connect([
        (inputnode, concat_blips, [("in_data", "in_files")]),
        (inputnode, readout_time, [("in_data", "in_file"),
                                   ("metadata", "in_meta")]),
        (inputnode, topup, [(("metadata", _get_pedir), "encoding_direction")]),

sdcflows

Susceptibility Distortion Correction (SDC) workflows for EPI MR schemes.

Apache-2.0
Latest version published 9 days ago

Package Health Score

75 / 100
Full package analysis