00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
#include <volume_io/internal_volume_io.h>
00016
#include <bicpl/objects.h>
00017
00018
#ifndef lint
00019
static char rcsid[] =
"$Header: /software/source//libraries/bicpl/Objects/tag_objects.c,v 1.7 2000/02/06 15:30:46 stever Exp $";
00020
#endif
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 public Status
input_tag_objects_file(
00040 STRING filename,
00041 Colour marker_colour,
00042 Real default_size,
00043 Marker_types default_type,
00044
int *n_objects,
00045
object_struct **object_list[] )
00046 {
00047 Status status;
00048
object_struct *object;
00049
marker_struct *marker;
00050
int i, n_volumes, n_tag_points, *structure_ids, *patient_ids;
00051 STRING *labels;
00052
double *weights;
00053
double **tags1, **tags2;
00054
00055 *n_objects = 0;
00056
00057 status = input_tag_file( filename, &n_volumes, &n_tag_points,
00058 &tags1, &tags2, &weights,
00059 &structure_ids, &patient_ids, &labels );
00060
00061
if( status == OK )
00062 {
00063 for_less( i, 0, n_tag_points )
00064 {
00065 object =
create_object(
MARKER );
00066 marker =
get_marker_ptr( object );
00067 fill_Point( marker->
position, tags1[i][X], tags1[i][Y],tags1[i][Z]);
00068 marker->
label = create_string( labels[i] );
00069
00070
if( structure_ids[i] >= 0 )
00071 marker->
structure_id = structure_ids[i];
00072
else
00073 marker->
structure_id = -1;
00074
00075
if( patient_ids[i] >= 0 )
00076 marker->
patient_id = patient_ids[i];
00077
else
00078 marker->
patient_id = -1;
00079
00080
if( weights[i] > 0.0 )
00081 marker->
size = weights[i];
00082
else
00083 marker->
size = default_size;
00084
00085 marker->
colour = marker_colour;
00086 marker->
type = default_type;
00087
00088
add_object_to_list( n_objects, object_list, object );
00089 }
00090
00091 free_tag_points( n_volumes, n_tag_points, tags1, tags2, weights,
00092 structure_ids, patient_ids, labels );
00093 }
00094
00095
return( status );
00096 }