def _build_arg_parser(): p = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('in_fODF', help='Path of the fODF volume in spherical harmonics (SH).') p.add_argument('--sphere', metavar='string', default='repulsion724', choices=['repulsion100', 'repulsion724'], help='Discrete sphere to use in the processing ' '[%(default)s].') p.add_argument('--mask', metavar='', help='Path to a binary mask. Only the data inside the mask\n' 'will beused for computations and reconstruction ' '[%(default)s].') p.add_argument('--at', dest='a_threshold', type=float, default='0.0', help='Absolute threshold on fODF amplitude. This ' 'value should be set to\napproximately 1.5 to 2 times ' 'the maximum fODF amplitude in isotropic voxels\n' '(ie. ventricles).\nUse compute_fodf_max_in_ventricles.py ' 'to find the maximal value.\n' 'See [Dell\'Acqua et al HBM 2013] [%(default)s].') p.add_argument('--rt', dest='r_threshold', type=float, default='0.1', help='Relative threshold on fODF amplitude in percentage ' '[%(default)s].') add_sh_basis_args(p) add_overwrite_arg(p) add_processes_arg(p) p.add_argument('--not_all', action='store_true', help='If set, only saves the files specified using the ' 'file flags [%(default)s].') g = p.add_argument_group(title='File flags') g.add_argument('--afd_max', metavar='file', default='', help='Output filename for the AFD_max map.') g.add_argument('--afd_total', metavar='file', default='', help='Output filename for the AFD_total map (SH coeff = 0).') g.add_argument('--afd_sum', metavar='file', default='', help='Output filename for the sum of all peak contributions\n' '(sum of fODF lobes on the sphere).') g.add_argument('--nufo', metavar='file', default='', help='Output filename for the NuFO map.') g.add_argument('--rgb', metavar='file', default='', help='Output filename for the RGB map.') g.add_argument('--peaks', metavar='file', default='', help='Output filename for the extracted peaks.') g.add_argument('--peak_values', metavar='file', default='', help='Output filename for the extracted peaks values.') g.add_argument('--peak_indices', metavar='file', default='', help='Output filename for the generated peaks indices on ' 'the sphere.') return p
def _build_arg_parser(): p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('in_dwi', help='input DWI Nifti image') p.add_argument('in_bvals', help='b-values file in FSL format') p.add_argument('in_bvecs', help='b-vectors file in FSL format') p.add_argument('in_reverse_b0', help='b0 image with reversed phase encoding.') p.add_argument('--config', default='b02b0.cnf', help='topup config file [%(default)s].') p.add_argument('--b0_thr', type=float, default=20, help='All b-values with values less than or equal ' + 'to b0_thr are considered as b0s i.e. without ' + 'diffusion weighting') p.add_argument('--encoding_direction', default='y', choices=['x', 'y', 'z'], help='acquisition direction, default is AP-PA ' '[%(default)s].') p.add_argument('--readout', type=float, default=0.062, help='total readout time from the DICOM metadata ' '[%(default)s].') p.add_argument('--out_b0s', default='fused_b0s.nii.gz', help='output fused b0 file [%(default)s].') p.add_argument('--out_directory', default='.', help='output directory for topup files [%(default)s].') p.add_argument('--out_prefix', default='topup_results', help='prefix of the topup results [%(default)s].') p.add_argument('--out_script', action='store_true', help='if set, will output a .sh script (topup.sh).\n' + 'else, will output the lines to the ' + 'terminal [%(default)s].') add_overwrite_arg(p) add_verbose_arg(p) return p
def build_args_parser(): parser = argparse.ArgumentParser( formatter_class=argparse.RawTextHelpFormatter, description=DESCRIPTION) parser.add_argument('dwi', help='The DW image file to split.') parser.add_argument('bvals', help='The b-values in FSL format.') parser.add_argument('bvecs', help='The b-vectors in FSL format.') parser.add_argument('bvals_to_extract', nargs='+', metavar='bvals-to-extract', type=int, help='The list of b-values to extract. For example ' '0 2000.') parser.add_argument('output_dwi', help='The name of the output DWI file.') parser.add_argument('output_bvals', help='The name of the output b-values.') parser.add_argument('output_bvecs', help='The name of the output b-vectors') parser.add_argument('--block-size', '-s', metavar='INT', type=int, help='Loads the data using this block size. ' 'Useful\nwhen the data is too large to be ' 'loaded in memory.') parser.add_argument('--tolerance', '-t', metavar='INT', type=int, default=20, help='The tolerated gap between the b-values to ' 'extract\nand the actual b-values.') parser.add_argument('--verbose', '-v', action='store_true', dest='verbose', help='Produce verbose output.') add_overwrite_arg(parser) return parser
def _build_args_parser(): p = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, description=DESCRIPTION) p.add_argument( 'scheme_file', action='store', metavar='scheme_file', help='Sampling scheme filename. (only accepts .txt or .caru or ' '.bvecs and .bvals or .b or .dir or .dvs)') p.add_argument('--dis-sym', action='store_false', dest='enable_sym', help='Disable antipodal symmetry.') p.add_argument('--out', help='Output file name picture without extension ' + '(will be png file(s))') p.add_argument('--res', type=int, default=(300, 300), nargs='+', help='Resolution of the output picture(s)') g1 = p.add_argument_group(title='Enable/Disable renderings') g1.add_argument('--dis-sphere', action='store_false', dest='enable_sph', help='Disable the rendering of the sphere.') g1.add_argument('--dis-proj', action='store_false', dest='enable_proj', help='Disable rendering of the projection supershell.') g1.add_argument('--plot-shells', action='store_true', dest='plot_shells', help='Enable rendering each shell individually.') g2 = p.add_argument_group(title='Rendering options') g2.add_argument('--same-color', action='store_true', dest='same_color', help='Use same color for all shell.') g2.add_argument('--opacity', type=float, default=1.0, help='Opacity for the shells.') add_overwrite_arg(p) return p
def _build_args_parser(): p = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=DESCRIPTION) p.add_argument('fsl_bval', help='path to FSL b-value file.') p.add_argument('fsl_bvec', help='path to FSL gradient directions file.') p.add_argument('mrtrix_enc', help='path to gradient directions encoding file.') add_overwrite_arg(p) return p
def _build_arg_parser(): parser = argparse.ArgumentParser( description='Projects metrics onto the endpoints of streamlines. The ' 'idea is to visualize the cortical areas affected by ' 'metrics (assuming streamlines start/end in the cortex).', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('bundle', help='Fiber bundle file') parser.add_argument('metrics', nargs='+', help='Nifti metric(s) to compute statistics on') parser.add_argument('output_folder', help='Folder where to save endpoints metric') add_overwrite_arg(parser) return parser
def _build_arg_parser(): parser = argparse.ArgumentParser( description='Plot mean/std per point', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('meanstdperpoint', help='JSON file containing the mean/std per point') parser.add_argument('output', help='Output directory') parser.add_argument( '--fill_color', help='Hexadecimal RGB color filling the region between mean ± std. ' 'The hexadecimal RGB color should be formatted as 0xRRGGBB') add_overwrite_arg(parser) return parser
def _build_arg_parser(): p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('in_dwi', help='Input dwi file.') p.add_argument('in_bvec', help='Input bvec FSL format.') p.add_argument('in_bval', help='Input bval FSL format.') p.add_argument('in_table', help='original table - first line is skipped.') p.add_argument('out_basename', help='Basename output file.') add_overwrite_arg(p) add_verbose_arg(p) return p
def _build_arg_parser(): parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('map_include', help='PFT map include.') parser.add_argument('map_exclude', help='PFT map exclude.') parser.add_argument('additional_mask', help='Allow PFT tracking in this mask.') parser.add_argument('map_include_corr', help='Corrected PFT map include output file name.') parser.add_argument('map_exclude_corr', help='Corrected PFT map exclude output file name.') add_overwrite_arg(parser) return parser
def _build_arg_parser(): p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('in_hdf5', help='HDF5 filename (.h5) containing decomposed ' 'connections.') p.add_argument('out_dir', help='Path of the output directory.') p.add_argument('--include_dps', action='store_true', help='Include the data_per_streamline the metadata.') add_overwrite_arg(p) return p
def _build_args_parser(): p = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('in_tractogram', help='Path of the input tractogram file (trk or tck).') p.add_argument('out_tractogram', help='Path of the output tractogram file (trk or tck).') p.add_argument('-e', dest='error_rate', type=float, default=0.1, help='Maximum compression distance in mm. ' '[default: %(default)s]') add_overwrite_arg(p) return p
def _build_args_parser(): p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('input', action='store', metavar='in_vol', type=str, help='Path of the input volume.') p.add_argument('output', action='store', metavar='out_vol', type=str, help='Path of the resampled volume.') res_group = p.add_mutually_exclusive_group(required=True) res_group.add_argument('--ref', action='store', metavar='ref_vol', help='Reference volume to resample to.') res_group.add_argument( '--resolution', action='store', metavar='float', type=float, help='Resolution to resample to. If the value it is set to is Y, it ' 'will resample to an isotropic resolution of Y x Y x Y.') res_group.add_argument( '--iso_min', action='store_true', help='Resample the volume to R x R x R with R being the smallest ' 'current voxel dimension ') p.add_argument( '--interp', action='store', default='lin', type=str, choices=['nn', 'lin', 'quad', 'cubic'], help="Interpolation mode.\nnn: nearest neighbour\nlin: linear\n" "quad: quadratic\ncubic: cubic\nDefaults to linear") p.add_argument('--enforce_dimensions', action='store_true', help='Enforce the reference volume dimension.') add_overwrite_arg(p) p.add_argument('-v', action='store_true', dest='verbose', help='Use verbose output. Default: false.') return p
def _build_arg_parser(): p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('in_volume', help='Volume used as background (e.g. T1, FA, b0).') p.add_argument('in_bundles', nargs='+', help='List of tractography files supported by nibabel ' 'or binary mask files.') p.add_argument('out_image', help='Name of the output image mosaic ' '(e.g. mosaic.jpg, mosaic.png).') p.add_argument('--uniform_coloring', nargs=3, metavar=('R', 'G', 'B'), type=float, help='Assign an uniform color to streamlines (or ROIs).') p.add_argument('--random_coloring', metavar='SEED', type=int, help='Assign a random color to streamlines (or ROIs).') p.add_argument('--zoom', type=float, default=1.0, help='Rendering zoom. ' 'A value greater than 1 is a zoom-in,\n' 'a value less than 1 is a zoom-out [%(default)s].') p.add_argument('--ttf', default=None, help='Path of the true type font to use for legends.') p.add_argument('--ttf_size', type=int, default=35, help='Font size (int) to use for the legends ' '[%(default)s].') p.add_argument('--opacity_background', type=float, default=0.4, help='Opacity of background image, between 0 and 1.0 ' '[%(default)s].') p.add_argument('--resolution_of_thumbnails', type=int, default=300, help='Resolution of thumbnails used in mosaic ' '[%(default)s].') add_overwrite_arg(p) return p
def _build_arg_parser(): p = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=__doc__) p.add_argument('input', help='Path of the input volume (nifti).') p.add_argument('output', help='Path of the output volume (nifti).') p.add_argument('axes', metavar='dimension', choices=['x', 'y', 'z'], nargs='+', help='The axes you want to flip. eg: to flip the x ' 'and y axes use: x y.') add_overwrite_arg(p) return p
def _build_arg_parser(): p = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=__doc__) p.add_argument('mrtrix_enc', help='Path to the gradient directions encoding file. (.b)') p.add_argument('fsl_bval', help='Path to output FSL b-value file (.bval).') p.add_argument('fsl_bvec', help='Path to output FSL gradient directions file (.bvec).') add_overwrite_arg(p) add_verbose_arg(p) return p
def _build_arg_parser(): parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawTextHelpFormatter) parser.add_argument('in_bundle', help='Fiber bundle file to remove outliers from.') parser.add_argument('out_bundle', help='Fiber bundle without outliers.') parser.add_argument('--remaining_bundle', help='Removed outliers.') parser.add_argument('--alpha', type=float, default=0.6, help='Percent of the length of the tree that clusters ' 'of individual streamlines will be pruned.') add_overwrite_arg(parser) return parser
def _build_arg_parser(): p = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('voxel_label_map', help='Fiber bundle file.') p.add_argument('bundle_name', help='Bundle name.') add_json_args(p) add_overwrite_arg(p) return p
def _build_arg_parser(): p = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, description=__doc__) p.add_argument( 'gradient_sampling_file', metavar='gradient_sampling_file', nargs='+', help='Gradient sampling filename. (only accepts .bvec and .bval ' 'together or only .b).') p.add_argument('--dis-sym', action='store_false', dest='enable_sym', help='Disable antipodal symmetry.') p.add_argument('--out_basename', help='Output file name picture without extension ' + '(will be png file(s)).') p.add_argument('--res', type=int, default=300, help='Resolution of the output picture(s).') g1 = p.add_argument_group(title='Enable/Disable renderings.') g1.add_argument('--dis-sphere', action='store_false', dest='enable_sph', help='Disable the rendering of the sphere.') g1.add_argument('--dis-proj', action='store_false', dest='enable_proj', help='Disable rendering of the projection supershell.') g1.add_argument('--plot_shells', action='store_true', help='Enable rendering each shell individually.') g2 = p.add_argument_group(title='Rendering options.') g2.add_argument('--same-color', action='store_true', dest='same_color', help='Use same color for all shell.') g2.add_argument('--opacity', type=float, default=1.0, help='Opacity for the shells.') add_overwrite_arg(p) add_verbose_arg(p) return p
def _build_arg_parser(): p = argparse.ArgumentParser( formatter_class=argparse.RawTextHelpFormatter, description=__doc__, ) p.add_argument('in_matrix', help='Input connectivity matrix. This is typically a ' 'streamline_count matrix (.npy).') p.add_argument('out_matrix', help='Output normalized matrix (.npy).') edge_p = p.add_argument_group('Edge-wise options') length = edge_p.add_mutually_exclusive_group() length.add_argument('--length', metavar='LENGTH_MATRIX', help='Length matrix used for ' 'edge-wise multiplication.') length.add_argument('--inverse_length', metavar='LENGTH_MATRIX', help='Length matrix used for edge-wise division.') edge_p.add_argument('--bundle_volume', metavar='VOLUME_MATRIX', help='Volume matrix used for edge-wise division.') vol = edge_p.add_mutually_exclusive_group() vol.add_argument('--parcel_volume', nargs=2, metavar=('ATLAS', 'LABELS_LIST'), help='Atlas and labels list for edge-wise division.') vol.add_argument('--parcel_surface', nargs=2, metavar=('ATLAS', 'LABELS_LIST'), help='Atlas and labels list for edge-wise division.') scaling_p = p.add_argument_group('Scaling options') scale = scaling_p.add_mutually_exclusive_group() scale.add_argument('--max_at_one', action='store_true', help='Scale matrix with maximum value at one.') scale.add_argument('--sum_to_one', action='store_true', help='Scale matrix with sum of all elements at one.') scale.add_argument('--log_10', action='store_true', help='Apply a base 10 logarithm to the matrix.') add_overwrite_arg(p) return p
def _build_arg_parser(): p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('in_sh', help='Path of the SH volume.') p.add_argument('out_sf', help='Name of the output SF file to save (bvals/bvecs will ' 'be automatically named when necessary).') # Sphere vs bvecs choice for SF directions = p.add_mutually_exclusive_group(required=True) directions.add_argument('--sphere', choices=sorted(SPHERE_FILES.keys()), help='Sphere used for the SH to SF projection. ') directions.add_argument( '--in_bvec', help="Directions used for the SH to SF projection.") p.add_argument('--dtype', default="float32", choices=["float32", "float64"], help="Datatype to use for SF computation and output array." "'[%(default)s]'") # Optional args for a DWI-like volume p.add_argument('--in_bval', help='b-value file, in FSL format, ' 'used to assign a b-value to the ' 'output SF and generate a `.bval` file.') p.add_argument('--in_b0', help='b0 volume to concatenate to the ' 'final SF volume.') p.add_argument('--out_bval', help="Optional output bval file.") p.add_argument('--out_bvec', help="Optional output bvec file.") p.add_argument('--b0_scaling', action="store_true", help="Scale resulting SF by the b0 image.") add_sh_basis_args(p) p.add_argument('--full_basis', action="store_true", help="If true, use a full basis for the input SH " "coefficients.") add_processes_arg(p) add_overwrite_arg(p) add_force_b0_arg(p) return p
def _build_arg_parser(): p = argparse.ArgumentParser( formatter_class=argparse.RawTextHelpFormatter, description=__doc__, epilog="""Garyfallidis, E., Côté, M. A., Rheault, F., ... & Descoteaux, M. (2018). Recognition of white matter bundles using local and global streamline-based registration and clustering. NeuroImage, 170, 283-295.""") p.add_argument('in_tractogram', help='Input tractogram filename (trk or tck).') p.add_argument('in_model', help='Model to use for recognition (trk or tck).') p.add_argument('transformation', help='Path for the transformation to model space.') p.add_argument('output_name', help='Output tractogram filename.') p.add_argument('--tractogram_clustering_thr', type=float, default=8, help='Clustering threshold used for the whole brain ' '[%(default)smm].') p.add_argument('--model_clustering_thr', type=float, default=4, help='Clustering threshold used for the model ' '[%(default)smm].') p.add_argument('--pruning_thr', type=float, default=6, help='MDF threshold used for final streamlines selection ' '[%(default)smm].') p.add_argument('--slr_threads', type=int, default=None, help='Number of threads for SLR [all].') p.add_argument('--seed', type=int, default=None, help='Random number generator seed [%(default)s].') p.add_argument('--inverse', action='store_true', help='Use the inverse transformation.') p.add_argument('--no_empty', action='store_true', help='Do not write file if there is no streamline.') group = p.add_mutually_exclusive_group() group.add_argument('--input_pickle', help='Input pickle clusters map file.\n' 'Will override the tractogram_clustering_thr parameter.') group.add_argument('--output_pickle', help='Output pickle clusters map file.') add_reference_arg(p) add_verbose_arg(p) add_overwrite_arg(p) return p
def _build_arg_parser(): p = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=__doc__) p.add_argument('in_tractogram', help='Input tractography file.') p.add_argument('out_tractogram', help='Output tractography file.') p.add_argument('--seed', type=int, default=None, help='Random number generator seed [%(default)s].') add_reference_arg(p) add_overwrite_arg(p) return p
def _build_arg_parser(): p = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('in_bundle', help='Fiber bundle file.') p.add_argument('in_metrics', nargs='+', help='Nifti metric(s) to compute statistics on.') p.add_argument('out_folder', help='Folder where to save endpoints metric.') add_reference_arg(p) add_overwrite_arg(p) return p
def _build_arg_parser(): parser = argparse.ArgumentParser( description='Compute bundle volume per label', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('voxel_label_map', help='Fiber bundle file') parser.add_argument('bundle_name', help='Bundle name') parser.add_argument('--indent', type=int, default=2, help='Indent for json pretty print') parser.add_argument('--sort_keys', action='store_true', help='Sort keys in output json') add_overwrite_arg(parser) return parser
def _build_arg_parser(): p = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) p.add_argument('in_bundle', help='Fiber bundle file.') p.add_argument('out_centroid', help='Output centroid streamline filename.') p.add_argument('--nb_points', type=int, default=20, help='Number of points defining the centroid streamline.') add_reference_arg(p) add_overwrite_arg(p) return p
def _build_arg_parser(): p = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=__doc__) p.add_argument('in_matrix', help='Binary matrix in numpy (.npy) format.\n' 'Typically from scil_filter_connectivity.py') p.add_argument('labels_list', help='List saved by the decomposition script.') p.add_argument('out_txt', help='Output text file containing all filenames.') add_overwrite_arg(p) return p
def _build_arg_parser(): parser = argparse.ArgumentParser( description='Outlier removal of streamlines', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('bundle', help='Fiber bundle file to remove outliers from') parser.add_argument( 'filtered_bundle', help='Fiber bundle without outliers') parser.add_argument('outliers', help='Removed outliers') parser.add_argument( '--alpha', type=float, default=0.6, help='Percent of the length of the tree that clusters of individual ' 'streamlines will be pruned') add_overwrite_arg(parser) return parser
def _build_arg_parser(): p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('frf_files', metavar='list', nargs='+', help='List of FRF filepaths.') p.add_argument('mean_frf', metavar='file', help='Path of the output mean FRF file.') add_overwrite_arg(p) return p
def _build_arg_parser(): p = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('in_hdf5', nargs='+', help='List of HDF5 filenames (.h5) from ' 'scil_decompose_connectivity.py.') p.add_argument('out_dir', help='Path of the output directory.') p.add_argument('--binary', action='store_true', help='Binarize density maps before the population average.') add_processes_arg(p) add_overwrite_arg(p) return p
def _build_arg_parser(): p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawTextHelpFormatter) p.add_argument('in_tractogram', help='Tractogram.') p.add_argument('out_tractogram', help='Colored TRK tractogram.') p.add_argument('color', help='Can be either hexadecimal (ie. "#RRGGBB" ' 'or 0xRRGGBB).') add_reference_arg(p) add_overwrite_arg(p) return p