Mercurial > hg > minc-tools
changeset 1012:66c46ba73f2d
*** empty log message ***
author | david <david> |
---|---|
date | Wed, 21 Aug 1996 15:31:30 +0000 |
parents | 2fc28a9cdda7 |
children | 340c11f86adb |
files | volume_io/Volumes/get_hyperslab.c volume_io/Volumes/multidim_arrays.c |
diffstat | 2 files changed, 39 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/volume_io/Volumes/get_hyperslab.c +++ b/volume_io/Volumes/get_hyperslab.c @@ -15,7 +15,7 @@ #include <internal_volume_io.h> #ifndef lint -static char rcsid[] = "$Header: /private-cvsroot/minc/volume_io/Volumes/get_hyperslab.c,v 1.3 1996-08-21 13:20:03 david Exp $"; +static char rcsid[] = "$Header: /private-cvsroot/minc/volume_io/Volumes/get_hyperslab.c,v 1.4 1996-08-21 15:31:30 david Exp $"; #endif public void convert_voxels_to_values( @@ -226,6 +226,9 @@ long_max = (long) max_value; ALLOC( *ptr, long_max - long_min + 1 ); +#ifndef NO_DEBUG_ALLOC + (void) unrecord_ptr_alloc_check( *ptr, __FILE__, __LINE__ ); +#endif (*ptr) -= long_min;
--- a/volume_io/Volumes/multidim_arrays.c +++ b/volume_io/Volumes/multidim_arrays.c @@ -17,7 +17,7 @@ #include <float.h> #ifndef lint -static char rcsid[] = "$Header: /private-cvsroot/minc/volume_io/Volumes/multidim_arrays.c,v 1.12 1996-05-17 19:36:23 david Exp $"; +static char rcsid[] = "$Header: /private-cvsroot/minc/volume_io/Volumes/multidim_arrays.c,v 1.13 1996-08-21 15:35:33 david Exp $"; #endif /* ----------------------------- MNI Header ----------------------------------- @@ -124,6 +124,40 @@ return( size ); } +public void get_type_range( + Data_types type, + Real *min_value, + Real *max_value ) +{ + switch( type ) + { + case UNSIGNED_BYTE: + *min_value = 0.0; + *max_value = (Real) UCHAR_MAX; break; + case SIGNED_BYTE: + *min_value = (Real) SCHAR_MIN; + *max_value = (Real) SCHAR_MAX; break; + case UNSIGNED_SHORT: + *min_value = 0.0; + *max_value = (Real) USHRT_MAX; break; + case SIGNED_SHORT: + *min_value = (Real) SHRT_MIN; + *max_value = (Real) SHRT_MAX; break; + case UNSIGNED_LONG: + *min_value = 0.0; + *max_value = (Real) ULONG_MAX; break; + case SIGNED_LONG: + *min_value = (Real) LONG_MIN; + *max_value = (Real) LONG_MAX; break; + case FLOAT: + *min_value = (Real) -FLT_MAX; + *max_value = (Real) FLT_MAX; break; + case DOUBLE: + *min_value = (Real) -DBL_MAX; + *max_value = (Real) DBL_MAX; break; + } +} + /* ----------------------------- MNI Header ----------------------------------- @NAME : set_multidim_sizes @INPUT : array