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_image.h File Reference

Go to the source code of this file.


Data Structures

struct  complex
union  MRI_DATA
struct  MRI_IMAGE
struct  rgba
struct  rgbyte

Defines

#define LOAD_rgba(s, rr, gg, bb, aa)   ((s).r=(rr),(s).g=(gg),(s).b=(bb),(s).a=(bb))
#define UNLOAD_rgba(s, rr, gg, bb, aa)   ((rr)=(s).r,(gg)=(s).g,(bb)=(s).b,(aa)=(s).a)
#define MRI_KIND   MRI_TYPE ;
#define MRI_type   MRI_TYPE ;
#define MRI_kind   MRI_TYPE ;
#define MRI_rgbyte   MRI_rgb
#define LAST_MRI_TYPE   7
#define MRI_maxbyte   255
#define MRI_maxshort   32767
#define MRI_maxint   2147483647
#define MRI_IS_INT_TYPE(typ)   ((typ) < 3)
#define USE_MRI_DELAY
#define INPUT_DELAY   1
#define BSWAP_DELAY   2
#define MRI_COPY_AUX(nn, oo)
#define MRI_IS_1D(iq)   ((iq)->ny == 1)
#define MRI_IS_2D(iq)   ((iq)->ny > 1 && (iq)->nz == 1)
#define MRI_IS_3D(iq)   ((iq)->nz > 1 && (iq)->nt == 1)
#define MRI_IS_4D(iq)   ((iq)->nt > 1 && (iq)->nu == 1)
#define MRI_DIMENSIONALITY(iq)
#define MRI_BYTE_PTR(iq)   ((iq)->im.byte_data)
#define MRI_SHORT_PTR(iq)   ((iq)->im.short_data)
#define MRI_INT_PTR(iq)   ((iq)->im.int_data)
#define MRI_FLOAT_PTR(iq)   ((iq)->im.float_data)
#define MRI_DOUBLE_PTR(iq)   ((iq)->im.double_data)
#define MRI_COMPLEX_PTR(iq)   ((iq)->im.complex_data)
#define MRI_RGB_PTR(iq)   ((iq)->im.rgb_data)
#define MRI_RGBA_PTR(iq)   ((iq)->im.rgba_data)
#define MRI_BYTE_2D(iq, ix, jy)   MRI_BYTE_PTR(iq)[(ix)+(jy)*(iq)->nx]
#define MRI_SHORT_2D(iq, ix, jy)   MRI_SHORT_PTR(iq)[(ix)+(jy)*(iq)->nx]
#define MRI_INT_2D(iq, ix, jy)   MRI_INT_PTR(iq)[(ix)+(jy)*(iq)->nx]
#define MRI_FLOAT_2D(iq, ix, jy)   MRI_FLOAT_PTR(iq)[(ix)+(jy)*(iq)->nx]
#define MRI_DOUBLE_2D(iq, ix, jy)   MRI_DOUBLE_PTR(iq)[(ix)+(jy)*(iq)->nx]
#define MRI_COMPLEX_2D(iq, ix, jy)   MRI_COMPLEX_PTR(iq)[(ix)+(jy)*(iq)->nx]

Typedefs

typedef unsigned char byte
typedef enum MRI_TYPE MRI_TYPE
typedef complex complex
typedef rgbyte rgbyte
typedef MRI_DATA MRI_DATA
typedef MRI_IMAGE MRI_IMAGE

Enumerations

enum  MRI_TYPE {
  MRI_byte, MRI_short, MRI_int, MRI_float,
  MRI_double, MRI_complex, MRI_rgb, MRI_rgba
}

Define Documentation

#define BSWAP_DELAY   2
 

Definition at line 109 of file mri_image.h.

#define INPUT_DELAY   1
 

Definition at line 108 of file mri_image.h.

#define LAST_MRI_TYPE   7
 

The last MRI_TYPE yet defined.

Definition at line 43 of file mri_image.h.

#define LOAD_rgba s,
rr,
gg,
bb,
aa       ((s).r=(rr),(s).g=(gg),(s).b=(bb),(s).a=(bb))
 

Definition at line 26 of file mri_image.h.

#define MRI_BYTE_2D iq,
ix,
jy       MRI_BYTE_PTR(iq)[(ix)+(jy)*(iq)->nx]
 

Definition at line 225 of file mri_image.h.

Referenced by AFNI_set_valabel().

#define MRI_BYTE_PTR iq       ((iq)->im.byte_data)
 

Definition at line 216 of file mri_image.h.

Referenced by AFNI_func_overlay(), AFNI_newfunc_overlay(), AFNI_ttatlas_overlay(), AFNI_vnlist_func_overlay(), AREN_render(), AREN_set_graybrick(), AREN_set_opabrick(), AREN_set_rgbbricks(), CALC_read_opts(), copy_bitvector(), corr_floatbit(), count_bitvector(), DRAW_fillin_CB(), equal_bitvector_piece(), FD_brick_to_mri(), FD_brick_to_series(), IMREG_main(), invert_bitvector_piece(), main(), MREN_render(), MREN_rgb_to_colorbytes(), MREN_set_graybytes(), MREN_set_opabytes(), MREN_set_rgbbytes(), mri_3to_rgb(), mri_aff2d_byte(), mri_brainormalize(), mri_cat2D(), mri_dup2D(), mri_flatten_rgb(), mri_flippo(), mri_histobyte(), mri_inflate_pbm(), mri_invert_inplace(), mri_read_stuff(), mri_rgb_to_3byte(), mri_rgb_to_3float(), mri_rgb_transform_nD(), mri_rgba_composite_array(), mri_sharpen_rgb(), mri_threshold(), mri_to_byte(), mri_to_byte_scl(), mri_transpose_byte(), mri_warp3D_set_womask(), mri_write_ascii(), mri_write_jpg(), mri_write_pnm(), mri_zeropad_2D(), one_bitvector_piece(), project_byte_mip(), randomize_bitvector_piece(), RCREND_cutout_blobs(), RCREND_draw_CB(), RCREND_overlay_ttatlas(), RCREND_reload_dataset(), RCREND_reload_func_dset(), RCREND_xhair_overlay(), RCREND_xhair_underlay(), REND_cutout_blobs(), REND_draw_CB(), REND_overlay_ttatlas(), REND_reload_dataset(), REND_reload_func_dset(), REND_xhair_overlay(), REND_xhair_underlay(), RT_process_data(), RT_registration_2D_onevol(), RT_registration_3D_onevol(), RT_start_dataset(), THD_cliplevel(), THD_orient_guess(), VOLREG_main(), and zero_bitvector_piece().

#define MRI_COMPLEX_2D iq,
ix,
jy       MRI_COMPLEX_PTR(iq)[(ix)+(jy)*(iq)->nx]
 

Definition at line 230 of file mri_image.h.

Referenced by AFNI_set_valabel().

#define MRI_COMPLEX_PTR iq       ((iq)->im.complex_data)
 

Definition at line 221 of file mri_image.h.

Referenced by cx_scramble(), FD_brick_to_mri(), FD_brick_to_series(), ISQ_process_mri(), main(), mri_cat2D(), mri_complex_to_pair(), mri_fft2D(), mri_flippo(), mri_pair_to_complex(), mri_threshold(), mri_to_complex(), mri_to_mri_scl(), mri_transpose_complex(), mri_write_ascii(), mri_zeropad_2D(), and T3D_read_images().

#define MRI_COPY_AUX nn,
oo   
 

Value:

( (nn)->dx = (oo)->dx , (nn)->dy = (oo)->dy , (nn)->dz = (oo)->dz , \
      (nn)->dt = (oo)->dt , (nn)->du = (oo)->du , (nn)->dv = (oo)->dv , \
      (nn)->dw = (oo)->dw ,                                             \
      (nn)->xo = (oo)->xo , (nn)->yo = (oo)->yo , (nn)->zo = (oo)->zo , \
      (nn)->to = (oo)->to , (nn)->uo = (oo)->uo , (nn)->vo = (oo)->vo , \
      (nn)->wo = (oo)->wo ,                                             \
      mri_add_name( (oo)->name , (nn) ) )

Definition at line 188 of file mri_image.h.

Referenced by ISQ_getimage(), ISQ_process_mri(), mri_3to_rgb(), mri_aff2d_byte(), mri_aff2d_rgb(), mri_affine_bicubic(), mri_brainormalize(), mri_complex_abs(), mri_complex_phase(), mri_copy(), mri_cut_2D(), mri_cut_3D(), mri_dup2D(), mri_dup2D_rgb2(), mri_dup2D_rgb3(), mri_dup2D_rgb4(), mri_dup2D_rgb_NN(), mri_edit_image(), mri_expand_2D(), mri_flatten(), mri_flatten_rgb(), mri_mult_to_float(), mri_multiply_complex(), mri_nsize(), mri_resize_NN(), mri_rota(), mri_rota_bilinear(), mri_rota_shear(), mri_scale_to_float(), mri_sharpen_rgb(), mri_shift2D_bilinear(), mri_sobel(), mri_stat_seq(), mri_to_byte(), mri_to_byte_scl(), mri_to_complex(), mri_to_complex_ext(), mri_to_float(), mri_to_rgb(), mri_to_rgba(), mri_to_short(), mri_to_short_sclip(), mri_transpose_byte(), mri_transpose_complex(), mri_transpose_float(), mri_transpose_int(), mri_transpose_rgbyte(), mri_transpose_short(), mri_watershedize(), mri_zeropad_2D(), mri_zeropad_3D(), THD_rota3D(), and THD_rota3D_matvec().

#define MRI_DIMENSIONALITY iq   
 

Value:

( ((iq)->ny == 1) ? 1 : ((iq)->nz == 1) ? 2 :     \
   ((iq)->nt == 1) ? 3 : ((iq)->nu == 1) ? 4 :     \
   ((iq)->nv == 1) ? 5 : ((iq)->nw == 1) ? 6 : 7 )
Return dimensionality of MRI_IMAGE

Definition at line 211 of file mri_image.h.

Referenced by mri_write_7D(), and mri_write_analyze().

#define MRI_DOUBLE_2D iq,
ix,
jy       MRI_DOUBLE_PTR(iq)[(ix)+(jy)*(iq)->nx]
 

Definition at line 229 of file mri_image.h.

#define MRI_DOUBLE_PTR iq       ((iq)->im.double_data)
 

Definition at line 220 of file mri_image.h.

Referenced by FD_brick_to_mri(), FD_brick_to_series(), mri_cat2D(), mri_flippo(), mri_threshold(), mri_write_ascii(), and mri_zeropad_2D().

#define MRI_FLOAT_2D iq,
ix,
jy       MRI_FLOAT_PTR(iq)[(ix)+(jy)*(iq)->nx]
 

Definition at line 228 of file mri_image.h.

Referenced by AFNI_set_valabel().

#define MRI_FLOAT_PTR iq       ((iq)->im.float_data)
 

Definition at line 219 of file mri_image.h.

Referenced by AFNI_fimmer_compute(), AFNI_finalize_read_1D_CB(), AFNI_func_overlay(), AFNI_gra_send_CB(), AFNI_newfunc_overlay(), AFNI_vnlist_func_overlay(), avg_epochs(), CALC_read_opts(), calculate_results(), Computebmatrix(), conv_set_ref(), corr_floatbit(), CORREL_main(), custom_filter(), DC_main(), DELAY_main(), disp_mri_imarr(), do_xrestore_stuff(), DRAW_fillin_CB(), DSET2_func(), DSETN_func(), DT_read_opts(), extract_ts_array(), FD_brick_to_mri(), FD_brick_to_series(), Form_R_Matrix(), get_dfile_params(), GRA_doshift(), GRA_fixup_xaxis(), GRA_redraw_overlay(), GRA_refread_choose_CB(), HISTO_main(), IJKAR_reader(), IMREG_main(), init_bitvector_array(), init_floatvector_array(), init_indep_var_matrix(), initialize_program(), ISQ_getimage(), ISQ_graymap_draw(), ISQ_process_mri(), ISQ_rowgraph_draw(), L1F_main(), L1F_worker(), LSQ_main(), LSQ_worker(), main(), MAIN_workprocess(), matrix_file_read(), MCW_choose_CB(), mri_2dalign_setup(), mri_3dalign_one(), mri_3dalign_setup(), mri_3to_rgb(), MRI_5blur_inplace_3D(), mri_affine_bicubic(), mri_align_crao(), mri_align_dfspace(), MRI_autobbox(), mri_automask_image(), mri_automask_imarr(), mri_cat2D(), mri_complex_to_pair(), mri_delayed_lsqfit(), mri_dup2D(), mri_flatten(), mri_flatten_rgb(), mri_flippo(), mri_get_cmass_2D(), mri_get_cmass_3D(), mri_medianfilter(), mri_pair_to_complex(), mri_percents(), mri_psinv(), mri_quantile(), mri_read_1D(), mri_read_3A(), mri_read_ascii_ragged(), mri_rgb_to_3float(), mri_rgb_transform_nD(), mri_rota(), mri_rota_bilinear(), mri_rota_shear(), mri_scale_to_float(), mri_sharpen_rgb(), mri_shift2D_bilinear(), mri_shift_1D(), mri_startup_lsqfit(), mri_threshold(), mri_to_float(), mri_transpose_float(), mri_warp3D_align_fitim(), mri_warp3d_align_one(), mri_warp3D_align_setup(), mri_warp3D_cubic(), mri_warp3D_get_delta(), mri_warp3D_linear(), mri_warp3D_NN(), mri_warp3D_quintic(), mri_write_ascii(), mri_zeropad_2D(), normalize_floatvector(), NUD_rotate(), PERMTEST_compute(), PH_fakeim(), plot_graphs(), plot_image_surface(), PR_one_slice(), PRIC_main(), Process_Options(), quadrant_fimfunc(), read_input_data(), read_nodes_file(), read_one_time_series(), read_time_series(), read_ts_array(), RIC_CalcCoeffAB(), RIC_CorrectDataset(), RIC_ToCardiacPhase(), RIC_ToRespPhase(), ROIPLOT_main(), RT_fim_recurse(), RT_registration_2D_onevol(), RT_registration_3D_onevol(), sdata_from_1D(), set_node_list_data(), spearman_fimfunc(), STAVG_main(), SUMA_Load1DDset(), SUMA_Load_Surface_Object_eng(), SUMA_OpenDrawnROI_1D(), SUMA_Read_Color_Map_1D(), SUMA_Read_IRGB_file(), SUMA_readFScurv(), SUMA_ReadSegDO(), SUMA_VEC_Read(), sxyz_1D_to_nlist(), T3D_read_images(), text_graphs(), THD_autobbox(), THD_average_timeseries(), THD_cmass(), THD_dataset_tshift(), THD_extract_float_brick(), THD_extract_many_series(), THD_fetch_1D(), THD_get_all_timeseries(), THD_load_1D(), THD_mean_brick(), THD_median_brick(), THD_orient_guess(), THD_rms_brick(), THD_rota3D(), THD_rota3D_matvec(), TS_reader(), ts_to_ftime(), TSGEN_main(), UC_read_opts(), v2s_apply_filter(), VOLREG_main(), and write_table().

#define MRI_INT_2D iq,
ix,
jy       MRI_INT_PTR(iq)[(ix)+(jy)*(iq)->nx]
 

Definition at line 227 of file mri_image.h.

Referenced by AFNI_set_valabel().

#define MRI_INT_PTR iq       ((iq)->im.int_data)
 

Definition at line 218 of file mri_image.h.

Referenced by FD_brick_to_mri(), FD_brick_to_series(), main(), mri_cat2D(), mri_flatten(), mri_flippo(), mri_quantize(), mri_threshold(), mri_transpose_int(), mri_warp3D_align_fitim(), mri_warp3d_align_one(), mri_warp3D_align_setup(), mri_write_ascii(), and mri_zeropad_2D().

#define MRI_IS_1D iq       ((iq)->ny == 1)
 

Check if MRI_IMAGE is 1D (ny=1)

Definition at line 199 of file mri_image.h.

Referenced by custom_filter().

#define MRI_IS_2D iq       ((iq)->ny > 1 && (iq)->nz == 1)
 

Check if MRI_IMAGE is 2D (nz=1)

Definition at line 202 of file mri_image.h.

Referenced by main(), mri_2dalign_setup(), mri_aff2d_byte(), mri_aff2d_rgb(), mri_affine_bicubic(), mri_align_dfspace(), mri_fft_complex(), mri_filt_fft(), mri_flippo(), mri_nsize(), mri_rota(), mri_rota_bilinear(), mri_rota_shear(), mri_shift2D_bilinear(), mri_sobel(), mri_stat_seq(), mri_to_complex_ext(), mri_write(), and REG_command_line().

#define MRI_IS_3D iq       ((iq)->nz > 1 && (iq)->nt == 1)
 

Check if MRI_IMAGE is 3D (nt=1)

Definition at line 205 of file mri_image.h.

Referenced by mri_3dalign_setup(), mri_zeropad_3D(), THD_rota3D(), and THD_rota3D_matvec().

#define MRI_IS_4D iq       ((iq)->nt > 1 && (iq)->nu == 1)
 

Check if MRI_IMAGE is 4D (nu=1)

Definition at line 208 of file mri_image.h.

#define MRI_IS_INT_TYPE typ       ((typ) < 3)
 

Determine if a MRI_TYPE is an integer type.

Definition at line 59 of file mri_image.h.

Referenced by EDIT_coerce_autoscale(), EDIT_coerce_autoscale_new(), main(), mri_scalize(), PR_type_scale(), s2v_nodes2volume(), THD_load_minc(), and THD_warp3D().

#define MRI_kind   MRI_TYPE ;
 

Definition at line 37 of file mri_image.h.

#define MRI_KIND   MRI_TYPE ;
 

Definition at line 35 of file mri_image.h.

#define MRI_maxbyte   255
 

Max value of a byte.

Definition at line 47 of file mri_image.h.

#define MRI_maxint   2147483647
 

Max value of an int.

Definition at line 55 of file mri_image.h.

#define MRI_maxshort   32767
 

Max value of a short.

Definition at line 51 of file mri_image.h.

#define MRI_RGB_PTR iq       ((iq)->im.rgb_data)
 

Definition at line 222 of file mri_image.h.

Referenced by AFNI_newfunc_overlay(), AFNI_set_valabel(), AFNI_vnlist_func_overlay(), AREN_render(), CREN_render(), draw_image_line(), FD_brick_to_mri(), FD_brick_to_series(), ISQ_index_to_rgb(), ISQ_make_image(), ISQ_make_montage(), ISQ_overlay(), ISQ_process_mri(), ISQ_save_jpeg(), ISQ_saver_CB(), ISQ_snapsave(), JPEG_matrix_gray(), main(), MCW_pbar_to_mri(), MREN_render(), MREN_rgb_to_colorbytes(), MREN_rgb_to_colorshorts(), mri_aff2d_rgb(), mri_cat2D(), mri_colorsetup(), mri_drawemptyrectangle(), mri_drawfilledrectangle(), mri_drawline(), mri_drawtext(), mri_dup2D_rgb2(), mri_dup2D_rgb3(), mri_dup2D_rgb4(), mri_dup2D_rgb_NN(), mri_edgize(), mri_flippo(), mri_invert_inplace(), mri_isgray(), mri_quantize(), mri_read_ppm(), mri_read_stuff(), mri_rgba_composite_array(), mri_scale_to_float(), mri_threshold(), mri_to_complex(), mri_to_float(), mri_to_rgb(), mri_transpose_rgbyte(), mri_write_angif(), mri_write_ascii(), mri_write_jpg(), mri_write_pnm(), mri_zeropad_2D(), NUD_rotate(), PBAR_bigexpose_CB(), PLOT_matrix_gray(), RCREND_draw_CB(), REND_draw_CB(), rgb_to_XImage_clever(), rgb_to_XImage_simple(), SPLASH_decodexx(), SUMA_read_ppm(), and TTget_ppm().

#define MRI_RGBA_PTR iq       ((iq)->im.rgba_data)
 

Definition at line 223 of file mri_image.h.

Referenced by FD_brick_to_series(), mri_flippo(), mri_rgba_composite_array(), mri_scale_to_float(), mri_to_float(), and mri_to_rgba().

#define MRI_rgbyte   MRI_rgb
 

Definition at line 39 of file mri_image.h.

#define MRI_SHORT_2D iq,
ix,
jy       MRI_SHORT_PTR(iq)[(ix)+(jy)*(iq)->nx]
 

Definition at line 226 of file mri_image.h.

Referenced by AFNI_set_valabel().

#define MRI_SHORT_PTR iq       ((iq)->im.short_data)
 

Definition at line 217 of file mri_image.h.

Referenced by AFNI_func_overlay(), AFNI_newfunc_overlay(), AFNI_overlay(), AFNI_ttatlas_overlay(), AFNI_vnlist_func_overlay(), CALC_read_opts(), DRAW_fillin_CB(), FD_brick_to_mri(), FD_brick_to_series(), get_octant_clips(), IMREG_main(), ISQ_index_to_rgb(), ISQ_make_image(), ISQ_make_montage(), ISQ_overlay(), ISQ_process_mri(), main(), MREN_rgb_to_colorshorts(), MREN_set_rgbshorts(), mri_brainormalize(), mri_cat2D(), mri_dup2D(), mri_edgize(), mri_flippo(), mri_histoshort_all(), mri_histoshort_nonneg(), mri_percents(), mri_quantile(), mri_read_siemens(), mri_short2mask(), mri_threshold(), mri_to_XImage(), mri_transpose_short(), mri_watershedize(), mri_write_ascii(), mri_zeropad_2D(), partial_cliplevel(), RT_registration_2D_onevol(), RT_registration_3D_onevol(), T3D_read_images(), THD_cliplevel(), THD_orient_guess(), VOLREG_main(), and write_images().

#define MRI_type   MRI_TYPE ;
 

Definition at line 36 of file mri_image.h.

#define UNLOAD_rgba s,
rr,
gg,
bb,
aa       ((rr)=(s).r,(gg)=(s).g,(bb)=(s).b,(aa)=(s).a)
 

Definition at line 27 of file mri_image.h.

#define USE_MRI_DELAY
 

Mar 1996: Extended to images up to 7D; Not all routines work with images > 2D -- check top of file for "7D SAFE" comments *

Definition at line 106 of file mri_image.h.


Typedef Documentation

typedef unsigned char byte
 

The MRI_byte data type.

Definition at line 16 of file mri_image.h.

typedef struct complex complex
 

I suppose that the next C makes this pleonastic.

typedef union MRI_DATA MRI_DATA
 

A union type to hold all possible MRI_IMAGE types. This was created before I really understood how to use void *.

typedef struct MRI_IMAGE MRI_IMAGE
 

Stores one image (1D to 7D). Why 7D, you ask? Well, I originally only had 2D images here. When extending AFNI from 3D to 3D+time and buckets, I thought that I might use 4D images (x,y,z,t) as the basic element. Instead, I decided to use an array of 3D images (in a THD_datablock), but by then I'd extended this typedef to allow (x,y,z,t,u,v,w) dimensioned arrays. I don't think anyplace ever uses more than 3D images, though.

typedef enum MRI_TYPE MRI_TYPE
 

Integer flags for different image types. Sometimes called the "datum".

typedef struct rgbyte rgbyte
 

Triple to hold RGB bytes.


Enumeration Type Documentation

enum MRI_TYPE
 

Integer flags for different image types. Sometimes called the "datum".

Enumeration values:
MRI_byte 
MRI_short 
MRI_int 
MRI_float 
MRI_double 
MRI_complex 
MRI_rgb 
MRI_rgba 

Definition at line 31 of file mri_image.h.

 

Powered by Plone

This site conforms to the following standards: