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  

thd_delete.c File Reference

#include "mrilib.h"
#include "thd.h"

Go to the source code of this file.


Functions

void THD_delete_diskptr (THD_diskptr *dkptr)
void THD_delete_datablock (THD_datablock *dblk)
void THD_delete_3dim_dataset (THD_3dim_dataset *dset, Boolean kill_files)

Function Documentation

void THD_delete_3dim_dataset THD_3dim_dataset   dset,
Boolean    kill_files
 

30 Nov 1997 *

Definition at line 105 of file thd_delete.c.

References THD_diskptr::brick_name, COMPRESS_unlink(), THD_3dim_dataset::dblk, THD_datablock::diskptr, DSET_IS_1D, DSET_IS_3D, DSET_IS_ANALYZE, DSET_IS_CTFMRI, DSET_IS_CTFSAM, DSET_IS_MINC, DSET_IS_NIFTI, DSET_IS_VOLUMES, ENTRY, THD_diskptr::header_name, ISVALID_3DIM_DATASET, ISVALID_TIMEAXIS, KILL_KILL, THD_3dim_dataset::kl, myXtFree, STATUS, THD_3dim_dataset::taxis, THD_delete_datablock(), THD_timeaxis::toff_sl, and unlink.

Referenced by AFNI_andersonville(), AFNI_fimmer_compute(), check_one_output_file(), check_output_file(), check_output_files(), CLUST_main(), copy_dset(), COPY_main(), create_bucket(), cubic_spline(), EDIT_full_copy(), EDIT_main(), fim3d_fimmer_compute(), form_clusters(), get_dimensions(), get_inputs(), get_options(), HEMISUB_main(), IMREG_main(), initialize_program(), main(), MAKER_4D_to_typed_fbuc(), MAKER_4D_to_typed_fim(), MAKER_4D_to_typed_fith(), output_results(), output_ts_array(), POWER_main(), PRIC_main(), process_all_datasets(), process_dataset(), r_new_resam_dset(), RCREND_done_CB(), RCREND_reload_dataset(), RCREND_reload_func_dset(), read_afni_data(), REORDER_main(), STAVG_main(), SUMA_VolPar_Attr(), T3D_anatomy_parent_CB(), T3D_geometry_parent_CB(), target_into_dataset(), terminate(), terminate_program(), THD_3dim_from_block(), THD_array_3dim_from_block(), THD_dataset_headname(), THD_init_session(), THD_is_dataset(), THD_open_3dcalc(), write_3dtime(), write_afni_data(), write_afni_fict(), write_afni_fizt(), write_bucket(), write_bucket_data(), and write_ts_array().

00106 {
00107 ENTRY("THD_delete_3dim_dataset") ;
00108 
00109    if( ! ISVALID_3DIM_DATASET(dset) ) EXRETURN ;
00110 
00111    if( DSET_IS_MINC(dset)    ) kill_files = False ;  /* 29 Oct 2001 */
00112    if( DSET_IS_VOLUMES(dset) ) kill_files = False ;  /* 20 Jun 2002 */
00113    if( DSET_IS_ANALYZE(dset) ) kill_files = False ;  /* 27 Aug 2002 */
00114    if( DSET_IS_1D(dset)      ) kill_files = False ;
00115    if( DSET_IS_3D(dset)      ) kill_files = False ;
00116    if( DSET_IS_CTFMRI(dset)  ) kill_files = False ;
00117    if( DSET_IS_CTFSAM(dset)  ) kill_files = False ;
00118    if( DSET_IS_NIFTI(dset)   ) kill_files = False ;  /* 28 Aug 2003 */
00119 
00120    if( kill_files ){
00121       THD_diskptr *dkptr = dset->dblk->diskptr ;
00122 
00123 STATUS("killing files") ;
00124       unlink( dkptr->header_name ) ;
00125       COMPRESS_unlink(dkptr->brick_name) ;
00126    }
00127 
00128 #ifdef ALLOW_DATASET_VLIST
00129 STATUS("destroy vlist") ;
00130    DESTROY_VLIST(dset->pts) ;
00131 #endif
00132 
00133    if( ISVALID_TIMEAXIS(dset->taxis) ){
00134 STATUS("destroy taxis") ;
00135       myXtFree( dset->taxis->toff_sl ) ;
00136       myXtFree( dset->taxis ) ;
00137    }
00138 
00139    THD_delete_datablock( dset->dblk ) ;
00140 
00141 STATUS("KILL_KILL") ;
00142    KILL_KILL( dset->kl ) ;
00143 
00144    EXRETURN ;
00145 }

void THD_delete_datablock THD_datablock   dblk
 

Definition at line 23 of file thd_delete.c.

References THD_datablock::atr, THD_datablock::brick, THD_datablock::brick_bytes, THD_datablock::brick_fac, THD_datablock::brick_keywords, THD_datablock::brick_lab, THD_datablock::brick_stataux, THD_datablock::brick_statcode, DATABLOCK_MEM_MALLOC, DATABLOCK_MEM_MMAP, DATABLOCK_MEM_SHARED, DBLK_IS_MASTERED, DESTROY_IMARR, THD_datablock::diskptr, ENTRY, FREE_IMARR, ISVALID_DATABLOCK, KILL_KILL, THD_datablock::kl, THD_datablock::locked, THD_datablock::malloc_type, THD_datablock::master_bytes, THD_datablock::master_ival, myXtFree, THD_datablock::nvals, STATUS, THD_count_databricks(), THD_delete_diskptr(), and THD_purge_datablock().

Referenced by THD_delete_3dim_dataset(), THD_init_one_datablock(), and THD_niml_to_dataset().

00024 {
00025    int ibr ;
00026 
00027 ENTRY("THD_delete_datablock") ;
00028 
00029    if( ! ISVALID_DATABLOCK(dblk) ) EXRETURN ;
00030 
00031    /** free the actual brick data (method depends on how it is stored) **/
00032 
00033    if( dblk->brick != NULL ){
00034       dblk->locked = 0 ;
00035 
00036       switch( dblk->malloc_type ){
00037 
00038          default:
00039             STATUS("count bricks") ;
00040             ibr = THD_count_databricks( dblk ) ;
00041             if( ibr > 0 )
00042                fprintf(stderr,
00043                 "** attempt to delete non-NULL unknown type of datablock **\n");
00044 
00045             if( dblk->brick != NULL ) FREE_IMARR( dblk->brick ) ;
00046          break ;
00047 
00048          case DATABLOCK_MEM_MALLOC:
00049          case DATABLOCK_MEM_MMAP:
00050             THD_purge_datablock( dblk , dblk->malloc_type ) ;
00051             DESTROY_IMARR( dblk->brick ) ;
00052          break ;
00053 
00054          case DATABLOCK_MEM_SHARED:   /* 02 May 2003 */
00055            /* ??? */
00056          break ;
00057       }
00058    }
00059 
00060    /** free the other information **/
00061 
00062 STATUS("free brick_ stuff") ;
00063 
00064    myXtFree( dblk->brick_fac ) ;
00065    myXtFree( dblk->brick_bytes ) ;
00066 
00067    /** 30 Nov 1997 **/
00068 
00069    if( dblk->brick_lab != NULL ){
00070       for( ibr=0 ; ibr < dblk->nvals ; ibr++ ) myXtFree( dblk->brick_lab[ibr] ) ;
00071       myXtFree( dblk->brick_lab ) ;
00072    }
00073 
00074    if( dblk->brick_keywords != NULL ){
00075       for( ibr=0 ; ibr < dblk->nvals ; ibr++ ) myXtFree( dblk->brick_keywords[ibr] ) ;
00076       myXtFree( dblk->brick_keywords ) ;
00077    }
00078 
00079    if( dblk->brick_statcode != NULL ) myXtFree( dblk->brick_statcode ) ;
00080    if( dblk->brick_stataux  != NULL ){
00081       for( ibr=0 ; ibr < dblk->nvals ; ibr++ ) myXtFree( dblk->brick_stataux[ibr] ) ;
00082       myXtFree( dblk->brick_stataux ) ;
00083    }
00084 
00085    if( DBLK_IS_MASTERED(dblk) ){       /* 11 Jan 1999 */
00086       myXtFree( dblk->master_ival ) ;
00087       myXtFree( dblk->master_bytes ) ;
00088    }
00089 
00090    THD_delete_diskptr( dblk->diskptr ) ;
00091 
00092 STATUS("KILL_KILL") ;
00093    KILL_KILL( dblk->kl ) ;
00094 
00095 STATUS("free attributes") ;
00096    myXtFree( dblk->atr ) ;    /* not on the kill list */
00097 
00098    EXRETURN ;
00099 }

void THD_delete_diskptr THD_diskptr   dkptr
 

Definition at line 14 of file thd_delete.c.

References ISVALID_DISKPTR.

Referenced by THD_delete_datablock().

00015 {
00016    if( ! ISVALID_DISKPTR(dkptr) ) return ;
00017 }
 

Powered by Plone

This site conforms to the following standards: