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  

plug_maxima.h File Reference

Go to the source code of this file.


Data Structures

struct  maxima_s
struct  point_list_s
struct  r_afni_s

Defines

#define R_MAX_AFNI_DSETS   3
#define R_MESSAGE_L   256
#define R_FILE_L   128
#define rWARNING(string)   fprintf( stderr, "\033[1m%s\033[0m\n", string )
#define rERROR(string)   fprintf( stderr, "\007\033[2m%s\033[0m\n", string )
#define MAX_MASK_FILL_VAL   1
#define MAX_SORT_N_REMOVE_STYLE   1
#define MAX_WEIGHTED_AVE_STYLE   2
#define MAX_MAX_STYLE   2

Functions

int add_point_to_list (point_list_s *, int)
int apply_fill_radius (maxima_s *)
int apply_min_dist (maxima_s *)
int clear_around_point (int, maxima_s *, point_list_s *)
int create_point_list (maxima_s *)
int display_coords (r_afni_s *, maxima_s *)
int find_local_maxima (maxima_s *)
void free_memory (r_afni_s *, maxima_s *)
int init_maxima_s (maxima_s *, r_afni_s *, char *)
int init_afni_s (r_afni_s *)
char * process_args (r_afni_s *, maxima_s *, PLUGIN_interface *)
int process_data (maxima_s *)
int radial_fill (int, int, int, maxima_s *, int)
int weighted_index (point_list_s *, maxima_s *)
int write_results (r_afni_s *, maxima_s *, PLUGIN_interface *)
void show_point_list_s (char *mesg, point_list_s *, int)
void show_maxima_s (char *mesg, maxima_s *)
int point_comp_neg (const void *, const void *)
int point_comp_pos (const void *, const void *)
int r_set_afni_s_from_dset (r_afni_s *, THD_3dim_dataset *)
u_short r_get_max_u_short (ushort *, int)

Variables

char grMessage [R_MESSAGE_L]
short * gr_orig_data = NULL
float gr_fac = 1.0

Define Documentation

#define MAX_MASK_FILL_VAL   1
 

Definition at line 63 of file plug_maxima.h.

Referenced by apply_fill_radius(), and find_local_maxima().

#define MAX_MAX_STYLE   2
 

Definition at line 67 of file plug_maxima.h.

Referenced by process_args().

#define MAX_SORT_N_REMOVE_STYLE   1
 

Definition at line 65 of file plug_maxima.h.

Referenced by clear_around_point(), init_maxima_s(), and process_args().

#define MAX_WEIGHTED_AVE_STYLE   2
 

Definition at line 66 of file plug_maxima.h.

Referenced by clear_around_point().

#define R_FILE_L   128
 

Definition at line 20 of file plug_maxima.h.

#define R_MAX_AFNI_DSETS   3
 

Definition at line 18 of file plug_maxima.h.

#define R_MESSAGE_L   256
 

Definition at line 19 of file plug_maxima.h.

#define rERROR string       fprintf( stderr, "\007\033[2m%s\033[0m\n", string )
 

Definition at line 23 of file plug_maxima.h.

Referenced by add_point_to_list(), clear_around_point(), DRAW_color_CB(), init_maxima_s(), r_any_cb_hide(), r_any_cb_raise(), r_gr_cb_set_max_dist(), r_gr_cb_set_range(), r_gr_set_fill_val(), r_HL_cb_set_fill_val(), r_HL_cb_set_maxsize(), r_index2pt(), r_INT_cb_fill(), r_INT_cb_set_fill_val(), r_set_afni_s_from_dset(), r_wt_cb_set_diag_conn(), r_wt_cb_set_fill_val(), r_wt_cb_set_min_nbrs(), r_wt_cb_set_range(), weighted_index(), and write_results().

#define rWARNING string       fprintf( stderr, "\033[1m%s\033[0m\n", string )
 

Definition at line 22 of file plug_maxima.h.

Referenced by r_any_cb_fill_stats(), r_gr_cb_fill(), r_histogram(), r_HL_cb_set_fill_val(), r_INT_cb_fill(), r_INT_cb_set_fill_val(), r_wt_cb_fill(), and r_wt_cb_set_fill_val().


Function Documentation

int add_point_to_list point_list_s  ,
int   
[static]
 

Referenced by clear_around_point(), and create_point_list().

int apply_fill_radius maxima_s   [static]
 

Referenced by process_data().

int apply_min_dist maxima_s   [static]
 

Referenced by process_data().

int clear_around_point int   ,
maxima_s  ,
point_list_s  
[static]
 

Referenced by apply_min_dist().

int create_point_list maxima_s   [static]
 

Referenced by process_data().

int display_coords r_afni_s  ,
maxima_s  
[static]
 

Referenced by write_results().

int find_local_maxima maxima_s   [static]
 

Referenced by process_data().

void free_memory r_afni_s  ,
maxima_s  
[static]
 

Referenced by MAXIMA_main().

int init_afni_s r_afni_s   [static]
 

Referenced by process_args().

int init_maxima_s maxima_s  ,
r_afni_s  ,
char *   
[static]
 

Referenced by process_args().

int point_comp_neg const void *   ,
const void *   
 

Definition at line 1377 of file plug_maxima.c.

References v1.

Referenced by process_data().

01378 {
01379     short v1 = *( gr_orig_data + *(int *)p1 );
01380     short v2 = *( gr_orig_data + *(int *)p2 );
01381 
01382     /* more negative is greater AND reverse the order */
01383     if ( v1 > v2 )
01384         return 1;
01385     else if ( v1 < v2 )
01386         return -1;
01387 
01388 
01389     return 0;
01390 }

int point_comp_pos const void *   ,
const void *   
 

Definition at line 1356 of file plug_maxima.c.

References v1.

Referenced by process_data().

01357 {
01358     short v1 = *( gr_orig_data + *(int *)p1 );
01359     short v2 = *( gr_orig_data + *(int *)p2 );
01360 
01361     if ( v1 < v2 )              /* reverse order to get large numbers first */
01362         return 1;
01363     else if ( v1 > v2 )
01364         return -1;
01365 
01366     return 0;
01367 }

char* process_args r_afni_s  ,
maxima_s  ,
PLUGIN_interface *   
[static]
 

Referenced by MASKCALC_main(), and MAXIMA_main().

int process_data maxima_s   [static]
 

Referenced by HEMISUB_main(), and MAXIMA_main().

u_short r_get_max_u_short ushort  ,
int   
 

Referenced by fill_afni_struct(), and r_set_afni_s_from_dset().

int r_set_afni_s_from_dset r_afni_s  ,
THD_3dim_dataset  
 

Definition at line 1400 of file plug_maxima.c.

References calloc, THD_3dim_dataset::daxes, r_afni_s::dset, DSET_ARRAY, DSET_BRICK_FACTOR, DSET_NVALS, ENTRY, r_afni_s::factor, r_afni_s::fimage, grMessage, r_afni_s::max_u_short, r_afni_s::num_dsets, r_afni_s::nvox, r_afni_s::nx, THD_dataxes::nxx, r_afni_s::ny, THD_dataxes::nyy, r_afni_s::nz, THD_dataxes::nzz, r_get_max_u_short(), rERROR, RETURN, r_afni_s::simage, r_afni_s::sub_brick, r_afni_s::subs, and r_afni_s::want_floats.

Referenced by process_args().

01401 {
01402 ENTRY("r_set_afni_s_from_dset");
01403 
01404     if ( A->num_dsets >= R_MAX_AFNI_DSETS )
01405     {
01406         sprintf( grMessage, "Error: rsasfd_00\n"
01407                  "We only have memory to hold %d datasets.    exiting...\n",
01408                  R_MAX_AFNI_DSETS );
01409         rERROR( grMessage );
01410 
01411         RETURN(0);
01412     }
01413 
01414     A->dset[ 0 ] = dset;                 /* rickr - use sub-brick */
01415     A->simage[ 0 ] = ( short * )DSET_ARRAY( dset, A->sub_brick );
01416 
01417     if ( !A->simage[0] )
01418     {
01419         sprintf(grMessage,
01420             "** data not available, is this in warp-on-demand mode?\n");
01421         rERROR(grMessage);
01422         RETURN(0);
01423     }
01424 
01425     if ((A->factor[0] = DSET_BRICK_FACTOR(dset, A->sub_brick)) == 0.0 )
01426         A->factor[0] = 1.0;
01427 
01428     A->subs  [ 0 ] = DSET_NVALS( dset );
01429 
01430     A->nx   = dset->daxes->nxx;
01431     A->ny   = dset->daxes->nyy;
01432     A->nz   = dset->daxes->nzz;
01433     A->nvox = A->nx * A->ny * A->nz;
01434 
01435     if ( A->want_floats )
01436     {
01437         int     count;
01438         short * sptr;
01439         float * fptr;
01440         float   factor = A->factor[ 0 ];   /* just for speed */
01441 
01442         if ( ( A->fimage[ 0 ] =
01443                 ( float * )calloc( A->nvox, sizeof( float ) ) ) == NULL )
01444         {
01445             sprintf( grMessage, "Error: rsasfd_10\n"
01446                      "Failed to allocate memory for %d floats.\n", A->nvox );
01447             rERROR( grMessage );
01448 
01449             RETURN(0);
01450         }
01451 
01452         fptr = A->fimage[ 0 ];
01453         sptr = A->simage[ 0 ];
01454         for ( count = 0; count < A->nvox; count++ )
01455             *fptr++ = *sptr++ * factor;
01456     }
01457 
01458     A->max_u_short  = r_get_max_u_short( (u_short *)A->simage[0], A->nvox );
01459 
01460 /*    A->num_dsets++;   not using more than one */
01461 
01462     RETURN(1);
01463 }

int radial_fill int   ,
int   ,
int   ,
maxima_s  ,
int   
[static]
 

Referenced by apply_fill_radius().

void show_maxima_s char *    mesg,
maxima_s  
[static]
 

Referenced by find_local_maxima(), and process_args().

void show_point_list_s char *    mesg,
point_list_s  ,
int   
[static]
 

Referenced by create_point_list(), and process_data().

int weighted_index point_list_s  ,
maxima_s  
[static]
 

Referenced by clear_around_point().

int write_results r_afni_s  ,
maxima_s  ,
PLUGIN_interface *   
[static]
 


Variable Documentation

float gr_fac = 1.0 [static]
 

Definition at line 138 of file plug_maxima.h.

short* gr_orig_data = NULL [static]
 

Definition at line 137 of file plug_maxima.h.

char grMessage[ R_MESSAGE_L ]
 

Definition at line 55 of file plug_maxima.h.

Referenced by add_point_to_list(), clear_around_point(), init_maxima_s(), process_args(), r_set_afni_s_from_dset(), and weighted_index().

 

Powered by Plone

This site conforms to the following standards: