How to use the niworkflows.interfaces.freesurfer.TruncateLTA function in niworkflows

To help you get started, we’ve selected a few niworkflows 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 poldracklab / niworkflows / niworkflows / interfaces / freesurfer.py View on Github external
def _post_run_hook(self, runtime):

        outputs = self._list_outputs()

        for lta_name in self.lta_outputs:
            lta_file = outputs[lta_name]
            if not isdefined(lta_file):
                continue

            fix_lta_length(lta_file)

        runtime = super(TruncateLTA, self)._post_run_hook(runtime)
        return runtime


class PatchedConcatenateLTA(TruncateLTA, ConcatenateLTA):
    """
    A temporarily patched version of ``fs.ConcatenateLTA`` to recover from
    `this bug `_
    in FreeSurfer, that was
    `fixed here `__.

    The original FMRIPREP's issue is found
    `here `__.

    the fix is now done through mixin with TruncateLTA
    """

    lta_outputs = ["out_file"]


class PatchedLTAConvert(TruncateLTA, LTAConvert):
github poldracklab / niworkflows / niworkflows / interfaces / freesurfer.py View on Github external
class PatchedLTAConvert(TruncateLTA, LTAConvert):
    """
    LTAconvert is producing a lta file refer as out_lta
    truncate filename through mixin TruncateLTA
    """

    lta_outputs = ("out_lta",)


class PatchedBBRegisterRPT(TruncateLTA, BBRegisterRPT):
    pass


class PatchedMRICoregRPT(TruncateLTA, MRICoregRPT):
    pass


class PatchedRobustRegister(TruncateLTA, RobustRegister):
    lta_outputs = ("out_reg_file", "half_source_xfm", "half_targ_xfm")


class _RefineBrainMaskInputSpec(BaseInterfaceInputSpec):
    in_anat = File(
        exists=True, mandatory=True, desc="input anatomical reference (INU corrected)"
    )
    in_aseg = File(
        exists=True, mandatory=True, desc="input ``aseg`` file, in NifTi format."
    )
    in_ants = File(
        exists=True,
github poldracklab / niworkflows / niworkflows / interfaces / freesurfer.py View on Github external
def _post_run_hook(self, runtime):

        outputs = self._list_outputs()

        for lta_name in self.lta_outputs:
            lta_file = outputs[lta_name]
            if not isdefined(lta_file):
                continue

            fix_lta_length(lta_file)

        runtime = super(TruncateLTA, self)._post_run_hook(runtime)
        return runtime
github poldracklab / niworkflows / niworkflows / interfaces / freesurfer.py View on Github external
the fix is now done through mixin with TruncateLTA
    """

    lta_outputs = ["out_file"]


class PatchedLTAConvert(TruncateLTA, LTAConvert):
    """
    LTAconvert is producing a lta file refer as out_lta
    truncate filename through mixin TruncateLTA
    """

    lta_outputs = ("out_lta",)


class PatchedBBRegisterRPT(TruncateLTA, BBRegisterRPT):
    pass


class PatchedMRICoregRPT(TruncateLTA, MRICoregRPT):
    pass


class PatchedRobustRegister(TruncateLTA, RobustRegister):
    lta_outputs = ("out_reg_file", "half_source_xfm", "half_targ_xfm")


class _RefineBrainMaskInputSpec(BaseInterfaceInputSpec):
    in_anat = File(
        exists=True, mandatory=True, desc="input anatomical reference (INU corrected)"
    )
    in_aseg = File(
github poldracklab / niworkflows / niworkflows / interfaces / freesurfer.py View on Github external
"""
    A temporarily patched version of ``fs.ConcatenateLTA`` to recover from
    `this bug `_
    in FreeSurfer, that was
    `fixed here `__.

    The original FMRIPREP's issue is found
    `here `__.

    the fix is now done through mixin with TruncateLTA
    """

    lta_outputs = ["out_file"]


class PatchedLTAConvert(TruncateLTA, LTAConvert):
    """
    LTAconvert is producing a lta file refer as out_lta
    truncate filename through mixin TruncateLTA
    """

    lta_outputs = ("out_lta",)


class PatchedBBRegisterRPT(TruncateLTA, BBRegisterRPT):
    pass


class PatchedMRICoregRPT(TruncateLTA, MRICoregRPT):
    pass
github poldracklab / niworkflows / niworkflows / interfaces / freesurfer.py View on Github external
LTAconvert is producing a lta file refer as out_lta
    truncate filename through mixin TruncateLTA
    """

    lta_outputs = ("out_lta",)


class PatchedBBRegisterRPT(TruncateLTA, BBRegisterRPT):
    pass


class PatchedMRICoregRPT(TruncateLTA, MRICoregRPT):
    pass


class PatchedRobustRegister(TruncateLTA, RobustRegister):
    lta_outputs = ("out_reg_file", "half_source_xfm", "half_targ_xfm")


class _RefineBrainMaskInputSpec(BaseInterfaceInputSpec):
    in_anat = File(
        exists=True, mandatory=True, desc="input anatomical reference (INU corrected)"
    )
    in_aseg = File(
        exists=True, mandatory=True, desc="input ``aseg`` file, in NifTi format."
    )
    in_ants = File(
        exists=True,
        mandatory=True,
        desc="brain tissue segmentation generated with antsBrainExtraction.sh",
    )