Mercurial > hg > minc-tools
changeset 1672:49872dfe8c06
Use imax_id and imin_id from the volume structure
author | bert <bert> |
---|---|
date | Tue, 10 Feb 2004 20:13:46 +0000 |
parents | eda238587288 |
children | fb755638b4fe |
files | libsrc2/slice.c |
diffstat | 1 files changed, 4 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/libsrc2/slice.c +++ b/libsrc2/slice.c @@ -44,7 +44,6 @@ int ndims; int i; int result; - char path[128]; /* TODO: string length? */ if (volume == NULL || value == NULL) { return (MI_ERROR); /* Bad parameters */ @@ -57,16 +56,10 @@ file_id = volume->hdf_id; if (opcode & MIRW_SCALE_MIN) { - sprintf(path, "/minc-2.0/image/%d/image-min", - volume->selected_resolution); + dset_id = volume->imin_id; } else { - sprintf(path, "/minc-2.0/image/%d/image-max", - volume->selected_resolution); - } - dset_id = midescend_path(file_id, path); - if (dset_id < 0) { - return (MI_ERROR); + dset_id = volume->imax_id; } fspc_id = H5Dget_space(dset_id); @@ -108,7 +101,6 @@ H5Sclose(fspc_id); H5Sclose(mspc_id); - H5Dclose(dset_id); return (MI_NOERROR); } @@ -255,7 +247,6 @@ hid_t fspc_id; hid_t mspc_id; int result; - char path[128]; if (volume == NULL || value == NULL) { return (MI_ERROR); @@ -275,16 +266,10 @@ } file_id = volume->hdf_id; if (opcode & MIRW_SCALE_MIN) { - sprintf(path, "/minc-2.0/image/%d/image-min", - volume->selected_resolution); + dset_id = volume->imin_id; } else { - sprintf(path, "/minc-2.0/image/%d/image-max", - volume->selected_resolution); - } - dset_id = midescend_path(file_id, path); - if (dset_id < 0) { - return (MI_ERROR); + dset_id = volume->imax_id; } fspc_id = H5Dget_space(dset_id); @@ -326,7 +311,6 @@ H5Sclose(fspc_id); H5Sclose(mspc_id); - H5Dclose(dset_id); return (MI_NOERROR); }