Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

roi_Imadeus_IO.c File Reference

#include "roi_Imadeus_IO.h"

Functions

int strip_int (char *str, char **end, int *nr_digits)
int getparam_roi (char *line, int *ROI_No)
int getparam_int (char *line, char *idstring, int *value)
int getparam_str (char *line, char *idstring, char *str)
int getparam_combination (char *line, char **comb)
void str_tok (char *str, char *delim, char **token, char **remainder)
int getparam_region (char *line, ROI_list *rl, char *roiname, int roiNo)
int str_rep (char *str, char c1, char c2)
void str_remove_trailing_zeros (char *str)
void getparam2_float (char *line, char *idstring, float *value)
int roi_read_Imadeus (const char *fname, ROI_list *rl, roi_Imadeus_data *rId)
void roi_Imadeus_set_default (roi_Imadeus_data *rId)
int roi_write_Imadeus (const char *fname, ROI_list *rl, roi_Imadeus_data *rId)

Function Documentation

void getparam2_float char *  line,
char *  idstring,
float *  value
 

Gets value of parameter field that has float separated by ','

Parameters:
line string array containing parameter
idstring starting tag of parameter
value place where float value is saved if idstring is found

int getparam_combination char *  line,
char **  comb
 

Gets value of roi combination tag in one plane and writes data into string

Parameters:
line string array containing parameter
comb pointer to string where whole line is saved
Returns:
1 if tag is found and ROI is saved into list 0 otherwise

int getparam_int char *  line,
char *  idstring,
int *  value
 

Gets value of parameter field and sets into integer variable

Parameters:
line string array containing parameter
idstring starting tag of parameter
value pointer to set value, if idstring doesnt match, then value is not overwritten
Returns:
1 if tag matches and value is changed, 0 otherwise

int getparam_region char *  line,
ROI_list rl,
char *  roiname,
int  roiNo
 

Gets value of roi region tag in one plane and writes data into end of ROI plane list in last RoiList

Parameters:
line string array containing parameter
rl list where new region is added
roiname name string of roi, 256 characters
roiNo number for roi
Returns:
1 if tag is found and ROI is saved into list 0 otherwise

int getparam_roi char *  line,
int *  ROI_No
 

Get roi start tag. Adds new number into array, or creates new variable if it doesn't exist

Parameters:
line string array containing starting tag
ROI_No save place for ROI number
Returns:
1 if tag matches, 0 otherwise

int getparam_str char *  line,
char *  idstring,
char *  str
 

Gets value of parameter field for string parameters and sets its value in to char array

Parameters:
line string array containing parameter
idstring starting tag of parameter
str pointer to parameter, if idstring doesn't match, then nothing is done
Returns:
1 if tag matches and str is changed, 0 otherwise

void roi_Imadeus_set_default roi_Imadeus_data rId  ) 
 

Sets default values into structure.

Parameters:
rId pointer to were default values are set

int roi_read_Imadeus const char *  fname,
ROI_list rl,
roi_Imadeus_data rId
 

Reads ROI of Imadeus 1.15 format into struct

Parameters:
fname Imadeus 1.15 ROI filename
rl initialized ROI list
rId if non-null, additional Imadeus data is saved here
Returns:
0 in case of success, != 0 otherwise

int roi_write_Imadeus const char *  fname,
ROI_list rl,
roi_Imadeus_data rId
 

Writes ROI of Imadeus 1.15 format from struct. File is overwritten.

Parameters:
fname Imadeus 1.15 ROI filename
rl initialized ROI list
rId additional Imadeus ROI information, if NULL default values are used
Returns:
0 in case of success, != 0 otherwise

void str_remove_trailing_zeros char *  str  ) 
 

Shortens string that represents number to last nonzero number, but saves zero next to delimeter ','.

Parameters:
str string that represents float

int str_rep char *  str,
char  c1,
char  c2
 

Replaces 1st found character with another

Parameters:
str string for replace
c1 character that will be replaced
c2 character that will replace old one
Returns:
1 if character is found, 0 otherwise

void str_tok char *  str,
char *  delim,
char **  token,
char **  remainder
 

Returns pointer to token. This is used instead of strtok. Size of token string is not checked, so ensure that token parameter has array long enough.

Parameters:
str string
delim pointer to delimeter
token pointer where pointer to token is saved, not including delimeter
remainder pointer where pointer to remainder is saved, not including delimeter
Returns:
pointer to allocated token string, or NULL if string is not found

int strip_int char *  str,
char **  end,
int *  nr_digits
 

Strips integer number from string. Maximum 256 digits in number.

Parameters:
str char array
end pointer to first non-digit character will be set if this is non-null
nr_digits if non-null number of digits is saved here
Returns:
positive number stripped from string, or -1 if number cannot be found


Generated on Fri May 13 14:26:31 2005 by  doxygen 1.4.1