lama/elastix/propagate_volumes.py
def _propagate(self, mesh, tform, outdir, threads=None):
        """
        Using the iverted elastix transform paramter file, invert a volume with transformix

        Parameters
        ----------
        vol: str
            path to volume to invert
        tform: str
            path to elastix transform parameter file
        outdir: str
            path to save transformix output
        rename_output: str
            rename the transformed volume to this
        threads: str/None
            number of threads for transformix to use. if None, use all available cpus
        Returns
        -------
        str/bool
            path to new img if succesful else False
        """

        m_basename = os.path.splitext(os.path.basename(mesh))[0]
        new_vtk_path = join(outdir, m_basename + '.vtk')

        cmd = [
            'transformix',
            '-def', mesh,
            '-tp', tform,
            '-out', outdir
        ]

        if threads:
            cmd.extend(['-threads', str(threads)])
        try:
            subprocess.check_output(cmd)
        except Exception as e:
            logging.exception('transformix failed with this command: {}\nerror message:'.format(cmd), exc_info=True)
            raise
        try:
            # rename the inverted points form this stage
            old_vtk = os.path.join(outdir, ELX_INVERTED_POINTS_NAME)
            os.rename(old_vtk, new_vtk_path)
        except OSError:

            raise
        else:
            return new_vtk_path

        Using the iverted elastix transform paramter file, invert a volume with transformix

        Parameters
        ----------
        vol: str
            path to volume to invert
        tform: str
            path to elastix transform parameter file
        outdir: str
            path to save transformix output
        rename_output: str
            rename the transformed volume to this
        threads: str/None
            number of threads for transformix to use. if None, use all available cpus
        Returns
        -------
        str/bool
            path to new img if succesful else False
        
Using the iverted elastix transform paramter file, invert a volume with transformix
Parameters

str
path to volume to invert
tform: str
path to elastix transform parameter file
outdir: str
path to save transformix output
rename_output: str
rename the transformed volume to this
threads: str/None
number of threads for transformix to use. if None, use all available cpus
Returns

str/bool
path to new img if succesful else False
Using the iverted elastix transform paramter file invert a volume with transformix Parameters str path to volume to invert tform : str path to elastix transform parameter file outdir : str path to save transformix output rename_output : str rename the transformed volume to this threads : str / None number of threads for transformix to use . if None use all available cpus Returns str / bool path to new img if succesful else False
def _propagate(self, mesh, tform, outdir, threads=None):
        m_basename = os.path.splitext(os.path.basename(mesh))[0]
        new_vtk_path = join(outdir, m_basename + '.vtk')
        cmd = [
            'transformix',
            '-def', mesh,
            '-tp', tform,
            '-out', outdir
        ]
        if threads:
            cmd.extend(['-threads', str(threads)])
        try:
            subprocess.check_output(cmd)
        except Exception as e:
            logging.exception('transformix failed with this command: {}\nerror message:'.format(cmd), exc_info=True)
            raise
        try:
            old_vtk = os.path.join(outdir, ELX_INVERTED_POINTS_NAME)
            os.rename(old_vtk, new_vtk_path)
        except OSError:
            raise
        else:
            return new_vtk_path
def _propagate ( self , mesh , tform , outdir , threads = None ) : m_basename = os . path . splitext ( os . path . basename ( mesh ) ) [ 0 ] new_vtk_path = join ( outdir , m_basename + '.vtk' ) cmd = [ 'transformix' , '-def' , mesh , '-tp' , tform , '-out' , outdir ] if threads : cmd . extend ( [ '-threads' , str ( threads ) ] ) try : subprocess . check_output ( cmd ) except Exception as e : logging . exception ( 'transformix failed with this command: {}\nerror message:' . format ( cmd ) , exc_info = True ) raise try : old_vtk = os . path . join ( outdir , ELX_INVERTED_POINTS_NAME ) os . rename ( old_vtk , new_vtk_path ) except OSError : raise else : return new_vtk_path
Using the iverted elastix transform paramter file, invert a volume with transformix
Parameters
Using the iverted elastix transform paramter file invert a volume with transformix Parameters
"""
        Using the iverted elastix transform paramter file, invert a volume with transformix

        Parameters
        ----------
        vol: str
            path to volume to invert
        tform: str
            path to elastix transform parameter file
        outdir: str
            path to save transformix output
        rename_output: str
            rename the transformed volume to this
        threads: str/None
            number of threads for transformix to use. if None, use all available cpus
        Returns
        -------
        str/bool
            path to new img if succesful else False
        """ # rename the inverted points form this stage
self
mesh
tform
outdir
threads