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

bintree.h

Go to the documentation of this file.
00001 #ifndef DEF_BINTREE 00002 #define DEF_BINTREE 00003 00004 /* ---------------------------------------------------------------------------- 00005 @COPYRIGHT : 00006 Copyright 1993,1994,1995 David MacDonald, 00007 McConnell Brain Imaging Centre, 00008 Montreal Neurological Institute, McGill University. 00009 Permission to use, copy, modify, and distribute this 00010 software and its documentation for any purpose and without 00011 fee is hereby granted, provided that the above copyright 00012 notice appear in all copies. The author and McGill University 00013 make no representations about the suitability of this 00014 software for any purpose. It is provided "as is" without 00015 express or implied warranty. 00016 ---------------------------------------------------------------------------- */ 00017 00018 00019 #include <volume_io/geometry.h> 00020 00026 typedef unsigned char node_info_type; 00027 00028 #define LEFT_CHILD 0 00029 #define RIGHT_CHILD 1 00030 00031 #define LEAF_SIGNAL 3 00032 #define SUBDIVISION_AXIS_BITS 3 00033 00034 #define CHILDREN_BITS 12 00035 #define LEFT_CHILD_EXISTS (1 << 2) 00036 #define RIGHT_CHILD_EXISTS (1 << 3) 00037 00038 #define NODE_INFO_OBJECTS_SHIFT 2 00039 #define MAX_NODE_INFO_OBJECTS (255 >> NODE_INFO_OBJECTS_SHIFT) 00040 00041 typedef struct bintree_node_struct 00042 { 00043 node_info_type node_info; /* --- lower two bits are split axis */ 00044 /* --- 0, 1, 2, mean split on x, y, z, 3 00045 means leaf */ 00046 00047 /* --- next 2 lower bits are 00048 left and right child existence or 00049 remaining bits are number objects in 00050 leaf */ 00051 00052 float split_position; 00053 00054 union 00055 { 00056 struct bintree_node_struct *children[1]; 00057 /* --- if not leaf then this is one or two 00058 pointers to bintree_node_struct */ 00059 int object_list[1]; /* --- if leaf then this is number of objects 00060 followed by object indices list */ 00061 } 00062 data; 00063 00064 } bintree_node_struct; 00065 00066 typedef struct 00067 { 00068 float limits[N_DIMENSIONS][2]; 00069 } range_struct; 00070 00071 typedef struct 00072 { 00073 range_struct range; 00074 int n_nodes; 00075 bintree_node_struct *root; 00076 } bintree_struct; 00077 00078 typedef bintree_struct *bintree_struct_ptr; 00079 00080 #endif

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