Reading Array of images

Hi,

I have a file with an array of 2D matrices (of int or float).

I'm trying to read them using c++ but I'm struggling.

This is the part of the code:

H5::H5File file("xppcom10-r0024.h5",H5F_ACC_RDONLY);
H5::DataSet dataset =
file.openDataSet("/Configure:0000/Run:0000/CalibCycle:0000/Camera::FrameV1/XppSb3Pim.1:Tm6740.1/image");

How to continue ?
Thanks,
marco

···

--
View this message in context: http://hdf-forum.184993.n3.nabble.com/Reading-Array-of-images-tp883969p883969.html
Sent from the hdf-forum mailing list archive at Nabble.com.

Hi Marco,

You might want to take a look at the examples at
http://www.hdfgroup.org/HDF5/doc/cpplus_RM/examples.html,
if you haven't. They might give you some ideas.

Binh-Minh

···

-----Original Message-----
From: hdf-forum-bounces@hdfgroup.org [mailto:hdf-forum-
bounces@hdfgroup.org] On Behalf Of marcocamma
Sent: Wednesday, June 09, 2010 8:12 PM
To: hdf-forum@hdfgroup.org
Subject: [Hdf-forum] Reading Array of images

Hi,

I have a file with an array of 2D matrices (of int or float).

I'm trying to read them using c++ but I'm struggling.

This is the part of the code:

H5::H5File file("xppcom10-r0024.h5",H5F_ACC_RDONLY);
H5::DataSet dataset =
file.openDataSet("/Configure:0000/Run:0000/CalibCycle:0000/Camera::FrameV1/
XppSb3Pim.1:Tm6740.1/image");

How to continue ?
Thanks,
marco
--
View this message in context: http://hdf-
forum.184993.n3.nabble.com/Reading-Array-of-images-tp883969p883969.html
Sent from the hdf-forum mailing list archive at Nabble.com.

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
Internal Virus Database is out-of-date.
Checked by AVG.
Version: 7.5.549 / Virus Database: 270.9.0/1778 - Release Date: 11/9/2008
2:14 PM

Hi Binh-Minh,
I have read them but I didn't manage,
marco

···

On 9 June 2010 18:42, Binh-Minh Ribler [via hdf-forum] < ml-node+884229-1029198921-286408@n3.nabble.com<ml-node%2B884229-1029198921-286408@n3.nabble.com> > wrote:

Hi Marco,

You might want to take a look at the examples at
http://www.hdfgroup.org/HDF5/doc/cpplus_RM/examples.html,
if you haven't. They might give you some ideas.

Binh-Minh

--
View this message in context: http://hdf-forum.184993.n3.nabble.com/Reading-Array-of-images-tp883969p884545.html
Sent from the hdf-forum mailing list archive at Nabble.com.

Hi Marco,

In casacore a hyperslab is read from a dataset in the following way.
It is part of a class HDF5DataSet; other functions set up the dataspace
and datatype hid_t.
The code can be seen in detail at

Note that Block is a std::vector-like class that already existed before
STL was there.

I hope it helps.
Cheers,
Ger

  void HDF5DataSet::get (const Slicer& section, void* buf)
  {
    // Define the data set selection.
    Block<hsize_t> offset = fromShape(section.start());
    Block<hsize_t> count = fromShape(section.length());
    Block<hsize_t> stride = fromShape(section.stride());
    if (H5Sselect_hyperslab (itsDSid, H5S_SELECT_SET, offset.storage(),

     stride.storage(), count.storage(), NULL) < 0) {
      throw HDF5Error("invalid data set array selection");
    }
    // Define a data space for the memory buffer.
    HDF5HidDataSpace memspace (H5Screate_simple (count.size(),
count.storage(), NULL));
    // Define memory selection.
    offset = 0; // set all offsets to 0
    if (H5Sselect_hyperslab (memspace, H5S_SELECT_SET,
offset.storage(),
     NULL, count.storage(), NULL) < 0) {
      throw HDF5Error("setting slab of memory buffer");
    }
    // Read the data.
    if (H5Dread (getHid(), itsDataType.getHidMem(), memspace, itsDSid,

H5P_DEFAULT, buf) < 0) {
      throw HDF5Error("reading slab from data set array");
    }
  }

marcocamma <marcocamma@gmail.com> 6/10/2010 6:13 AM >>>

Hi Binh-Minh,

I have read them but I didn't manage,

marco

···

On 9 June 2010 18:42, Binh-Minh Ribler [via hdf-forum] <[hidden email] ( /user/SendEmail.jtp?type=node&node=884545&i=0 )> wrote:

Hi Marco,

You might want to take a look at the examples at
http://www.hdfgroup.org/HDF5/doc/cpplus_RM/examples.html,
if you haven't. Â They might give you some ideas.

Binh-Minh

View this message in context: Re: Reading Array of images (
http://hdf-forum.184993.n3.nabble.com/Reading-Array-of-images-tp883969p884545.html
)
Sent from the hdf-forum mailing list archive (
http://hdf-forum.184993.n3.nabble.com/ ) at Nabble.com.