[ismrmrd] 03/177: added last types for using C-style api

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:01:55 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 882cb06ba1718957850758cd586c0d854084c92e
Author: Michael S. Hansen <michael.hansen at nih.gov>
Date:   Mon Jul 14 15:56:11 2014 -0400

    added last types for using C-style api
---
 ismrmrd_hdf5.h           |  9 +++++++++
 ismrmrd_hdf5_datatypes.h | 28 +++++++++++-----------------
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/ismrmrd_hdf5.h b/ismrmrd_hdf5.h
index ea98339..75e733b 100644
--- a/ismrmrd_hdf5.h
+++ b/ismrmrd_hdf5.h
@@ -130,6 +130,15 @@ public:
 
 		t = this->type_container_.get_type< ImageHeader_with_data<cdouble_complex_t> >();
 		std::cout << "Type for ImageHeader_with_data<cdouble_complex_t>: " << t << std::endl;
+
+		t = this->type_container_.get_type< ImageHeader_with_data< std::complex<float> > >();
+		std::cout << "Type for ImageHeader_with_data< std::complex<float> >: " << t << std::endl;
+
+		t = this->type_container_.get_type< ImageHeader_with_data< std::complex<double>  > >();
+		std::cout << "Type for ImageHeader_with_data< std::complex<double> >: " << t << std::endl;
+
+		t = this->type_container_.get_type< std::string >();
+		std::cout << "Type for std::string: " << t << std::endl;
  	}
 
         /**
diff --git a/ismrmrd_hdf5_datatypes.h b/ismrmrd_hdf5_datatypes.h
index 675656a..09e3e69 100644
--- a/ismrmrd_hdf5_datatypes.h
+++ b/ismrmrd_hdf5_datatypes.h
@@ -327,26 +327,20 @@ namespace ISMRMRD
     return t;
   }
 
-/*
-
-template <> inline boost::shared_ptr<DataType> getIsmrmrdHDF5Type<ImageHeader_with_data< std::complex<float> > >()
-{
-	return getIsmrmrdHDF5Type<ImageHeader_with_data<complex_t> >();
-}
-
-template <> inline boost::shared_ptr<DataType> getIsmrmrdHDF5Type<ImageHeader_with_data< std::complex<double> > >()
-{
-	return getIsmrmrdHDF5Type<ImageHeader_with_data<double_complex_t> >();
-}
+  template <> inline hid_t IsmrmrdHDF5TypeContainer::getIsmrmrdHDF5Type<ImageHeader_with_data< std::complex<float> > >() {
+    return IsmrmrdHDF5TypeContainer::getIsmrmrdHDF5Type<ImageHeader_with_data<ccomplex_t> >();
+  }
 
-template <> inline boost::shared_ptr<DataType> getIsmrmrdHDF5Type<std::string>()
-{
-	boost::shared_ptr<DataType> ret(new StrType(0, H5T_VARIABLE));
-	return ret;
-}
+  template <> inline hid_t IsmrmrdHDF5TypeContainer::getIsmrmrdHDF5Type<ImageHeader_with_data< std::complex<double> > >() {
+    return IsmrmrdHDF5TypeContainer::getIsmrmrdHDF5Type<ImageHeader_with_data<cdouble_complex_t> >();
+  }
 
-*/
 
+  template <> inline hid_t IsmrmrdHDF5TypeContainer::getIsmrmrdHDF5Type< std::string >() {
+    hid_t t = H5Tcopy (H5T_C_S1);
+    H5Tset_size (t,H5T_VARIABLE);
+    return t;
+  }
   /* HDF5 C Interface (end) */
 
 template <typename T> boost::shared_ptr<DataType> getIsmrmrdHDF5Type();

-- 
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