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()
class GradientUnwarpRunner(object): ''' Takes the option datastructure after parsing the commandline. run() method performs the actual unwarping write() method performs the writing of the unwarped volume ''' def __init__(self, args): ''' constructor takes the option datastructure which is the result of (options, args) = parser.parse_args() ''' self.args = args self.unwarper = None log.setLevel(logging.INFO) if hasattr(self.args, 'verbose'): log.setLevel(logging.DEBUG) 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) if hasattr(self.args, 'outfilewarp') and self.args.outfilewarp: self.unwarper.outfilewarp = self.args.outfilewarp self.unwarper.run() def write(self): self.unwarper.write(self.args.outfile)
class GradientUnwarpRunner(object): ''' Takes the option datastructure after parsing the commandline. run() method performs the actual unwarping write() method performs the writing of the unwarped volume ''' def __init__(self, args): ''' constructor takes the option datastructure which is the result of (options, args) = parser.parse_args() ''' self.args = args self.unwarper = None log.setLevel(logging.INFO) if hasattr(self.args, 'verbose'): log.setLevel(logging.DEBUG) 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() def write(self): self.unwarper.write(self.args.outfile)
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()