Doxygen Source Code Documentation
thd_countb.c
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 #include "mrilib.h" 00008 #include "thd.h" 00009 00010 /***************************************************************** 00011 A datablock contains the information needed to access the 00012 data in memory. 00013 ******************************************************************/ 00014 00015 /*--------------------------------------------------------------- 00016 Count the number of in-memory sub-bricks actually stored in 00017 a datablock at this instant. Returns -1 if an error. 00018 -----------------------------------------------------------------*/ 00019 00020 int THD_count_databricks( THD_datablock * dblk ) 00021 { 00022 int ibr , count ; 00023 00024 if( ! ISVALID_DATABLOCK(dblk) || dblk->brick == NULL ) return -1 ; 00025 00026 count = 0 ; 00027 for( ibr=0 ; ibr < dblk->nvals ; ibr++ ) 00028 if( DBLK_BRICK(dblk,ibr) != NULL && DBLK_ARRAY(dblk,ibr) != NULL ) 00029 count++ ; 00030 00031 return count ; 00032 }