void usage_SurfInfo (SUMA_GENERIC_ARGV_PARSE *ps) { static char FuncName[]={"usage_SurfInfo"}; char * s = NULL, *sio=NULL, *st = NULL, *sts = NULL; int i; SUMA_ENTRY; s = SUMA_help_basics(); sio = SUMA_help_IO_Args(ps); printf ( "\n" "Usage: SurfInfo [options] <surface> \n" " surface: A surface specified in any of the methods \n" " shown below.\n" " Optional Params:\n" " -detail DETAIL: 1 = calculate surface metrics.\n" " -debug DEBUG: Debugging level (2 turns LocalHead ON)\n" " Specific Info: Using any of these options outputs values\n" " only for the specified parameters.\n" " -N_Node: Number of nodes\n" " -N_FaceSet or -N_Tri: Number of triangles.\n" " -COM: Center of mass\n" " \n" " -quiet: Do not include name of parameter in output.\n" " -sep SEP: Use string SEP to separate parameter values.\n" " Default is ' ; '\n" "%s" "%s" "\n", sio, s); SUMA_free(s); s = NULL; SUMA_free(st); st = NULL; SUMA_free(sio); sio = NULL; s = SUMA_New_Additions(0, 1); printf("%s\n", s);SUMA_free(s); s = NULL; printf(" Ziad S. Saad SSCC/NIMH/NIH [email protected] \n"); exit(0); }
void usage_SpharmReco (SUMA_GENERIC_ARGV_PARSE *ps) { static char FuncName[]={"usage_SpharmReco"}; char * s = NULL, *sio=NULL, *st = NULL, *sts = NULL; int i; s = SUMA_help_basics(); sio = SUMA_help_IO_Args(ps); printf ( "\n" "Spherical Harmonics Reconstruction from a set of harmonics \n" "and their corresponding coefficients.\n" "\n" "Usage: \n" " SpharmReco <-i_TYPE S> <-l L>\n" " <-bases_prefix BASES>\n" " <-coef BETA.0> <-coef BETA.1> ...\n" " [<-prefix PREFIX>] [<-o_TYPE SDR> ...]\n" " [-debug DBG] [-sigma s]\n" "Input:\n" " -i_TYPE SURF: SURF is a surface that is only used to provide\n" " the topology of the mesh (the nodes' connections)\n" " -l L: Decomposition order\n" " -bases_prefix BASES_PREFIX: Files containing the bases functions (spherical\n" " harmonics). See SpharmDeco for generating these\n" " files.\n" " -coef COEF.n: BETA.n is the coefficients file that is used to recompose \n" " the nth data column. These files are created with SpharmDeco.\n" " You can specify N coefficient files by repeating the \n" " option on command line. If N is a multiple \n" " of three AND you use -o_TYPE option, then each three \n" " consecutive files are considered to form the XYZ coordinates\n" " of a surface. See sample commands in @Spharm.examples \n" " -prefix PREFIX: Write out the reconstructed data into dataset PREFIX. \n" " the output dataset contains N columns; one for each of the\n" " COEF.n files.\n" " -o_TYPE SDR: Write out a new surface with reconstructed coordinates.\n" " This requires N to be a multiple of 3, so 6 -coef options\n" " will result in 2 surfaces written to disk. The naming of the\n" " surfaces depends on the number of -o_TYPE options used, much \n" " like in SpharmDeco\n" " -debug DBG: Debug levels (1-3)\n" " -sigma s: Smoothing parameter (0 .. 0.001) which weighs down the \n" " contribution of higher order harmonics.\n" "\n" "-----------------------------------------------------------------------\n" " For more detail, references, and examples, see script @Spharm.examples \n" "-----------------------------------------------------------------------\n" "\n" "%s" "%s" "\n", sio, s); SUMA_free(s); s = NULL; SUMA_free(st); st = NULL; SUMA_free(sio); sio = NULL; s = SUMA_New_Additions(0, 1); printf("%s\n", s);SUMA_free(s); s = NULL; printf(" Ziad S. Saad SSCC/NIMH/NIH [email protected] \n"); exit(0); }
void usage_SUMA_quickspec(SUMA_GENERIC_ARGV_PARSE *ps) { static char FuncName[]={"usage_SUMA_quickspec"}; char * s = NULL, *sio=NULL; sio = SUMA_help_IO_Args(ps); printf ( "\nUsage: quickspec \n" " <-tn TYPE NAME> ...\n" " <-tsn TYPE STATE NAME> ...\n" " [<-spec specfile>] [-h/-help]\n" " Use this spec file for quick and dirty way of \n" " loading a surface into SUMA or the command line programs.\n" "\n" "Options:\n" "%s\n" " -tsnad TYPE STATE NAME ANATFLAG LDP: \n" " specify surface type, state, name, anatomical correctness, \n" " and its Local Domain Parent.\n" " ANATFLAG: 'Y' if surface is anatomically correct (default).\n" " 'N' if it is not anatomically correct.\n" " LDP: Name of Local Domain Parent surface.\n" " Use SAME (default) if surface is its own LDP.\n" " -tsnadm TYPE STATE NAME ANATFLAG LDP MARKER: \n" " specify surface type, state, name, anatomical correctness, \n" " Local Domain Parent, and node marker file.\n" " MARKER: A niml.do Displayable Object (DO) to put at every\n" " node of the surface. See @DO.examples for information\n" " about displayable objects\n" " -tsnadl TYPE STATE NAME ANATFLAG LDP LABELDSET: \n" " specify surface type, state, name, anatomical correctness, \n" " Local Domain Parent, and a label dataset file.\n" " LABELDSET: A surface dataset containing node labels.\n" " -spec specfile: Name of spec file output.\n" " Default is quick.spec\n" " The program will only overwrite \n" " quick.spec (the default) spec file.\n" " -h or -help: This message here.\n" "\n" " You can use any combinaton of -tn and -tsn options.\n" " Fields in the spec file that are (or cannot) be specified\n" " by this program are set to default values.\n" "\n This program was written to ward off righteous whiners and is\n" " not meant to replace the venerable @SUMA_Make_Spec_XX scripts.\n" "\n" , sio); SUMA_free(sio); sio = NULL; s = SUMA_New_Additions(0, 1); printf("%s\n", s);SUMA_free(s); s = NULL; printf(" Ziad S. Saad SSCC/NIMH/NIH [email protected] \n\t\t Tue Dec 30\n" "\n"); return; }
void usage_SUMA_SampBias (SUMA_GENERIC_ARGV_PARSE *ps) { static char FuncName[]={"usage_SUMA_SampBias"}; char * s = NULL, *sio=NULL, *st = NULL, *sts = NULL; s = SUMA_help_basics(); sio = SUMA_help_IO_Args(ps); printf ( "\nUsage:\n" " SampBias -spec SPECFILE -surf SURFNAME -plimit limit -dlimit limit -out FILE\n" "\n" " Mandatory parameters:\n" " -spec SpecFile: Spec file containing input surfaces.\n" " -surf SURFNAME: Name of input surface \n" " -plimit limit: maximum length of path along surface in mm.\n" " default is 50 mm\n" " -dlimit limit: maximum length of euclidean distance in mm.\n" " default is 1000 mm\n" " -out FILE: output results in .1D format.\n" " -prefix PREFIX: output results into a proper surface-based\n" " dataset. A more modern version of -out.\n" "\n" " NOTE: FILE and PREFIX (below) have differing numbers\n" " of columns.\n" "\n" " -segdo SEGDO: Output a displayable object file that contains\n" " segments between paired nodes.\n" " See 'Ctrl+Alt+s' in SUMA's interactive help\n" " Example:\n" " SampBias -i std12.lh.smoothwm.asc \\\n" " -segdo std12.sampbias.lh \\\n" " -prefix std12.sampbias.lh \n" "\n" "\n" "%s" "%s" "\n", ps->hverb > 1 ? sio:"Use -help for more detail.\n", ps->hverb > 1 ? s:""); if (s) SUMA_free(s); s = NULL; if (st) SUMA_free(st); st = NULL; if (sio) SUMA_free(sio); sio = NULL; #if 0 s = SUMA_New_Additions(0, 1); printf("%s\n", s);SUMA_free(s); s = NULL; #endif printf(" blame Ziad S. Saad SSCC/NIMH/NIH [email protected] \n"); return ; }
void usage_SurfMatch (SUMA_GENERIC_ARGV_PARSE *ps, int detail) { static char FuncName[]={"usage_SurfMatch"}; char * s = NULL, *sio=NULL, *st = NULL, *sts = NULL; int i; s = SUMA_help_basics(); sio = SUMA_help_IO_Args(ps); printf ( "\n" "Usage: SurfMatch <-i_TYPE BASE> <-i_TYPE INSURF> <-prefix PREFIX> \n" " [-sv SURF_VOL] [-warp WARP]\n" " -i_TYPE BASE: BASE is the reference surface to which nodes will be\n" " registered. The BASE surface is the first surface on the\n" " command line.\n" " -i_TYPE INSURF: Surface whose nodes will be affine transformed as to\n" " minimize their shortest distance to BASE.\n" " -depthlimit DL: Exclude from cost computations nodes in INSURF that \n" " are more than DL from the top node along the principal\n" " direction closest to the Z axis.\n" " -reduce_ref RED: Reduce first mesh to speed up computations.\n" " If RED is between 0 and 1.0, then the new surface\n" " will approximately have RED * N_Nodes\n" " If RED > 1.0 then RED is the approximate number of\n" " nodes in the reduced mesh.\n" " -warp WARP: Set the type of affine warp allowed. \n" " Choose from the following:\n" " sho: For shift only.\n" " sro: For shift + rotate\n" " srs: For shift + rotate + scale\n" /* " aff: For affine general.\n" */ " -city: Use City Block instead of Euclidian distance\n" "\n" /* Need an option that just takes point, not necessarily a second surface. Need an option to provide cmask */ "Example:\n" " SurfMatch -i std.6rh.pial.asc -i std.6lh.pial.asc -warp sro\n" " suma -onestate -i std.6rh.pial.asc -i std.6lh.pial.asc \\\n" " -i SurfMatch.gii \n" "\n"); SUMA_free(s); s = NULL; SUMA_free(st); st = NULL; SUMA_free(sio); sio = NULL; printf(" Ziad S. Saad SSCC/NIMH/NIH [email protected] \n"); exit(0); }
void usage_3dBRAIN_VOYAGERtoAFNI (SUMA_GENERIC_ARGV_PARSE *ps) { static char FuncName[]={"usage_3dBRAIN_VOYAGERtoAFNI"}; char * s = NULL, *sio=NULL, *st = NULL, *sts = NULL; int i; s = SUMA_help_basics(); sio = SUMA_help_IO_Args(ps); printf ( "\n" "Usage: 3dBRAIN_VOYAGERtoAFNI <-input BV_VOLUME.vmr> \n" " [-bs] [-qx] [-tlrc|-acpc|-orig] [<-prefix PREFIX>]\n" " \n" " Converts a BrainVoyager vmr dataset to AFNI's BRIK format\n" " The conversion is based on information from BrainVoyager's\n" " website: www.brainvoyager.com. \n" " Sample data and information provided by \n" " Adam Greenberg and Nikolaus Kriegeskorte.\n" "\n" " If you get error messages about the number of\n" " voxels and file size, try the options below.\n" " I hope to automate these options once I have\n" " a better description of the BrainVoyager QX format.\n" "\n" " Optional Parameters:\n" " -bs: Force byte swapping.\n" " -qx: .vmr file is from BrainVoyager QX\n" " -tlrc: dset in tlrc space\n" " -acpc: dset in acpc-aligned space\n" " -orig: dset in orig space\n" " If unspecified, the program attempts to guess the view from\n" " the name of the input.\n" "%s" "%s" "\n", sio, s); SUMA_free(s); s = NULL; SUMA_free(st); st = NULL; SUMA_free(sio); sio = NULL; s = SUMA_New_Additions(0, 1); printf("%s\n", s);SUMA_free(s); s = NULL; printf(" Ziad S. Saad SSCC/NIMH/NIH [email protected] \n"); exit(0); }
void SUMA_usage (SUMA_GENERIC_ARGV_PARSE *ps, int detail) {/*Usage*/ char *sb = NULL, *sio = NULL, *ssym=NULL; ssym = SUMA_help_SPEC_symbolic(); sb = SUMA_help_basics(); sio = SUMA_help_IO_Args(ps); printf ( "\nUsage: \n" " Mode 0: Just type suma to see some toy surface and play\n" " with the interface. Some surfaces are generated\n" " using T. Lewiner's MarchingCubes library. \n" " Use '.' and ',' keys to cycle through surfaces.\n" "\n" " Mode 1: Using a spec file to specify surfaces\n" " suma -spec <Spec file> \n" " [-sv <SurfVol>] [-ah AfniHost]\n" "\n" " Mode 2: Just show me the money\n" " suma <-i SomeSurface> \n" " [-sv <SurfVol>] [-ah AfniHost]\n" "\n" "\n%s", detail ? "":"use -h or -help for more help detail.\n"); if (detail) { printf ( " Mode 1:\n" " -spec <Spec file>: File containing surface specification. \n" " This file is typically generated by \n" " @SUMA_Make_Spec_FS (for FreeSurfer surfaces) or \n" " @SUMA_Make_Spec_SF (for SureFit surfaces). \n" " The Spec file should be located in the directory \n" " containing the surfaces.\n" "%s\n" " [-sv <SurfVol>]: Anatomical volume used in creating the surface \n" " and registerd to the current experiment's anatomical \n" " volume (using @SUMA_AlignToExperiment). \n" " This parameter is optional, but linking to AFNI is \n" " not possible without it.If you find the need for it \n" " (as some have), you can specify the SurfVol in the \n" " specfile. You can do so by adding the field \n" " SurfaceVolume to each surface in the spec file. \n" " In this manner, you can have different surfaces using\n" " different surface volumes.\n" " [-ah AfniHost]: Name (or IP address) of the computer running AFNI. \n" " This parameter is optional, the default is localhost.\n" " When both AFNI and SUMA are on the same computer, \n" " communication is through shared memory. \n" " You can turn that off by explicitly setting AfniHost\n" " to 127.0.0.1\n" " [-niml]: Start listening for communications with NIML-formatted elements.\n" " Environment variable SUMA_START_NIML can also be used to start\n" " listening.\n" " [-noniml]: Do not start listening for communications with NIML-formatted\n" " elements, even if env. SUMA_START_NIML is set to YES\n" "\n" " Mode 2: Using -t_TYPE or -t* options to specify surfaces on command line.\n" " -sv, -ah, -niml and -dev are still applicable here. This mode \n" " is meant to simplify the quick viewing of a surface model.\n" " suma [-i_TYPE surface] [-t* surface] \n" " Surfaces specified on command line are place in a group\n" " called 'DefGroup'.\n" " If you specify nothing on command line, you will have a random\n" " surface created for you. Some of these surfaces are generated\n" " using Thomas Lewiner's sample volumes for creating isosurfaces.\n" " See suma -sources for a complete reference.\n" "\n" "%s" "\n" " Modes 1 & 2: You can mix the two modes for loading surfaces but the -sv\n" " option may not be properly applied.\n" " If you mix these modes, you will have two groups of\n" " surfaces loaded into SUMA. You can switch between them\n" " using the 'Switch Group' button in the viewer controller.\n" "\n" "%s" /*" [-iodbg] Trun on the In/Out debug info from the start.\n" " [-memdbg] Turn on the memory tracing from the start.\n" */ " [-visuals] Shows the available glxvisuals and exits.\n" " [-brethren_windows] For Testing Only. Show a listing of windows possibly \n" " related to AFNI and SUMA.\n" " [-version] Shows the current version number.\n" " [-environment] Shows a list of all environment variables, \n" " their default setting and your current setting.\n" " The output can be used as a new .sumarc file.\n" " Since it takes into consideration your own settings\n" " this command can be used to update your .sumarc \n" " regularly with a csh command like this:\n" "\n" " suma -environment > ~/sumarc && \\\n" " cp ~/.sumarc ~/.sumarc-bak ; \\\n" " mv ~/sumarc ~/.sumarc\n" "\n" "\n" " [-drive_com DRIVE_SUMA_COM]: Drive suma with command DRIVE_SUMA_COM,\n" " which has the same syntax that you would use for DriveSuma.\n" " For instance:\n" "\n" " suma -i ld120 -drive_com '-com surf_cont -view_surf_cont y'\n" " or \n" " suma -drive_com '-com viewer_cont -key 'F12' -com kill_suma'\n" "\n" " You can use repeated instances of -drive_com to have a series\n" " of commands that get executed in the order in which they appear\n" " on the command line.\n" "\n" "\n" "%s", (detail > 1) ? ssym:" use -help for more detail on loading template surfaces with symbolic notation\n" , (detail > 1) ? sio:" use -help for more detail on input options\n" , (detail > 1) ? sb:" use -help for more detail on basic options\n", (detail > 1) ? get_np_help(): " use -help for more detail on communication ports\n"); if (detail > 1) { printf( "-help_interactive: Write the help for interactive usage into file\n" " Mouse_Keyboard_Controls.txt\n" "-help_sphinx_interactive HOUT: Write the help for interactive usage into \n" " SPHINX formatted file HOUT" "See DriveSuma's -write_*_help options for more\n" "-test_help_string_edit: Show example of help string editing and quit\n" "-test_help_string_edit_web: Like its prefix, but nicer for webpage.\n"); } if (detail > 1) { printf( " [-list_ports] List all port assignments and quit\n" " [-port_number PORT_NAME]: Give port number for PORT_NAME and quit\n" " [-port_number_quiet PORT_NAME]: Same as -port_number but writes out \n" " number only\n" " [-dev]: Allow access to options that are not well polished for\n" " mass consuption.\n" " [-fake_cmap]: Use X11 to render cmap. This is only needed to get colorbar\n" " to appear when the frame is automatically captured by SUMA\n" " for making documentation. This option has no other use.\n" " [-update_env] Performs the set operations detailed under -environment\n" " [-default_env] Output hard coded default environment values, ignoring\n" " user settings.\n" " [-latest_news] Shows the latest news for the current \n" " version of the entire SUMA package.\n" " [-all_latest_news] Shows the history of latest news.\n" " [-progs] Lists all the programs in the SUMA package.\n" " [-motif_ver] Displays the linked version of Motif.\n" " [-sources] Lists code sources used in parts of SUMA.\n" " [-help_nido] Help message for displayable objects of type NIDO\n" "\n" " For help on interacting with SUMA, press 'ctrl+h' with the mouse \n" " pointer inside SUMA's window.\n" " For more help: http://afni.nimh.nih.gov/pub/dist/edu/latest/suma/suma.pdf\n" "\n" " If you can't get help here, please get help somewhere.\n" ); } } SUMA_free(sb); SUMA_free(sio); SUMA_free(ssym); if (detail) { SUMA_Version(NULL); printf ("\n" "\n Ziad S. Saad SSCC/NIMH/NIH [email protected] \n\n"); } return; }/*Usage*/
void usage_SurfToSurf (SUMA_GENERIC_ARGV_PARSE *ps, int detail) { static char FuncName[]={"usage_SurfToSurf"}; char * s = NULL, *sio=NULL, *st = NULL, *sts = NULL; int i; s = SUMA_help_basics(); sio = SUMA_help_IO_Args(ps); printf ( "\n" "Usage: SurfToSurf <-i_TYPE S1> [<-sv SV1>]\n" " <-i_TYPE S2> [<-sv SV1>]\n" " [<-prefix PREFIX>]\n" " [<-output_params PARAM_LIST>]\n" " [<-node_indices NODE_INDICES>]\n" " [<-proj_dir PROJ_DIR>]\n" " [<-data DATA>]\n" " [<-node_debug NODE>]\n" " [<-debug DBG_LEVEL>]\n" " [-make_consistent]\n" " [<-dset DSET>]\n" " [<-mapfile MAP_INFO>]\n" " \n" " This program is used to interpolate data from one surface (S2)\n" " to another (S1), assuming the surfaces are quite similar in\n" " shape but having different meshes (non-isotopic).\n" " This is done by projecting each node (nj) of S1 along the normal\n" " at nj and finding the closest triangle t of S2 that is intersected\n" " by this projection. Projection is actually bidirectional.\n" " If such a triangle t is found, the nodes (of S2) forming it are \n" " considered to be the neighbors of nj.\n" " Values (arbitrary data, or coordinates) at these neighboring nodes\n" " are then transfered to nj using barycentric interpolation or \n" " nearest-node interpolation.\n" " Nodes whose projections fail to intersect triangles in S2 are given\n" " nonsensical values of -1 and 0.0 in the output.\n" "\n" " Mandatory input:\n" " Two surfaces are required at input. See -i_TYPE options\n" " below for more information. \n" "\n" " Optional input:\n" " -prefix PREFIX: Specify the prefix of the output file.\n" " The output file is in 1D format at the moment.\n" " Default is SurfToSurf\n" " -output_params PARAM_LIST: Specify the list of mapping\n" " parameters to include in output\n" " PARAM_LIST can have any or all of the following:\n" " NearestTriangleNodes: Use Barycentric interpolation (default)\n" " and output indices of 3 nodes from S2\n" " that neighbor nj of S1\n" " NearestNode: Use only the closest node from S2 (of the three \n" " closest neighbors) to nj of S1 for interpolation\n" " and output the index of that closest node.\n" " NearestTriangle: Output index of triangle t from S2 that\n" " is the closest to nj along its projection\n" " direction. \n" " DistanceToSurf: Output distance (signed) from nj, along \n" " projection direction to S2.\n" " This is the parameter output by the precursor\n" " program CompareSurfaces\n" " ProjectionOnSurf: Output coordinates of projection of nj onto \n" " triangle t of S2.\n" " NearestNodeCoords: X Y Z coordinates of closest node on S2\n" " Data: Output the data from S2, interpolated onto S1\n" " If no data is specified via the -data option, then\n" " the XYZ coordinates of SO2's nodes are considered\n" " the data.\n" " -data DATA: 1D file containing data to be interpolated.\n" " Each row i contains data for node i of S2.\n" " You must have one row for each node making up S2.\n" " In other terms, if S2 has N nodes, you need N rows\n" " in DATA. \n" " Each column of DATA is processed separately (think\n" " sub-bricks, and spatial interpolation).\n" " You can use [] selectors to choose a subset \n" " of columns.\n" " If -data option is not specified and Data is in PARAM_LIST\n" " then the XYZ coordinates of SO2's nodes are the data.\n" " -dset DSET: Treat like -data, but works best with datasets, preserving\n" " header information in the output.\n" " -dset and -data are mutually exclusive.\n" " Also, -dset and parameter Data cannot be mixed.\n" " -node_indices NODE_INDICES: 1D file containing the indices of S1\n" " to consider. The default is all of the\n" " nodes in S1. Only one column of values is\n" " allowed here, use [] selectors to choose\n" " the column of node indices if NODE_INDICES\n" " has multiple columns in it.\n" " -proj_dir PROJ_DIR: 1D file containing projection directions to use\n" " instead of the node normals of S1.\n" " Each row should contain one direction for each\n" " of the nodes forming S1.\n" " -closest_possible OO: Flag allowing the substitution of the projection\n" " result with the closest node that could be found\n" " along any direction.\n" " 0: Don't do that, direction results only.\n" " 1: Use closest node if projection fails to hit target\n" " 2: Use closest node if it is at a closer distance.\n" " 3: Use closest and don't bother with projections.\n" " -make_consistent: Force a consistency check and correct triangle \n" " orientation of S1 if needed. Triangles are also\n" " oriented such that the majority of normals point\n" " away from center of surface.\n" " The program might not succeed in repairing some\n" " meshes with inconsistent orientation.\n" " -mapfile MAP_INFO: Use the mapping from S2 to S1 that is stored in\n" " MAP_INFO. MAP_INFO is a file containing the mapping\n" " parameters between surfaces S2 and S1. \n" " It is generated automatically by SurfToSurf when \n" " -mapfile is not used, and saved under PREFIX.niml.M2M.\n" " Reusing the MAP_INFO file allows for faster execution\n" " of SurfToSurf the next time around, assuming of course\n" " that the two surfaces involved are the same, and that \n" " only the input data differs.\n" " MAP_INFO is also generated by MapIcosahedron.\n" "\n" "%s" "%s" "\n", sio, s); SUMA_free(s); s = NULL; SUMA_free(st); st = NULL; SUMA_free(sio); sio = NULL; s = SUMA_New_Additions(0, 1); printf("%s\n", s);SUMA_free(s); s = NULL; printf(" Ziad S. Saad SSCC/NIMH/NIH [email protected] \n" " Shruti Japee LBC/NIMH/NIH [email protected] \n"); exit(0); }
void usage_SUMA_SurfQual (SUMA_GENERIC_ARGV_PARSE *ps, int detail) { static char FuncName[]= {"usage_SUMA_SurfQual"}; char * s = NULL, *sio=NULL; s = SUMA_help_basics(); sio = SUMA_help_IO_Args(ps); printf ( "\nUsage: A program to check the quality of surfaces.\n" " SurfQual <-spec SpecFile> <-surf_A insurf> <-surf_B insurf> ...\n" " <-sphere> [-self_intersect] [-prefix OUTPREF] \n" "\n%s", detail ? "":"use -h or -help for more help detail.\n"); if (detail) { printf ( " Mandatory parameters:\n" " -spec SpecFile: Spec file containing input surfaces.\n" " -surf_X: Name of input surface X where X is a character\n" " from A to Z. If surfaces are specified using two\n" " files, use the name of the node coordinate file.\n" " Mesh winding consistency and 2-manifold checks are performed\n" " on all surfaces.\n" " Optional parameters:\n" " -summary: Provide summary of results to stdout\n" " -self_intersect: Check if surface is self intersecting.\n" " This option is rather slow, so be patient.\n" " In the presence of intersections, the output file\n" " OUTPREF_IntersNodes.1D.dset will contain the indices\n" " of nodes forming segments that intersect the surface.\n" " Most other checks are specific to spherical surfaces (see option below).\n" " -sphere: Indicates that surfaces read are spherical.\n" " With this option you get the following output.\n" " - Absolute deviation between the distance (d) of each\n" " node from the surface's center and the estimated\n" " radius(r). The distances, abs (d - r), are \n" " and written to the file OUTPREF_Dist.1D.dset .\n" " The first column represents node index and the \n" " second is the absolute distance. A colorized \n" " version of the distances is written to the file \n" " OUTPREF_Dist.1D.col (node index followed \n" " by r g b values). A list of the 10 largest absolute\n" " distances is also output to the screen.\n" " - Also computed is the cosine of the angle between \n" " the normal at a node and the direction vector formed\n" " formed by the center and that node. Since both vectors\n" " are normalized, the cosine of the angle is the dot product.\n" " On a sphere, the abs(dot product) should be 1 or pretty \n" " close. Nodes where abs(dot product) < 0.9 are flagged as\n" " bad and written out to the file OUTPREF_BadNodes.1D.dset .\n" " The file OUTPREF_dotprod.1D.dset contains the dot product \n" " values for all the nodes. The files with colorized results\n" " are OUTPREF_BadNodes.1D.col and OUTPREF_dotprod.1D.col .\n" " A list of the bad nodes is also output to the screen for\n" " convenience. You can use the 'j' option in SUMA to have\n" " the cross-hair go to a particular node. Use 'Alt+l' to\n" " have the surface rotate and place the cross-hair at the\n" " center of your screen.\n" " NOTE: For detecting topological problems with spherical\n" " surfaces, I find the dot product method to work best.\n" " Optional parameters:\n" " -prefix OUTPREF: Prefix of output files. If more than one surface\n" " are entered, then the prefix will have _X added\n" " to it, where X is a character from A to Z.\n" " THIS PROGRAM WILL OVERWRITE EXISTING FILES.\n" " Default prefix is the surface's label.\n" "\n" " Comments:\n" " - The colorized (.col) files can be loaded into SUMA (with the 'c' \n" " option. By focusing on the bright spots, you can find trouble spots\n" " which would otherwise be very difficult to locate.\n" " - You should also pay attention to the messages output when the \n" " surfaces are being loaded, particularly to edges (segments that \n" " join 2 nodes) are shared by more than 2 triangles. For a proper\n" " closed surface, every segment should be shared by 2 triangles. \n" " For cut surfaces, segments belonging to 1 triangle only form\n" " the edge of that surface.\n" " - There are no utilities within SUMA to correct these defects.\n" " It is best to fix these problems with the surface creation\n" " software you are using.\n" " - Some warnings may be redundant. That should not hurt you.\n" "%s" "\n" "%s" "\n", (detail > 1) ? sio : "Use -help for I/O and miscellaneous options." , (detail > 1) ? s : ""); } if (sio) SUMA_free(sio); s = NULL; if (s) SUMA_free(s); s = NULL; if (detail) { s = SUMA_New_Additions(0, 1); printf("%s\n", s); SUMA_free(s); s = NULL; printf(" Ziad S. Saad SSCC/NIMH/NIH [email protected] \n"); } return; }
void usage_SUMA_getPatch (SUMA_GENERIC_ARGV_PARSE *ps, int detail) { static char FuncName[]={"usage_SUMA_getPatch"}; char * s = NULL, *sio=NULL; s = SUMA_help_basics(); sio = SUMA_help_IO_Args(ps); printf ( "\nUsage:\n" " SurfPatch <-spec SpecFile> <-surf_A insurf> <-surf_B insurf> ...\n" " <-input nodefile inode ilabel> <-prefix outpref> \n" " [-hits min_hits] [-masklabel msk] [-vol] [-patch2surf]\n" " [-vol_only] [-coord_gain] [-check_bowtie] [-fix_bowtie] \n" " [-ok_bowtie] [-adjust_contour] [-do-not-adjust_contour] \n" " [-stiched_surface SURF] \n" "\n%s", detail ? "":"use -h or -help for more help detail.\n"); if (detail) { printf ( "Usage 1:\n" " The program creates a patch of surface formed by nodes \n" " in nodefile.\n" " The program can also be used to calculate the volume between the same patch\n" " on two isotopic surfaces. See -vol option below.\n" "\n" " -spec SpecFile: Spec file containing input surfaces.\n" " -surf_X: Name of input surface X where X is a character\n" " from A to Z. If surfaces are specified using two\n" " files, use the name of the node coordinate file.\n" " -input nodefile inode ilabel: \n" " nodefile is the file containing nodes defining the patch.\n" " inode is the index of the column containing the nodes\n" " ilabel is the index of the column containing labels of\n" " the nodes in column inode. If you want to use\n" " all the nodes in column indode, then set this \n" " parameter to -1 (default). \n" " If ilabel is not equal to 0 then the corresponding \n" " node is used in creating the patch.\n" " See -masklabel option for one more variant.\n" " -prefix outpref: Prefix of output patch. If more than one surface\n" " are entered, then the prefix will have _X added\n" " to it, where X is a character from A to Z.\n" " Output format depends on the input surface's.\n" " With that setting, checking on pre-existing files\n" " is only done before writing the new patch, which is\n" " annoying. You can set the output type ahead of time\n" " using -out_type option. This way checking for \n" " pre-existing output files can be done at the outset.\n" " -vol: Calculate the volume formed by the patch on surf_A and\n" " and surf_B. For this option, you must specify two and\n" " only two surfaces with surf_A and surf_B options.\n" " -vol_only: Only calculate the volume, don't write out patches.\n" " See also -fix_bowtie option below.\n" "\n" " ** If you are more interested in the volume attributed to one node, or a \n" " set of nodes, between two isotopic surfaces, you are much better off \n" " using SurfMeasures' -node_volg option. SurfMeasures has an efficient \n" " implementation of the Gauss Theorem based volume estimation.\n" "\n" " -out_type TYPE: Type of all output patches, regardless of input \n" " surface type.\n" " Choose from: FreeSurfer, SureFit, 1D and Ply.\n" " -hits min_hits: Minimum number of nodes specified for a triangle\n" " to be made a part of the patch (1 <= min_hits <= 3)\n" " default is 2.\n" " -masklabel msk: If specified, then only nodes that are labeled with\n" " with msk are considered for the patch.\n" " This option is useful if you have an ROI dataset file\n" " and whish to create a patch from one out of many ROIs\n" " in that file. This option must be used with ilabel \n" " specified (not = -1)\n" " -patch2surf: Turn surface patch into a surface where only nodes used in\n" " forming the mesh are preserved.\n" " -check_bowtie: Check if the patch has a section hanging by one node to\n" " the rest of the mesh. Think of a patch made of two \n" " triangles that are connected at one node only. \n" " Think Bowtie. Bowties should not occur if original \n" " surface is 2 manifold and min_hits == 1\n" " -check_bowtie is the default when -vol or -vol_only \n" " are used. Volume computation will fail in the presence\n" " of bowties.\n" " -fix_bowtie: Modify patch to eliminate bowties. This only works if \n" " min_hits is > 1. The repair is done by relaxing min_hits\n" " at the node(s) where the bowtie happens.\n" " -ok_bowtie: Do not check for, or fix bowties. \n" " Default when -vol* are not used.\n" " -adjust_contour: Once the patch is created, shrink its contours at nodes\n" " that were not in nodefile (non-selected).\n" " Each non-selected node is moved to the center of mass\n" " of itself and neighboring selected nodes.\n" " This adjustment might make sense when min_hits < 3\n" " \n" " -do-not-adjust_contour: Do not adjust contrours.\n" " This is the default.\n" " -stiched_surface STICHED: Write out the stiched surface used to\n" " calculate the volume. \n" " If -adjust_contour is used, this option also\n" " writes out a file that shows which \n" " nodes on the original surface were adjusted.\n" " The first column in the node number. The 2nd\n" " contains the number of selected nodes that \n" " neighbored non-selected nodes in the patch.\n" " -coord_gain GAIN: Multiply node coordinates by a GAIN.\n" " That's useful if you have a tiny patch that needs\n" " enlargement for easier viewing in SUMA.\n" " Although you can zoon over very large ranges in SUMA\n" " tiny tiny patches are hard to work with because\n" " SUMA's parameters are optimized to work with objects\n" " on the order of a brain, not on the order of 1 mm.\n" " Gain is applied just before writing out patches.\n" " -flip_orientation: Change orientation of triangles before writing\n" " surfaces.\n" " -verb VERB: Set verbosity level, 1 is the default.\n" "\n" " Example 1: Given an ROI, a white matter and a gray matter surface\n" " calculate the volume of cortex enclosed by the roi on\n" " both surfaces.\n" " Assume you have the spec file and surfaces already. You can\n" " get the same files from the SUMA directory in the AFNI \n" " workshop SUMA's archive which you can get with: \n" " curl -O http://afni.nimh.nih.gov/pub/dist/edu/data/SUMA_demo.tgz\n" "\n" " Draw an ROI on the surface and save it as: lh.manualroi.1D.roi\n" "\n" " To calculate the volume and create a enclosing surface:\n" " SurfPatch -spec DemoSubj_lh.spec \\\n" " -sv DemoSubj_SurfVol+orig \\\n" " -surf_A lh.smoothwm \\\n" " -surf_B lh.pial \\\n" " -prefix lh.patch \\\n" " -input lh.manualroi.1D.roi 0 -1 \\\n" " -out_type fs \\\n" " -vol \\\n" " -adjust_contour \\\n" " -stiched_surface lh.stiched \\\n" " -flip_orientation \n" "\n" " Example 2: If you want to voxelize the region between the two surfaces\n" " you can run the following on the output.\n" " 3dSurfMask -i lh.stiched.ply \\\n" " -prefix lh.closed -fill_method SLOW \\\n" " -grid_parent DemoSubj_SurfVol+orig.HEAD \n" " 3dSurfMask will output a dataset called lh.closed.d+orig which\n" " contains the signed closest distance from each voxel to the \n" " surface. Negative distances are outside the surface.\n" "\n" " To examine the results:\n" " suma -npb 71 -i lh.stiched.ply -sv DemoSubj_SurfVol+orig. &\n" " afni -npb 71 -niml -yesplugouts & \n" " DriveSuma -npb 71 -com viewer_cont -key 't' \n" " plugout_drive -npb 71 \\\n" " -com 'SET_OVERLAY lh.closed.d' \\\n" " -com 'SET_FUNC_RANGE A.3' \\\n" " -com 'SET_PBAR_NUMBER A.10' \\\n" " -com 'SET_DICOM_XYZ A. 10 70 22 '\\\n" " -quit\n" "\n" "%s" "\n" "%s" "\n", (detail > 1) ? sio : "Use -help for I/O and miscellaneous options." , (detail > 1) ? s : ""); } if (sio) SUMA_free(sio); s = NULL; if (s) SUMA_free(s); s = NULL; if (detail) { s = SUMA_New_Additions(0, 1); printf("%s\n", s);SUMA_free(s); s = NULL; printf(" Ziad S. Saad SSCC/NIMH/NIH [email protected] \n"); } return; }
void usage_SUMA_ConvexHull (SUMA_GENERIC_ARGV_PARSE *ps) { static char FuncName[]={"usage_SUMA_ConvexHull"}; char * s = NULL, *sio=NULL; int i; s = SUMA_help_basics(); sio = SUMA_help_IO_Args(ps); printf ( "\n" "Usage: A program to find the convex hull, or perform a delaunay triangulation\n" " of a set of points.\n" " This program is a wrapper for the qhull, and qdelaunay programs.\n" " see copyright notice by running suma -sources.\n" "\n" " ConvexHull \n" " usage 1: < -input VOL >\n" " < -isoval V | -isorange V0 V1 | -isocmask MASK_COM >\n" " [<-xform XFORM>]\n" " usage 2: < i_TYPE input surface >\n" " [<-sv SURF_VOL>]\n" " usage 3: < -input_1D XYZ >\n" " [<-q_opt OPT>]\n" " common optional:\n" " [< -o_TYPE PREFIX>]\n" " [< -debug DBG >]\n" "\n" " Mandatory parameters, choose one of three usage modes:\n" " Usage 1:\n" " You must use one of the following two options:\n" " -input VOL: Input AFNI (or AFNI readable) volume.\n" " You must use one of the following iso* options:\n" " -isoval V: Create isosurface where volume = V\n" " -isorange V0 V1: Create isosurface where V0 <= volume < V1\n" " -isocmask MASK_COM: Create isosurface where MASK_COM != 0\n" " For example: -isocmask '-a VOL+orig -expr (1-bool(a-V))' \n" " is equivalent to using -isoval V. \n" " NOTE: -isorange and -isocmask are only allowed with -xform mask\n" " See -xform below for details.\n" "\n" " Usage 2:\n" " -i_TYPE SURF: Use the nodes of a surface model\n" " for input. See help for i_TYPE usage\n" " below.\n" "\n" " Usage 3:\n" " -input_1D XYZ: Construct the triangulation of the points\n" " contained in 1D file XYZ. If the file has\n" " more than 3 columns, use AFNI's [] selectors\n" " to specify the XYZ columns.\n" " -q_opt OPT: Meshing option OPT can be one of.\n" " convex_hull: For convex hull of points (default)\n" " triangulate_xy: Delaunay triangulation using x y coords\n" "\n" " These three options are only useful with -q_opt triangulate_xy\n" " -proj_xy: Project points onto plane whose normal is the third principal \n" " component. Then rotate projection so that plane in parallel to\n" " Z = constant.\n" " -orig_coord: Use original coordinates when writing surface, not\n" " transformed ones.\n" " -these_coords COORDS.1D: Use coordinates in COORDS.1D when \n" " writing surface.\n" "\n" " Optional Parameters:\n" " Usage 1 only:\n" " -xform XFORM: Transform to apply to volume values\n" " before searching for sign change\n" " boundary. XFORM can be one of:\n" " mask: values that meet the iso* conditions\n" " are set to 1. All other values are set\n" " to -1. This is the default XFORM.\n" " shift: subtract V from the dataset and then \n" " search for 0 isosurface. This has the\n" " effect of constructing the V isosurface\n" " if your dataset has a continuum of values.\n" " This option can only be used with -isoval V.\n" " none: apply no transforms. This assumes that\n" " your volume has a continuum of values \n" " from negative to positive and that you\n" " are seeking to 0 isosurface.\n" " This option can only be used with -isoval 0.\n" " Usage 2 only:\n" " -sv SURF_VOL: Specify a surface volume which contains\n" " a transform to apply to the surface node\n" " coordinates prior to constructing the \n" " convex hull.\n" " All Usage:\n" " -o_TYPE PREFIX: prefix of output surface.\n" " where TYPE specifies the format of the surface\n" " and PREFIX is, well, the prefix.\n" " TYPE is one of: fs, 1d (or vec), sf, ply.\n" " Default is: -o_ply \n" "\n" "%s\n" "\n" /*" -debug DBG: debug levels of 0 (default), 1, 2, 3.\n" " This is no Rick Reynolds debug, which is oft nicer\n" " than the results, but it will do.\n" "\n" */ "%s" "\n", sio, s); SUMA_free(s); s = NULL; SUMA_free(sio); sio = NULL; s = SUMA_New_Additions(0, 1); printf("%s\n", s);SUMA_free(s); s = NULL; printf(" Ziad S. Saad SSCC/NIMH/NIH [email protected] \n"); exit (0); }
void usage_SUMA_ConvertSurface (SUMA_GENERIC_ARGV_PARSE *ps, int detail) {/*Usage*/ static char FuncName[]={"usage_SUMA_ConvertSurface"}; char * s = NULL, *sio=NULL; s = SUMA_help_basics(); sio = SUMA_help_IO_Args(ps); printf ( "\n" "Usage: ConvertSurface <-i_TYPE inSurf> <-o_TYPE outSurf> \n" " [<-sv SurfaceVolume [VolParam for sf surfaces]>] \n" " [-tlrc] [-MNI_rai/-MNI_lpi][-xmat_1D XMAT]\n" " reads in a surface and writes it out in another format.\n" " Note: This is a not a general utility conversion program. \n" " Only fields pertinent to SUMA are preserved.\n" "\n%s", detail ? "":"use -h or -help for more help detail.\n"); if (detail) { printf ( "%s" "\n" " Alternate GIFTI output qualifiers:\n" " You can alternately set gifti data arrays encoding with:\n" " -xml_ascii: For ASCII (human readable)\n" " -xml_b64: For Base64 (more compact)\n" " -xml_b64gz: For Base64 GZIPPED (most compact, needs gzip libraries)\n" " If AFNI_NIML_TEXT_DATA environment variable is set to YES, the\n" " the default is -xml_ascii, otherwise it is -xml_b64\n" "\n" " -orient_out STR: Output coordinates in STR coordinate system. \n" " STR is a three character string following AFNI's \n" " naming convention. The program assumes that the \n" " native orientation of the surface is RAI, unless you \n" " use the -MNI_lpi option. The coordinate transformation\n" " is carried out last, just before writing the surface \n" " to disk.\n" " -native: Write the output surface in the coordinate system native to its\n" " format.\n" " Option makes sense for BrainVoyager, Caret/SureFit and \n" " FreeSurfer surfaces.\n" " But the implementation for Caret/Surefit is not finished yet \n" " (ask if needed).\n" " -make_consistent: Check the consistency of the surface's mesh (triangle\n" " winding). This option will write out a new surface \n" " even if the mesh was consistent.\n" " See SurfQual -help for mesh checks.\n" " -flip_orient: Flip the winding of the triangles\n" " -radial_to_sphere rad: Push each node along the center-->node direction\n" " until |center-->node| = rad.\n" " -acpc: Apply acpc transform (which must be in acpc version of \n" " SurfaceVolume) to the surface vertex coordinates. \n" " This option must be used with the -sv option.\n" " -tlrc: Apply Talairach transform (which must be a talairach version of \n" " SurfaceVolume) to the surface vertex coordinates. \n" " This option must be used with the -sv option.\n" " -MNI_rai/-MNI_lpi: Apply Andreas Meyer Lindenberg's transform to turn \n" " AFNI tlrc coordinates (RAI) into MNI coord space \n" " in RAI (with -MNI_rai) or LPI (with -MNI_lpi)).\n" " NOTE: -MNI_lpi option has not been tested yet (I have no data\n" " to test it on. Verify alignment with AFNI and please report\n" " any bugs.\n" " This option can be used without the -tlrc option.\n" " But that assumes that surface nodes are already in\n" " AFNI RAI tlrc coordinates .\n" " NOTE: The vertex coordinates coordinates of the input surfaces are only\n" " transformed if -sv option is used. If you do transform surfaces, \n" " take care not to load them into SUMA with another -sv option.\n" "\n" " -patch2surf: Change a patch, defined here as a surface with a mesh that\n" " uses only a subset of the full nodelist, to a surface\n" " where all the nodes in nodelist are used in the mesh.\n" " Note that node indices will no longer correspond between\n" " the input patch and the output surface.\n" " -merge_surfs: Merge multitudes of surfaces on the command line into one\n" " big surface before doing anything else to the surface.\n" " This is for the moment the only option for which you \n" " should specify more than one input surface on the command\n" " line. For example:\n" " ConvertSurface -i lh.smoothwm.gii -i rh.smoothwm.gii \\\n" " -merge_surfs -o_gii lrh.smoothwm.gii\n" "\n" #if 1 " Options for coordinate projections:\n" " -node_depth DEPTHPREF: Project all coordinates onto the principal \n" " direction and output of depth/height of each\n" " node relative to the outlying projection point.\n" " This option is processed right before -pc_proj, \n" " should that option also be requested.\n" " This option outputs file DEPTHPREF.pcdepth.1D.dset\n" " which contains node index, followed by depth, then \n" " height of node. See also same option in SurfPatch\n" "\n" " -pc_proj ONTO PREFIX: Project coordinates onto ONTO, where ONTO is one \n" " of the parameters listed below.\n" " ONTO values for plane projections along various normals:\n" " PC0_plane = normal is 1st principal vector\n" " PC1_plane = normal is 2nd principal vector\n" " PC2_plane = normal is 3rd principal vector\n" " PCZ_plane = normal is component closest to Z axis\n" " PCY_plane = normal is component closest to Y axis\n" " PCX_plane = normal is component closest to X axis\n" " ONTO values for line projections:\n" " PC0_dir = project along 1st principal vector\n" " PC1_dir = project along 2nd principal vector\n" " PC2_dir = project along 3rd principal vector\n" " PCZ_dir = project along component closest to Z axis\n" " PCY_dir = project along component closest to Y axis\n" " PCX_dir = project along component closest to X axis\n" " PREFIX is used to form the name of the output file containing \n" " the projected coordinates. File PREFIX.xyzp.1D.coord\n" " contains the projected coordinates.\n" " Note: This is the last operation to be performed by this program, \n" " and no surfaces are written out in the end.\n" "\n" #endif " Options for applying arbitrary affine transform:\n" " [xyz_new] = [Mr] * [xyz_old - cen] + D + cen\n" " -xmat_1D mat: Apply transformation specified in 1D file mat.1D.\n" " to the surface's coordinates.\n" " [mat] = [Mr][D] is of the form:\n" " r11 r12 r13 D1\n" " r21 r22 r23 D2\n" " r31 r32 r33 D3\n" " or\n" " r11 r12 r13 D1 r21 r22 r23 D2 r31 r32 r33 D3\n" " -ixmat_1D mat: Same as xmat_1D except that mat is replaced by inv(mat)\n" " NOTE: For both -xmat_1D and -ixmat_1D, you can replace mat with \n" " one of the special strings:\n" " 'RandShift', 'RandRigid', or 'RandAffine' which would create\n" " a transform on the fly. \n" " You can also use 'NegXY' to flip the sign of X and Y \n" " coordinates.\n" " -seed SEED: Use SEED to seed the random number generator for random\n" " matrix generation\n" " -XYZscale sX sY sZ: Scale the coordinates by sX sY sZ.\n" " This option essentially turns sX sY sZ.\n" " into a -xmat_1D option. So you cannot mix\n" " and match.\n" " -xcenter x y z: Use vector cen = [x y z]' for rotation center.\n" " Default is cen = [0 0 0]'\n" " -polar_decomp: Apply polar decomposition to mat and preserve\n" " orthogonal component and shift only. \n" " For more information, see cat_matvec's -P option.\n" " This option can only be used in conjunction with\n" " -xmat_1D\n" "\n" "%s" "\n", (detail > 1) ? sio : "Use -help for I/O and miscellaneous options." , (detail > 1) ? s : ""); }/*Usage*/ if (sio) SUMA_free(sio); s = NULL; if (s) SUMA_free(s); s = NULL; if (detail) { s = SUMA_New_Additions(0, 1); printf("%s\n", s);SUMA_free(s); s = NULL; printf ("\t\t Ziad S. Saad SSCC/NIMH/NIH [email protected] \n"); } return; }