def run(self):
        ''' run the unwarp resample
        '''
        # get the spherical harmonics coefficients from parsing
        # the given .coeff file xor .grad file
        if hasattr(self.args, 'gradfile') and self.args.gradfile:
            self.coeffs = coeffs.get_coefficients(self.args.vendor,
                                                  self.args.gradfile)
        else:
            self.coeffs = coeffs.get_coefficients(self.args.vendor,
                                                  self.args.coeffile)

        self.vol, self.m_rcs2ras = utils.get_vol_affine(self.args.infile)

        self.unwarper = Unwarper(self.vol, self.m_rcs2ras, self.args.vendor,
                                 self.coeffs, self.args.infile)
        if hasattr(self.args, 'fovmin') and self.args.fovmin:
            self.unwarper.fovmin = float(self.args.fovmin)
        if hasattr(self.args, 'fovmax') and self.args.fovmax:
            self.unwarper.fovmax = float(self.args.fovmax)
        if hasattr(self.args, 'numpoints') and self.args.numpoints:
            self.unwarper.numpoints = int(self.args.numpoints)
        if hasattr(self.args, 'warp') and self.args.warp:
            self.unwarper.warp = True
        if hasattr(self.args, 'nojac') and self.args.nojac:
            self.unwarper.nojac = True
        if hasattr(self.args, 'order') and self.args.order:
            self.unwarper.order = int(self.args.order)
        self.unwarper.run()
Ejemplo n.º 2
0
    def run(self):
        ''' run the unwarp resample
        '''
        # get the spherical harmonics coefficients from parsing
        # the given .coeff file xor .grad file
        if hasattr(self.args, 'gradfile') and self.args.gradfile:
            self.coeffs = coeffs.get_coefficients(self.args.vendor,
                                                 self.args.gradfile)
        else:
            self.coeffs = coeffs.get_coefficients(self.args.vendor,
                                                 self.args.coeffile)

        self.vol, self.m_rcs2ras = utils.get_vol_affine(self.args.infile)

        self.unwarper = Unwarper(self.vol, self.m_rcs2ras, self.args.vendor,
                                 self.coeffs, self.args.infile, self.args.hcp)
        if hasattr(self.args, 'fovmin') and self.args.fovmin:
            self.unwarper.fovmin = float(self.args.fovmin)
        if hasattr(self.args, 'fovmax') and self.args.fovmax:
            self.unwarper.fovmax = float(self.args.fovmax)
        if hasattr(self.args, 'numpoints') and self.args.numpoints:
            self.unwarper.numpoints = int(self.args.numpoints)
        if hasattr(self.args, 'warp') and self.args.warp:
            self.unwarper.warp = True
        if hasattr(self.args, 'nojac') and self.args.nojac:
            self.unwarper.nojac = True
        if hasattr(self.args, 'order') and self.args.order:
            self.unwarper.order = int(self.args.order)
        self.unwarper.run()