• Main Page
  • Data Structures
  • Files
  • File List
  • Globals

Volumes.h

00001 /*
00002 ** Include file to be used in conjuntion with the volume set (Volumes)
00003 ** data type.
00004 **
00005 ** Author:
00006 **  G.Lohmann, <lohmann@cns.mpg.de>, Jan. 1996
00007 */
00008 
00009 #include <stdio.h>
00010 
00011 #define MAXHASHLEN 1024  /* max length of hash table */
00012 
00013 typedef struct VTrackStruct {
00014   short band;
00015   short row; 
00016   short col;
00017   short length;
00018   struct VTrackStruct *next;
00019   struct VTrackStruct *previous;
00020 } *VTrack, VTrackRec;
00021 
00022 
00023 typedef struct VBucketStruct {
00024   short  ntracks;      /* number of tracks in one hashtable bucket */
00025   VTrack first;        /* ptr to first track in bucket             */
00026   VTrack last;         /* ptr to last track in bucket              */
00027 } *VBucket, VBucketRec;
00028 
00029 typedef struct VolumeStruct {
00030   short label;
00031   short nbands;
00032   short nrows;
00033   short ncolumns;
00034   short nbuckets;      /* length of hash table (number of buckets) */
00035   int   ntracks;       /* total number of tracks in all buckets   */
00036   VBucket bucket;      /* ptrs to buckets      */
00037   struct VolumeStruct *next;
00038 } VolumeRec, *Volume;
00039 
00040 
00041 typedef struct V_VolumesRec {
00042   VAttrList attributes;
00043   short nvolumes;        /* number of volumes in list       */
00044   short nbands;
00045   short nrows;
00046   short ncolumns;
00047   Volume first;          /* ptr to first volume in list     */
00048 } VolumesRec;
00049 
00050 #define VolumesAttrList(volumes) ((volumes)->attributes)
00051 #define VolumesNum(volumes) ((volumes)->nvolumes)
00052 #define VolumesNBands(volumes) ((volumes)->nbands)
00053 #define VolumesNRows(volumes) ((volumes)->nrows)
00054 #define VolumesNColumns(volumes) ((volumes)->ncolumns)
00055 #define VolumesNVolumes(volumes) ((volumes)->ntracks)
00056 /*
00057 #define VolumesNTracks(volumes) ((volumes)->ntracks)
00058 */
00059 
00060 #define VolumeNBands(volume) ((volume)->nbands)
00061 #define VolumeNRows(volume) ((volume)->nrows)
00062 #define VolumeNColumns(volume) ((volume)->ncolumns)
00063 #define VolumeNBuckets(volume) ((volume)->nbuckets)
00064 #define VolumeNTracks(volume) ((volume)->ntracks)
00065 #define VolumeLabel(volume) ((volume)->label)
00066 #define VFirstVolume(volumes) ((volumes)->first)
00067 #define VNextVolume(volume) ((volume)->next)
00068 #define VolumeExists(volume) ((volume) != NULL)
00069 
00070 #define VTrackLength(track) ((track)->length)
00071 #define VTrackExists(track) ((track) != NULL)
00072 #define VFirstTrack(volume,i) ((volume)->bucket[(i)].first)
00073 #define VNextTrack(track) ((track)->next)
00074 #define VPreviousTrack(track) ((track)->previous)
00075 
00076 #define VolumesAttr     "volumes"
00077 #define VolNVolumesAttr "nvolumes"
00078 #define VolNTracksAttr  "ntracks"
00079 #define VolNBandsAttr   "nbands"
00080 #define VolNRowsAttr    "nrows"
00081 #define VolNColumnsAttr "ncolumns"
00082 
00083 extern Volumes VCreateVolumes(short,short,short);
00084 extern Volumes VCopyVolumes(Volumes);
00085 extern void VDestroyVolumes(Volumes);
00086 extern VBoolean VWriteVolumes(FILE *, VAttrList, int, Volumes *);
00087 
00088 extern int VReadVolumes(FILE *, VAttrList *, Volumes **);
00089 
00090 extern Volume VCreateVolume(short,short,short,short,short);
00091 extern Volume VCopyVolume(Volume);
00092 extern void VAddVolume(Volumes, Volume);
00093 extern void AddTrack(Volume,VTrack);
00094 
00095 extern double VolumeBorderSize(Volume);
00096 extern VBoolean VolumeBorder(Volume,short,short,short);
00097 extern VTrack VolumeGetTrack(Volume,short,short,short);
00098 extern VBoolean VolumeInside(Volume,short,short,short);
00099 extern double VolumeRadius(Volume,double *);
00100 
00101 /*
00102 ** hash function
00103 */
00104 #define VolumeHash(nbands, b, r, len) (((b) * (nbands) + (r)) % (len))

Generated on Thu Feb 16 2012 22:03:37 for VIA - Volumetric Image Analysis by  doxygen 1.7.1