Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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):
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,
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
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(
"""
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
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",
)