lama/elastix/propagate_volumes.py
def _propagate(self, volume, 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
        """
        common.test_installation('transformix')
        lm_basename = os.path.splitext(os.path.basename(volume))[0]
        new_img_path = join(outdir, lm_basename + FILE_FORMAT)

        cmd = [
            'transformix',
            '-in', volume,
            '-tp', tform,
            '-out', outdir
        ]

        if threads:
            cmd.extend(['-threads', str(threads)])
        try:
            subprocess.check_output(cmd)
        except Exception as e:
            logging.exception('transformix failed propagating volume: {} Is transformix installed?. Error: {}'.format(volume, e))
            raise
        try:
            old_img = os.path.join(outdir, TRANSFORMIX_OUT)
            os.rename(old_img, new_img_path)
        except OSError:

            return old_img
        else:
            return new_img_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, volume, tform, outdir, threads=None):
        common.test_installation('transformix')
        lm_basename = os.path.splitext(os.path.basename(volume))[0]
        new_img_path = join(outdir, lm_basename + FILE_FORMAT)
        cmd = [
            'transformix',
            '-in', volume,
            '-tp', tform,
            '-out', outdir
        ]
        if threads:
            cmd.extend(['-threads', str(threads)])
        try:
            subprocess.check_output(cmd)
        except Exception as e:
            logging.exception('transformix failed propagating volume: {} Is transformix installed?. Error: {}'.format(volume, e))
            raise
        try:
            old_img = os.path.join(outdir, TRANSFORMIX_OUT)
            os.rename(old_img, new_img_path)
        except OSError:
            return old_img
        else:
            return new_img_path
def _propagate ( self , volume , tform , outdir , threads = None ) : common . test_installation ( 'transformix' ) lm_basename = os . path . splitext ( os . path . basename ( volume ) ) [ 0 ] new_img_path = join ( outdir , lm_basename + FILE_FORMAT ) cmd = [ 'transformix' , '-in' , volume , '-tp' , tform , '-out' , outdir ] if threads : cmd . extend ( [ '-threads' , str ( threads ) ] ) try : subprocess . check_output ( cmd ) except Exception as e : logging . exception ( 'transformix failed propagating volume: {} Is transformix installed?. Error: {}' . format ( volume , e ) ) raise try : old_img = os . path . join ( outdir , TRANSFORMIX_OUT ) os . rename ( old_img , new_img_path ) except OSError : return old_img else : return new_img_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
        """
self
volume
tform
outdir
threads