Ejemplo n.º 1
0
def build_argparser():
    p = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
                                description=__doc__)

    add_mandatory_options_tracking(p)

    track_g = add_tracking_options(p)
    # If you need the sphere for your model:
    add_sphere_arg(track_g, symmetric_only=False)

    # As in scilpy:
    add_seeding_options(p)
    add_out_options(p)

    add_logging_arg(p)

    return p
def _build_arg_parser():
    p = argparse.ArgumentParser(
        description=__doc__,
        formatter_class=argparse.RawTextHelpFormatter)

    add_mandatory_options_tracking(p)

    track_g = add_tracking_options(p)
    track_g.add_argument('--algo', default='prob',
                         choices=['det', 'prob', 'eudx'],
                         help='Algorithm to use [%(default)s]')
    add_sphere_arg(track_g, symmetric_only=True)

    add_seeding_options(p)
    out_g = add_out_options(p)

    out_g.add_argument('--seed', type=int,
                       help='Random number generator seed.')

    log_g = p.add_argument_group('Logging options')
    add_verbose_arg(log_g)

    return p
Ejemplo n.º 3
0
def _build_arg_parser():
    p = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
                                description=__doc__)

    add_mandatory_options_tracking(p)

    track_g = add_tracking_options(p)
    track_g.add_argument('--algo',
                         default='prob',
                         choices=['det', 'prob'],
                         help='Algorithm to use [%(default)s]')
    add_sphere_arg(track_g, symmetric_only=False)
    track_g.add_argument('--sfthres_init',
                         metavar='sf_th',
                         type=float,
                         default=0.5,
                         dest='sf_threshold_init',
                         help="Spherical function relative threshold value "
                         "for the \ninitial direction. [%(default)s]")
    track_g.add_argument('--rk_order',
                         metavar="K",
                         type=int,
                         default=2,
                         choices=[1, 2, 4],
                         help="The order of the Runge-Kutta integration used "
                         "for the \nstep function [%(default)s]. As a "
                         "rule of thumb, doubling the rk_order \nwill "
                         "double the computation time in the worst case.")
    track_g.add_argument('--max_invalid_length',
                         metavar='MAX',
                         type=float,
                         default=1,
                         help="Maximum length without valid direction, in mm. "
                         "[%(default)s]")
    track_g.add_argument('--forward_only',
                         action='store_true',
                         help="If set, tracks in one direction only (forward) "
                         "given the \ninitial seed. The direction is "
                         "randomly drawn from the ODF.")
    track_g.add_argument('--sh_interp',
                         default='trilinear',
                         choices=['nearest', 'trilinear'],
                         help="Spherical harmonic interpolation: "
                         "nearest-neighbor \nor trilinear. [%(default)s]")
    track_g.add_argument('--mask_interp',
                         default='trilinear',
                         choices=['nearest', 'trilinear'],
                         help="Mask interpolation: nearest-neighbor or "
                         "trilinear. [%(default)s]")

    add_seeding_options(p)

    r_g = p.add_argument_group('Random seeding options')
    r_g.add_argument('--rng_seed',
                     type=int,
                     default=0,
                     help='Initial value for the random number generator. '
                     '[%(default)s]')
    r_g.add_argument('--skip',
                     type=int,
                     default=0,
                     help="Skip the first N random number. \n"
                     "Useful if you want to create new streamlines to "
                     "add to \na previously created tractogram with a "
                     "fixed --rng_seed.\nEx: If tractogram_1 was created "
                     "with -nt 1,000,000, \nyou can create tractogram_2 "
                     "with \n--skip 1,000,000.")

    m_g = p.add_argument_group('Memory options')
    add_processes_arg(m_g)

    add_out_options(p)
    add_verbose_arg(p)

    return p