|
TPCCLIB
|
Functions for ROI names. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include "tpcextensions.h"Go to the source code of this file.
Functions | |
| char * | roinameSubpart (const char *roiname, const char *dlm, const unsigned int si, char *subpart, const unsigned int slen) |
| char * | roinameEditByTemplate (const char *template, const char *currname, char *newname, const unsigned int count) |
| char * | roinameAddField (char *roiname, const char *field, const unsigned int in, const unsigned int count) |
| int | roinameExists (char *roiname) |
| Verifies whether TAC name exists or not. | |
| int | roinameMatch (const char *roiname, const char *test_str, TPCSTATUS *status) |
Functions for ROI names.
Definition in file roiname.c.
| char * roinameAddField | ( | char * | roiname, |
| const char * | field, | ||
| const unsigned int | in, | ||
| const unsigned int | count ) |
Add a new field into given position inside an existing ROI name. Space character and '_' are accepted as field separators.
| roiname | ROI name string which will be edited. |
| field | String which will be added as a new field in roiname; can be empty in order to add empty field, but NULL is not accepted. |
| in | Field index [0..n] for which position new field will be added; enter a large number to add field to the end. |
| count | Max length of the roiname, including space for terminal null. Function returns NULL (error) in case there is not enough space. |
Definition at line 106 of file roiname.c.
| char * roinameEditByTemplate | ( | const char * | template, |
| const char * | currname, | ||
| char * | newname, | ||
| const unsigned int | count ) |
Make a new ROI name based on template and old ROI name.
| template | Template ROI name, where '_' is used to separate sub-parts, and '@' is replaced by the corresponding sub-part from the 'currname'. |
| currname | Current ROI name, from which sub-parts will be added as replacement of '@' in the template. Space character and '_' are assumed to separate the sub-parts. |
| newname | Pointer to pre-allocated string of length count, into which the new ROI name will be written. |
| count | Max length of new name, including terminal null. |
Definition at line 65 of file roiname.c.
| 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 158 of file roiname.c.
Referenced by tacEnsureNames(), and tacIndividualNames().
| int roinameMatch | ( | const char * | roiname, |
| const char * | test_str, | ||
| TPCSTATUS * | status ) |
Test whether ROI (TAC) name matches with a test string.
Test string can contain wild cards. If both names contain ROI name separators (' ', '_', or '-'), the corresponding sub-names are tested against each other. If test_str does not contain separators but ROI name does, then names are considered matching if test_str matches with any of sub-names.
| roiname | Pointer to ROI name to be tested. |
| test_str | Test string. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 183 of file roiname.c.
Referenced by parSelectTACs(), and tacSelectTACs().
| char * roinameSubpart | ( | const char * | roiname, |
| const char * | dlm, | ||
| const unsigned int | si, | ||
| char * | subpart, | ||
| const unsigned int | slen ) |
Divide ROI name into its sub-parts, based on user-defined delimiter characters (usually underscore and/or space).
| roiname | Pointer to ROI name. Not modified. |
| dlm | String containing the sub-part delimiters. For example, " _". |
| si | Index [0..n-1] of sub-part to search for. |
| subpart | Pointer to allocated string for sub-part. |
| slen | Length of the sub-part string, including terminating null. Resulting sub-part length will be at maximum slen-1. |
Definition at line 20 of file roiname.c.
Referenced by parReadFIT(), parReadRES(), parWriteFIT(), parWriteRES(), roinameAddField(), roinameEditByTemplate(), and roinameMatch().