TPCCLIB
|
Functions for processing region names. More...
#include "libtpcmisc.h"
Go to the source code of this file.
Functions | |
int | rnameSplit (char *rname, char *name1, char *name2, char *name3, int max_name_len) |
int | rnameRmDots (char *rname1, char *rname2) |
int | rnameMatch (char *rname, int rnr, char *test_str) |
int | rnameCatenate (char *rname, int max_rname_len, char *name1, char *name2, char *name3, char space) |
int | roinameExists (char *roiname) |
Verifies whether TAC name exists or not. | |
Functions for processing region names.
Definition in file rname.c.
int rnameCatenate | ( | char * | rname, |
int | max_rname_len, | ||
char * | name1, | ||
char * | name2, | ||
char * | name3, | ||
char | space ) |
Construct full TAC name from up to three subnames.
rname | Pointer to string of length max_rname_len, in where the full name will be placed |
max_rname_len | Length of full TAC name, not including null char |
name1 | Pointer to 1st subname (anatomical region); NULL if not available |
name2 | Pointer to 1st subname (usually hemisphere); NULL if not available |
name3 | Pointer to 1st subname (usually image plane); NULL if not available |
space | Spacing character, for example ' ', '_', or '-' |
Definition at line 189 of file rname.c.
Referenced by dftRead(), dftRNameSimplify(), fitRead(), and resRead().
int rnameMatch | ( | char * | rname, |
int | rnr, | ||
char * | test_str ) |
Test whether region name or number matches with a test string. Test string can contain wildcards. If test string contains only one subname, it is tested against whole rname. If it contains 2-3 subnames, those are tested against the corresponding tokens in rname. Subname '.' stands for empty name. Number is tested only if test string contains one token of all digits.
rname | Region name which is tested |
rnr | Region number (1..) |
test_str | Test string |
Definition at line 144 of file rname.c.
Referenced by dftSelectRegions(), and resSelectRegions().
int rnameRmDots | ( | char * | rname1, |
char * | rname2 ) |
Region name may contain dots marking non-existing identification of hemisphere or image plane etc. This function removes the dots and extra space characters.
rname1 | String which contains the original region name; the modified string is written in next string, if pointer to it is given next. |
rname2 | Pointer to previously allocated string, into which the modified region name will be written. Enter NULL, if previous string is to be modified instead. |
Definition at line 99 of file rname.c.
Referenced by plot_fit_svg(), plot_fitrange_svg(), plot_svg(), res2ift(), and rnameSplit().
int rnameSplit | ( | char * | rname, |
char * | name1, | ||
char * | name2, | ||
char * | name3, | ||
int | max_name_len ) |
Split region name into 1-3 subparts of given max length.
rname | Region name to split (string is not edited) |
name1 | Pointer to 1st subname (anatomical region) |
name2 | Pointer to 2nd subname (usually hemisphere) |
name3 | Pointer to 3rd subname (usually image plane) |
max_name_len | Max length of subnames, excluding terminal null |
Definition at line 14 of file rname.c.
Referenced by csv2dft_a(), csv2dft_b(), csv2dft_linkset(), csv2dft_mat(), dft_fill_hdr_from_IFT(), dftGetPmodTitle(), resRead(), and rnameMatch().
int roinameExists | ( | char * | roiname | ) |
Verifies whether TAC name exists or not.
TAC name string may contain only delimiters like '.', '_', '-', or spaces. Those cases are interpreted as no name in this function.
roiname | ROI name string; not edited |
Definition at line 241 of file rname.c.