Mercurial > hg > minc-tools
changeset 2214:f54678a55112
*** empty log message ***
author | baghdadi <baghdadi> |
---|---|
date | Wed, 12 Oct 2005 15:32:07 +0000 |
parents | 26888b506ed0 |
children | f1bc7ecb5431 |
files | libsrc2/volume.c |
diffstat | 1 files changed, 14 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libsrc2/volume.c +++ b/libsrc2/volume.c @@ -290,12 +290,9 @@ break; case MI_CLASS_LABEL: - /* A volume of class LABEL must have an integer type. + /* A volume of class LABEL must have an integer type (positive). */ switch (volume_type) { - case MI_TYPE_BYTE: - case MI_TYPE_SHORT: - case MI_TYPE_INT: case MI_TYPE_UBYTE: case MI_TYPE_USHORT: case MI_TYPE_UINT: @@ -1221,7 +1218,19 @@ break; case H5T_ENUM: /* label images */ - handle->volume_type = MI_TYPE_UINT; + switch (nbytes) { + case 1: + handle->volume_type = MI_TYPE_UBYTE; + break; + case 2: + handle->volume_type = MI_TYPE_USHORT; + break; + case 4: + handle->volume_type = MI_TYPE_UINT; + break; + default: + return (MI_ERROR); + } break; default: return (MI_ERROR);