lama/elastix/invert_transforms.py
def invert_elastix_transform_parameters(fixed: Path, tform_file: Path, param: Path, outdir: Path, threads: str):
    """
    Invert the transform and get a new transform file
    """
    if not common.test_installation('elastix'):
        raise OSError('elastix not installed')

    cmd = ['elastix',
           '-t0', tform_file,
           '-p', param,
           '-f', fixed,
           '-m', fixed,
           '-out', outdir,
           '-threads', threads   # 11/09/18. This was set to 1. Can iversions take advantage of multithreading?
           ]


    try:
        subprocess.check_output(cmd)
    except (Exception, subprocess.CalledProcessError) as e:
        msg = f'Inverting transform file failed. cmd: {cmd}\n{str(e)}:'
        logging.error(msg)
        logging.exception(msg)
        return False
    return True

    Invert the transform and get a new transform file
    
Invert the transform and get a new transform file
Invert the transform and get a new transform file
def invert_elastix_transform_parameters(fixed: Path, tform_file: Path, param: Path, outdir: Path, threads: str):
    if not common.test_installation('elastix'):
        raise OSError('elastix not installed')
    cmd = ['elastix',
           '-t0', tform_file,
           '-p', param,
           '-f', fixed,
           '-m', fixed,
           '-out', outdir,
           '-threads', threads   
           ]
    try:
        subprocess.check_output(cmd)
    except (Exception, subprocess.CalledProcessError) as e:
        msg = f'Inverting transform file failed. cmd: {cmd}\n{str(e)}:'
        logging.error(msg)
        logging.exception(msg)
        return False
    return True
def invert_elastix_transform_parameters ( fixed : Path , tform_file : Path , param : Path , outdir : Path , threads : str ) : if not common . test_installation ( 'elastix' ) : raise OSError ( 'elastix not installed' ) cmd = [ 'elastix' , '-t0' , tform_file , '-p' , param , '-f' , fixed , '-m' , fixed , '-out' , outdir , '-threads' , threads ] try : subprocess . check_output ( cmd ) except ( Exception , subprocess . CalledProcessError ) as e : msg = f'Inverting transform file failed. cmd: {cmd}\n{str(e)}:' logging . error ( msg ) logging . exception ( msg ) return False return True
Invert the transform and get a new transform file
Invert the transform and get a new transform file
"""
    Invert the transform and get a new transform file
    """ # 11/09/18. This was set to 1. Can iversions take advantage of multithreading?
fixed
Path
tform_file
Path
param
Path
outdir
Path
threads
str