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  

mri_render.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002    Major portions of this software are copyrighted by the Medical College
00003    of Wisconsin, 1994-2000, and are released under the Gnu General Public
00004    License, Version 2.  See the file README.Copyright for details.
00005 ******************************************************************************/
00006 
00007 #ifndef _MRI_RENDER_HEADER_
00008 #define _MRI_RENDER_HEADER_
00009 
00010 #include "mrilib.h"
00011 #include "volpack.h"
00012 
00013 /*============================================================================
00014   MREN = MRI Renderer, a set of routines for volume rendering 3D bricks.
00015   Built on top of VolPack, by Philippe Lacroute.
00016 ==============================================================================*/
00017 
00018 /*--- prototypes ---*/
00019 
00020 extern void * new_MREN_renderer(void) ;
00021 extern void   destroy_MREN_renderer( void * ) ;
00022 
00023 extern int  MREN_set_graybytes( void * , MRI_IMAGE * ) ;
00024 extern int  MREN_set_opabytes ( void * , MRI_IMAGE * ) ;
00025 extern int  MREN_set_rgbbytes ( void * , MRI_IMAGE * ) ;
00026 extern int  MREN_set_rgbshorts( void * , MRI_IMAGE * ) ;
00027 extern void MREN_set_viewpoint( void * , float , float , float ) ;
00028 extern void MREN_set_size     ( void * , float , float , float ) ;
00029 
00030 extern void MREN_depth_cue( void * , int ) ; /* 11 Sep 2001 */
00031 
00032 extern void MREN_set_precalculation( void * ah , int ) ;
00033 
00034 extern MRI_IMAGE * MREN_render( void * , int ) ;
00035 
00036 extern int MREN_needs_data( void * ah ) ;
00037 
00038 extern void   MREN_be_verbose( void * ) ;
00039 extern void   MREN_be_quiet  ( void * ) ;
00040 
00041 extern void MREN_set_rgbmap( void * , int , byte * , byte * , byte * ) ;
00042 extern void MREN_unset_rgbmap( void * ) ;
00043 
00044 extern MRI_IMAGE * MREN_rgb_to_cmap( MRI_IMAGE * ) ;
00045 
00046 extern void MREN_set_min_opacity( void * , float ) ;
00047 
00048 /*--- typedefs, etc. ---*/
00049 
00050 typedef struct {
00051    unsigned short rgb ;     /* packed into 15 bits */
00052    unsigned short alpha ;   /* opacity */
00053 } rgbvox ;
00054 
00055 #define EIGHT_TO_FIVE(z) ((z) >> 3)        /* maps 0..255 into 0..31  */
00056 #define FIVE_TO_EIGHT(z) ((z) << 3)        /* maps 0..31  into 0..255 */
00057 
00058 #define FIVE_TO_SHORT(a,b,c) ((a)<<10 | (b)<<5 | (c))
00059 #define EIGHT_TO_SHORT(a)    (MREN_MAX_COLORS + (a))
00060 
00061 #define TFSINV 0.00390625
00062 #define TTINV  0.03125
00063 #define TFFINV (1.0/255.0)
00064 #define TOINV  (1.0/31.0)
00065 
00066 #define SHORT_to_rrr(s) TT_TO_ZO( ((s) & 0x7c00) >> 10 )
00067 #define SHORT_to_ggg(s) TT_TO_ZO( ((s) & 0x03e0) >>  5 )
00068 #define SHORT_to_bbb(s) TT_TO_ZO( ((s) & 0x001f)       )
00069 
00070 #define SHORT_isgray(s) ( ( ((s) & 0x7c00) >> 10 == ((s) & 0x03e0) >> 5 ) &&  \
00071                           ( ((s) & 0x03e0) >>  5 == ((s) & 0x001f)      )    )
00072 
00073 #define MREN_MAX_CDIM   32
00074 #define MREN_MAX_GRAYS  256
00075 #define MREN_MAX_COLORS 32768                   /* = 32 * 32 * 32 */
00076 #define TOT_COLORS (MREN_MAX_COLORS+MREN_MAX_GRAYS)
00077 
00078 extern void init_MREN_colortable(void) ;
00079 
00080 /*---------------------------*/
00081 
00082 #define MREN_TYPE 9707312
00083 
00084 #define PMODE_LOW    0
00085 #define PMODE_MEDIUM 1
00086 #define PMODE_HIGH   2
00087 
00088 typedef struct {
00089    int type ;
00090 
00091    vpContext * vpc ;
00092 
00093    int nx,ny,nz , verbose , newopac,newvox , pmode ;
00094    float theta,phi,psi , sx,sy,sz ;
00095 
00096    int grayset , rgbset , opaset ;
00097 
00098    MRI_IMAGE * opim , * shim ;  /* opacity and shading */
00099 
00100    rgbvox * vox ;   /* encoded color + opacity */
00101 
00102    int     ncmap , newcmap ;
00103    float * cmap ;
00104    float   min_opacity ;
00105 } MREN_stuff ;
00106 
00107 #define ISVALID_MREN(ah) ( (ah) != NULL && (ah)->type == MREN_TYPE )
00108 
00109 #endif /* _MRI_RENDER_HEADER_ */
 

Powered by Plone

This site conforms to the following standards: