Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

aren.h

Go to the documentation of this file.
00001 #ifndef _AFNI_RENDER_HEADER_
00002 #define _AFNI_RENDER_HEADER_
00003 
00004 /*****************************************************************************
00005   This software is copyrighted and owned by the Medical College of Wisconsin.
00006   See the file README.Copyright for details.
00007 ******************************************************************************/
00008 
00009 #include "mrilib.h"
00010 #include "volpack.h"
00011 
00012 /*============================================================================
00013   AREN = AFNI Renderer, a set of routines for volume rendering 3D bricks.
00014   Built on top of VolPack, by Philippe Lacroute.
00015 ==============================================================================*/
00016 
00017 /*--- prototypes ---*/
00018 
00019 extern void * new_AREN_renderer(void) ;
00020 extern void   destroy_AREN_renderer( void * ) ;
00021 
00022 extern int  AREN_set_graybrick( void * , MRI_IMAGE * ) ;
00023 extern int  AREN_set_opabrick ( void * , MRI_IMAGE * ) ;
00024 extern int  AREN_set_rgbbricks( void * , MRI_IMAGE * , MRI_IMAGE * , MRI_IMAGE * ) ;
00025 extern void AREN_set_viewpoint( void * , float , float ) ;
00026 extern void AREN_set_size     ( void * , float , float , float ) ;
00027 
00028 extern MRI_IMAGE * AREN_render( void * , int ) ;
00029 
00030 extern void   AREN_be_verbose( void * ) ;
00031 extern void   AREN_be_quiet  ( void * ) ;
00032 
00033 /*--- typedefs, etc. ---*/
00034 
00035 typedef struct {
00036    unsigned short rgb ;     /* packed into 15 bits */
00037    unsigned short alpha ;   /* opacity */
00038 } rgbvox ;
00039 
00040 #define EIGHT_TO_FIVE(z) ((z) >> 3)        /* maps 0..255 into 0..31  */
00041 #define FIVE_TO_EIGHT(z) ((z) << 3)        /* maps 0..31  into 0..255 */
00042 
00043 #define FIVE_to_short(a,b,c) ((a)<<10 | (b)<<5 | (c))
00044 
00045 #define TFSINV 0.00390625
00046 #define TTINV  0.03125
00047 #define TFFINV (1.0/255.0)
00048 #define TOINV  (1.0/31.0)
00049 
00050 #define SHORT_to_rrr(s) TT_TO_ZO( ((s) & 0x7c00) >> 10 )
00051 #define SHORT_to_ggg(s) TT_TO_ZO( ((s) & 0x03e0) >>  5 )
00052 #define SHORT_to_bbb(s) TT_TO_ZO( ((s) & 0x001f)       )
00053 
00054 #define SHORT_isgray(s) ( ( ((s) & 0x7c00) >> 10 == ((s) & 0x03e0) >> 5 ) &&  \
00055                           ( ((s) & 0x03e0) >>  5 == ((s) & 0x001f)      )    )
00056 
00057 #define MAX_CDIM   32
00058 #define MAX_GRAYS  256
00059 #define MAX_COLORS 32768                   /* = 32 * 32 * 32 */
00060 #define TOT_COLORS (MAX_COLORS+MAX_GRAYS)
00061 
00062 extern void init_AREN_colortable(void) ;
00063 
00064 /*---------------------------*/
00065 
00066 #define AREN_TYPE 9707312
00067 
00068 typedef struct {
00069    int type ;
00070 
00071    vpContext * vpc ;
00072 
00073    int nx,ny,nz , verbose , newdata,newvox ;
00074    float theta,phi , sx,sy,sz ;
00075 
00076    MRI_IMAGE * grim , * rim , * gim , * bim , * opim ;  /* inputs */
00077 
00078    rgbvox * vox ;   /* encoded color + opacity */
00079 } AREN_stuff ;
00080 
00081 #define ISVALID_AREN(ah) ( (ah) != NULL && (ah)->type == AREN_TYPE )
00082 
00083 #endif /* _AFNI_RENDER_HEADER_ */
 

Powered by Plone

This site conforms to the following standards: