|
Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
mri_free.c File Reference#include "mrilib.h"
Go to the source code of this file.
Function Documentation
|
Return the pointer to the data array in an MRI_IMAGE struct. ---------------------------------------------------------------------------
Definition at line 15 of file mri_free.c.
References MRI_DATA::byte_data, MRI_DATA::complex_data, MRI_DATA::double_data, MRI_DATA::float_data, MRI_IMAGE::fname, MRI_IMAGE::fondisk, MRI_IMAGE::im, MRI_DATA::int_data, MRI_IMAGE::kind, mri_input_delay(), MRI_DATA::rgb_data, MRI_DATA::rgba_data, and MRI_DATA::short_data.
Referenced by AB_interp(), adwarp_refashion_dataset(), AFNI_dataset_slice(), AFNI_read_images(), AFNI_refashion_dataset(), AFNI_splashdown(), AIVVV_imseq_addto(), FTOSH_getopts(), ISQ_make_bar(), ISQ_process_mri(), ISQ_saver_CB(), main(), mri_2dalign_setup(), mri_align_dfspace(), mri_cat2D(), mri_copy(), mri_cut_2D(), mri_cut_3D(), mri_edit_image(), mri_entropy16(), mri_entropy8(), mri_equal(), mri_expand_2D(), mri_fft_complex(), mri_filt_fft(), mri_flip3D(), mri_float_func(), mri_free(), mri_histogram(), mri_lsqfit(), mri_medianfilter(), mri_move_guts(), mri_new_7D_generic(), mri_nsize(), mri_overlay_2D(), mri_purge_delay(), mri_read(), mri_read3D_analyze75(), mri_read_3D(), mri_read_analyze75(), mri_read_dicom(), mri_read_ge4(), mri_read_ppm3(), mri_resize_NN(), mri_scale_inplace(), mri_sharpen(), mri_sobel(), mri_stat_seq(), mri_to_niml(), mri_to_short_sclip(), mri_warp_bicubic(), mri_warp_bilinear(), mri_write(), mri_write_7D(), mri_write_analyze(), mri_write_raw(), mri_zeropad_2D(), niml_to_mri(), r_fill_resampled_data_brick(), REG_command_line(), T3D_read_images(), TFIM_getopts(), THD_extract_series(), THD_get_brick_stats(), THD_load_mpeg(), and THD_zeropad().
00016 {
00017 void *data ;
00018
00019 #ifdef USE_MRI_DELAY
00020 if( im->fname != NULL && (im->fondisk & INPUT_DELAY) )
00021 mri_input_delay( im ) ;
00022 #endif
00023
00024 if( im == NULL ) return NULL ;
00025
00026 switch( im->kind ){
00027 case MRI_byte: data = im->im.byte_data ; break ;
00028 case MRI_short: data = im->im.short_data ; break ;
00029 case MRI_int: data = im->im.int_data ; break ;
00030 case MRI_float: data = im->im.float_data ; break ;
00031 case MRI_double: data = im->im.double_data ; break ;
00032 case MRI_complex:data = im->im.complex_data; break ;
00033 case MRI_rgb: data = im->im.rgb_data ; break ;
00034 case MRI_rgba: data = im->im.rgba_data ; break ;
00035 default: data = NULL ; break ;
00036 }
00037 return data ;
00038 }
|
|
Return the size (bytes) of one data element of the given type. ---------------------------------------------------------------------------
Definition at line 85 of file mri_free.c.
References typ.
Referenced by adwarp_refashion_dataset(), AFNI_read_images(), AFNI_refashion_dataset(), EDIT_main(), EDIT_volpad(), main(), mri_read3D_analyze75(), mri_read_analyze75(), mri_zeropad_2D(), r_fill_resampled_data_brick(), RT_process_info(), RT_start_dataset(), s2v_nodes2volume(), T3D_create_widgets(), T3D_fix_dataset_dimen(), T3D_read_images(), T3D_swap_CB(), THD_add_bricks(), THD_copy_dset_subs(), THD_extract_array(), THD_get_dset_row(), THD_load_mpeg(), THD_open_analyze(), THD_subbrick_to_niml(), THD_write_minc(), write_afni_data(), write_afni_fict(), and write_afni_fizt().
00086 {
00087 switch( typ ){
00088 case MRI_byte: return sizeof(byte) ;
00089 case MRI_short: return sizeof(short) ;
00090 case MRI_int: return sizeof(int) ;
00091 case MRI_float: return sizeof(float) ;
00092 case MRI_double: return sizeof(double) ;
00093 case MRI_complex: return sizeof(complex) ;
00094 case MRI_rgb: return 3*sizeof(byte) ;
00095 case MRI_rgba: return sizeof(rgba) ;
00096 default: return 0 ;
00097 }
00098 }
|
void mri_fix_data_pointer |
( |
void * |
ptr, |
|
|
MRI_IMAGE * |
im |
|
) |
|
|
|
Modify the data pointer in an MRI_IMAGE struct. ---------------------------------------------------------------------------
Definition at line 44 of file mri_free.c.
References MRI_DATA::byte_data, MRI_DATA::complex_data, MRI_DATA::double_data, MRI_DATA::float_data, MRI_IMAGE::im, MRI_DATA::int_data, MRI_IMAGE::kind, MRI_DATA::rgba_data, and MRI_DATA::short_data.
Referenced by AFNI_fimmer_compute(), AFNI_make_widgets(), AFNI_read_images(), AIVVV_imseq_addto(), AIVVV_imseq_popup(), BFIT_compute(), BFIT_main(), CORREL_main(), dset_to_mri(), EDIT_add_bricklist(), EDIT_main(), EDIT_substitute_brick(), fim3d_fimmer_compute(), IMREG_main(), init_floatvector_array(), main(), MASKAVE_main(), mri_1D_fromstring(), mri_copy(), mri_flip3D(), mri_input_delay(), mri_move_guts(), mri_read_ascii(), mri_zeropad_3D(), output_ts_array(), PERMTEST_main(), process_1ddata(), read_input_data(), RT_fim_recurse(), RT_registration_2D_onevol(), RT_registration_2D_setup(), RT_registration_3D_onevol(), RT_start_dataset(), T3D_fix_dataset_dimen(), T3D_read_images(), THD_alloc_datablock(), THD_autonudge(), THD_fetch_dataset(), THD_load_1D(), THD_load_3D(), THD_load_analyze(), THD_load_ctfmri(), THD_load_ctfsam(), THD_load_datablock(), THD_load_minc(), THD_load_mpeg(), THD_load_nifti(), THD_load_tcat(), THD_write_datablock(), THD_zerofill_dataset(), THRESH_main(), VOLREG_main(), write_3dtime(), write_afni_data(), write_afni_fict(), write_afni_fizt(), write_ts_array(), and XImage_to_mri().
00045 {
00046 if( im == NULL ) return ;
00047 switch( im->kind ){
00048 case MRI_byte: im->im.byte_data = (byte *) ptr; break ;
00049 case MRI_short: im->im.short_data = (short *) ptr; break ;
00050 case MRI_int: im->im.int_data = (int *) ptr; break ;
00051 case MRI_float: im->im.float_data = (float *) ptr; break ;
00052 case MRI_double: im->im.double_data = (double *) ptr; break ;
00053 case MRI_complex:im->im.complex_data= (complex *) ptr; break ;
00054 case MRI_rgb: im->im.byte_data = (byte *) ptr; break ;
00055 case MRI_rgba: im->im.rgba_data = (rgba *) ptr; break ;
00056 }
00057 return ;
00058 }
|
|
Get rid of an MRI_IMAGE struct and all its contents. ---------------------------------------------------------------------------
Definition at line 64 of file mri_free.c.
References ENTRY, MRI_IMAGE::fname, MRI_IMAGE::fondisk, free, mri_data_pointer(), and MRI_IMAGE::name.
Referenced by AB_interp(), adwarp_refashion_dataset(), AFNI_broutim_CB(), AFNI_dataset_slice(), AFNI_faceup(), AFNI_fimmer_setort(), AFNI_fimmer_setref(), AFNI_finalize_read_1D_CB(), AFNI_finalize_saveim_CB(), AFNI_func_overlay(), AFNI_gra_send_CB(), AFNI_make_widgets(), AFNI_newfunc_overlay(), AFNI_overlay(), AFNI_read_images(), AFNI_refashion_dataset(), AFNI_rescan_timeseries_CB(), AFNI_slice_flip(), AFNI_splashdown(), AFNI_splashup(), AFNI_ttatlas_overlay(), AREN_render(), BFIT_compute(), BFIT_main(), cleanup_rtinp(), conv_set_ref(), CORREL_main(), CREN_render(), DRAW_fillin_CB(), DSET2_func(), dump_surf_3dt(), EDIT_main(), EDIT_substitute_brick(), end_fd_graph_CB(), evolve_bitvector_array(), extract_ts_array(), FD_brick_to_mri(), FD_brick_to_series(), FTOSH_getopts(), get_dfile_params(), get_line_opt(), GRA_doshift(), GRA_file_pixmap(), GRA_fim_CB(), GRA_fixup_xaxis(), GRA_handle_keypress(), GRA_opt_CB(), GRA_pick_xaxis_CB(), GRA_refread_choose_CB(), GRA_refwrite_choose_CB(), HISTO_main(), IJKAR_reader(), IM_main(), IMREG_main(), init_floatvector_array(), initialize_program(), ISQ_getimage(), ISQ_getoverlay(), ISQ_make_montage(), ISQ_manufacture_one(), ISQ_overlay(), ISQ_process_mri(), ISQ_record_addim(), ISQ_record_kill_CB(), ISQ_save_jpeg(), ISQ_saver_CB(), ISQ_show_zoom(), ISQ_snapfile(), JPEG_matrix_gray(), main(), MASKAVE_main(), matrix_file_read(), MREN_render(), mri_2dalign_one(), mri_2dalign_setup(), mri_3dalign_one(), mri_3dalign_setup(), mri_affine_bicubic(), mri_align_crao(), mri_align_dfspace(), MRI_autobbox(), mri_automask_image(), mri_automask_imarr(), mri_brainormalize(), mri_dup2D(), mri_fft2D(), mri_flatten(), mri_flatten_rgb(), mri_get_cmass_2D(), mri_get_cmass_3D(), mri_histogram(), mri_inflate_pbm(), mri_lsqfit(), mri_medianfilter(), mri_overlay_2D(), mri_pair_to_complex(), mri_percents(), mri_quantile(), mri_quantize(), mri_read(), mri_read3D_analyze75(), mri_read_1D(), mri_read_3A(), mri_read_analyze75(), mri_read_ascii(), mri_read_many_files(), mri_read_many_nsize(), mri_read_mpeg(), mri_read_ppm(), mri_read_ppm3(), mri_rgb_transform_nD(), mri_rota(), mri_rota_bilinear(), mri_rota_shear(), mri_scramble(), mri_sharpen(), mri_sharpen_rgb(), mri_shift2D_bilinear(), mri_shift_1D(), mri_sobel(), mri_stat_seq(), mri_threshold(), mri_warp3D_align_cleanup(), mri_warp3D_align_fitim(), mri_warp3d_align_one(), mri_warp3D_align_setup(), mri_warp3D_cubic(), mri_warp3D_linear(), mri_warp3D_NN(), mri_warp3D_quintic(), mri_warp_bicubic(), mri_warp_bilinear(), mri_write_1D(), mri_write_angif(), mri_zeropad_2D(), NL_main(), NUD_doall_CB(), NUD_finalize_dset_CB(), NUD_main(), NUD_quit_CB(), NUD_rotate(), NUD_update_base(), PBAR_bigexpose_CB(), PH_popup_image(), PH_redraw(), plot_graphs(), plot_image_surface(), PLUGIN_seq_send_CB(), PLUTO_popup_image(), PRIC_main(), process_1ddata(), process_NIML_MRI_IMAGE(), Process_Options(), project_byte_mip(), r_fill_resampled_data_brick(), RCREND_draw_CB(), RCREND_finalize_saveim_CB(), read_input_data(), read_nodes_file(), read_one_time_series(), read_sxyz_1D(), read_time_series(), read_ts_array(), REG_command_line(), REND_draw_CB(), REND_finalize_saveim_CB(), ROIPLOT_main(), RT_registration_2D_onevol(), RT_registration_2D_setup(), RT_registration_3D_onevol(), RT_start_dataset(), sdata_from_1D(), SNAP_store_image(), SPLASH_popup_image(), SUMA_Load1DDset(), SUMA_Load_Surface_Object_eng(), SUMA_OpenDrawnROI_1D(), SUMA_Read_Color_Map_1D(), SUMA_Read_IRGB_file(), SUMA_read_ppm(), SUMA_readFScurv(), SUMA_ReadSegDO(), SUMA_VEC_Read(), text_graphs(), TFIM_getopts(), THD_autobbox(), THD_automask(), THD_autonudge(), THD_cliplevel(), THD_cmass(), THD_dataset_tshift(), THD_extract_float_brick(), THD_extract_many_series(), THD_extract_series(), THD_load_1D(), THD_open_1D(), THD_orient_guess(), THD_outlier_count(), THD_warp3D(), TS_reader(), TSGEN_main(), TTget_recv(), UC_read_opts(), VOLREG_main(), and write_images().
00065 {
00066 void *ptr ;
00067
00068 ENTRY("mri_free") ;
00069 if( im == NULL ) EXRETURN ;
00070 #ifdef USE_MRI_DELAY
00071 if( im->fname != NULL ){ free(im->fname) ; im->fname = NULL ; }
00072 im->fondisk = 0 ;
00073 #endif
00074 if( im->name != NULL ){ free(im->name) ; im->name = NULL ; }
00075 ptr = mri_data_pointer(im) ;
00076 if( ptr != NULL ) free(ptr) ;
00077 free(im) ;
00078 EXRETURN ;
00079 }
|
|