[ismrmrd] 34/177: Forcing HDF calls to adhere to the 1.8 syntax.
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:01:59 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to annotated tag v1.1.0.beta.1
in repository ismrmrd.
commit 83fcf99b702ce4177cc9cb7751b9a72482aeb2da
Author: Souheil Inati <souheil.inati at nih.gov>
Date: Fri Aug 29 15:16:30 2014 -0400
Forcing HDF calls to adhere to the 1.8 syntax.
---
CMakeLists.txt | 5 +----
ismrmrd_dataset.c | 23 ++++++++++++-----------
2 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f8892a..08db682 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,10 +30,7 @@ else (WIN32)
endif (WIN32)
# required packages for main library
-find_package(HDF5 1.8 COMPONENTS C HL REQUIRED)
-
-# use only the HDF5 1.8 API (H5Gcreate2)
-add_definitions(-DH5_NO_DEPRECATED_SYMBOLS)
+find_package(HDF5 1.8 COMPONENTS C REQUIRED)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
diff --git a/ismrmrd_dataset.c b/ismrmrd_dataset.c
index 53081ec..fc94f88 100644
--- a/ismrmrd_dataset.c
+++ b/ismrmrd_dataset.c
@@ -171,7 +171,6 @@ static hid_t get_hdf5type_acquisitionheader(void) {
h5status = H5Tinsert(datatype, " measurement_uid", HOFFSET(ISMRMRD_AcquisitionHeader, measurement_uid), H5T_NATIVE_UINT32);
h5status = H5Tinsert(datatype, "scan_counter", HOFFSET(ISMRMRD_AcquisitionHeader, scan_counter), H5T_NATIVE_UINT32);
h5status = H5Tinsert(datatype, "acquisition_time_stamp", HOFFSET(ISMRMRD_AcquisitionHeader, acquisition_time_stamp), H5T_NATIVE_UINT32);
- h5status = H5Tinsert(datatype, "acquisition_time_stamp", HOFFSET(ISMRMRD_AcquisitionHeader, acquisition_time_stamp), H5T_NATIVE_UINT32);
arraydims[0] = ISMRMRD_PHYS_STAMPS;
vartype = H5Tarray_create(H5T_NATIVE_UINT32, 1, arraydims);
@@ -277,10 +276,12 @@ int ismrmrd_open_dataset(ISMRMRD_Dataset *dset, const bool create_if_needed) {
hid_t fileid;
herr_t h5status;
- /* Turn of HDF5 Errors */
- /* TODO, this is bad. Maybe have it compile time dependent */
- /* or add to our error log */
- H5Eset_auto1(NULL, NULL);
+ // TODO Opening the dataset when it doesn't already exist causes spew in the error log.
+ /* Turn of HDF5 errors completely*/
+ /* This is bad. Maybe have it compile time dependent */
+ /* or add to our error log */
+ //H5Eset_auto2(NULL, NULL, NULL);
+
/* Check if the file exists and is an HDF5 File */
h5status = H5Fis_hdf5(dset->filename);
@@ -366,7 +367,7 @@ int ismrmrd_write_header(const ISMRMRD_Dataset *dset, const char *xmlstring) {
dataspace = H5Screate_simple(1, dims, NULL);
datatype = get_hdf5type_xmlheader();
props = H5Pcreate (H5P_DATASET_CREATE);
- dataset = H5Dcreate(dset->fileid, path, datatype, dataspace, H5P_DEFAULT, props, H5P_DEFAULT);
+ dataset = H5Dcreate2(dset->fileid, path, datatype, dataspace, H5P_DEFAULT, props, H5P_DEFAULT);
/* Write it out */
/* We have to wrap the xmlstring in an array */
@@ -398,7 +399,7 @@ char * ismrmrd_read_header(const ISMRMRD_Dataset *dset) {
char *path = make_path(dset, "xml");
if (link_exists(dset, path)) {
- dataset = H5Dopen(dset->fileid, path, H5P_DEFAULT);
+ dataset = H5Dopen2(dset->fileid, path, H5P_DEFAULT);
datatype = get_hdf5type_xmlheader();
/* Read it into a 1D buffer*/
void *buff[1];
@@ -444,7 +445,7 @@ unsigned long ismrmrd_get_number_of_acquisitions(const ISMRMRD_Dataset *dset) {
char *path = make_path(dset, "data");
if (link_exists(dset, path)) {
- dataset = H5Dopen(dset->fileid, path, H5P_DEFAULT);
+ dataset = H5Dopen2(dset->fileid, path, H5P_DEFAULT);
dataspace = H5Dget_space(dataset);
h5status = H5Sget_simple_extent_dims(dataspace, dims, maxdims);
numacq = dims[0];
@@ -484,7 +485,7 @@ int ismrmrd_append_acquisition(const ISMRMRD_Dataset *dset, const ISMRMRD_Acquis
/* Check the path, extend or create if needed */
if (link_exists(dset, path)) {
/* open */
- dataset = H5Dopen(dset->fileid, path, H5P_DEFAULT);
+ dataset = H5Dopen2(dset->fileid, path, H5P_DEFAULT);
/* TODO check that the dataset's datatype is correct */
dataspace = H5Dget_space(dataset);
h5status = H5Sget_simple_extent_dims(dataspace, dims, maxdims);
@@ -501,7 +502,7 @@ int ismrmrd_append_acquisition(const ISMRMRD_Dataset *dset, const ISMRMRD_Acquis
/* enable chunking so that the dataset is extensible */
h5status = H5Pset_chunk (props, 1, chunk_dims);
/* create */
- dataset = H5Dcreate(dset->fileid, path, datatype, dataspace, H5P_DEFAULT, props, H5P_DEFAULT);
+ dataset = H5Dcreate2(dset->fileid, path, datatype, dataspace, H5P_DEFAULT, props, H5P_DEFAULT);
h5status = H5Pclose(props);
}
@@ -552,7 +553,7 @@ int ismrmrd_read_acquisition(const ISMRMRD_Dataset *dset, unsigned long index, I
/* Check the path, extend or create if needed */
if (link_exists(dset, path)) {
/* open */
- dataset = H5Dopen(dset->fileid, path, H5P_DEFAULT);
+ dataset = H5Dopen2(dset->fileid, path, H5P_DEFAULT);
/* The acquisition datatype */
datatype = get_hdf5type_acquisition();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ismrmrd.git
More information about the debian-science-commits
mailing list