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

tag_objects.c

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------- 00002 @COPYRIGHT : 00003 Copyright 1993,1994,1995 David MacDonald, 00004 McConnell Brain Imaging Centre, 00005 Montreal Neurological Institute, McGill University. 00006 Permission to use, copy, modify, and distribute this 00007 software and its documentation for any purpose and without 00008 fee is hereby granted, provided that the above copyright 00009 notice appear in all copies. The author and McGill University 00010 make no representations about the suitability of this 00011 software for any purpose. It is provided "as is" without 00012 express or implied warranty. 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 /* ----------------------------- MNI Header ----------------------------------- 00023 @NAME : input_tag_objects_file 00024 @INPUT : filename 00025 marker_colour 00026 default_size 00027 default_type 00028 @OUTPUT : n_objects 00029 object_list 00030 @RETURNS : OK or ERROR 00031 @DESCRIPTION: Inputs a tag file into a list of objects (markers). 00032 @METHOD : 00033 @GLOBALS : 00034 @CALLS : 00035 @CREATED : 1993 David MacDonald 00036 @MODIFIED : 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 }

Generated on Wed Jul 28 09:10:58 2004 for BICPL by doxygen 1.3.7