예제 #1
0
    def warp_unpack(self,
                    lfp_in,
                    depthrep=None,
                    dir_out=None,
                    height=None,
                    imagerep=None,
                    threads=None,
                    width=None,
                    i=0):
        """TNT process: warp LFP to unpacked warp LFP

        :param lfp_in: `str`, source LFP file
        :param depthrep: `str`, depth map representation
        :param dir_out: `str`, directory out
        :param height: `int`, resolution height (in pixels)
        :param imagerep: `str`, image representation for processed LFP
        :param threads: `int`, number of processing threads to use
        :param width: `int`, resolution width (in pixels)
        :param i: `int`, iteration during multi file-out process
        """

        depthrep = depthrep or self._db['depthrep_warp_unpack']
        imagerep = imagerep or self._db['imagerep_warp_unpack']
        height, width = self._set_height_width(lfp_in, height, width)

        basedir, name, ext = self._split_path(lfp_in)
        dir_out = self._check_dir(dir_out) if dir_out else basedir
        lfp_out = self.lfp_out_unpacked(dir_out, name)

        self._status("unpacked LFP", "warp", src=lfp_in, dest=dir_out, i=i)

        tnt = Tnt(verbose=self.verbose)
        tnt.threads(threads)
        tnt.lfp_in(lfp_in)
        tnt.dir_out(dir_out)
        tnt.lfp_out(lfp_out)
        tnt.transcode()
        tnt.unpack()
        tnt.imagerep(imagerep)
        tnt.depthrep(depthrep)
        tnt.height(height)
        tnt.width(width)
        self._execute(tnt)

        if os.path.exists(lfp_out):
            self.recipe_out(lfp_out, threads=threads, i=i)
            self.warp_depth_map_json_out(lfp_out, i=i)
예제 #2
0
    def warp_transcode(self, lfp_in, lfp_out=None, threads=None, i=0):
        """TNT process: warp LFP to warp LFP

        :param lfp_in: `str`, source LFP file
        :param lfp_out: `str`, destination LFP file
        :param threads: `int`, number of processing threads to use
        :param i: `int`, iteration during multi file-out process
        """

        lfp_out = lfp_out or lfp_in

        self._status("warp LFP", "warp", src=lfp_in, dest=lfp_out, i=i)

        tnt = Tnt(verbose=self.verbose)
        tnt.threads(threads)
        tnt.lfp_in(lfp_in)
        tnt.lfp_out(lfp_out)
        tnt.transcode()
        self._execute(tnt)