H5IMget_image_info can not get correct image info?

Hi, everyone:
    I am trying to get image data from *.H5 file for further processing. When I have the *.H5 file ID, and the dataset name, which contains the image data, I would like to query the information of the image before I can do any other thing. The problem is that I am confused by the result when I run my code.

    I use HDFView(2.5) to view the content of *.H5 file. There is a sample file named hdf5_test.h5 under "/samples" folder, a subfolder of the installation folder of HDF5View. In HDFView, I can see an image with dataset name as "3D THG", the dataset has a dimension of 8*72*144, and in HDFView, it displayed as 8 planes with same size as 72 in height and 144 in width(in pixel). When I use H5IMget_image_info to query the information of this image, I get height as 8 while width as 72. Then I went to have look at the source code of H5IMget_image_info in H5M.c, I was surprised by the following code:
    if ( has_attr == 1 )
    {
       ...
    }
    else
        /* This is a 8 bit image */
    {
        *height = dims[0];
        *width = dims[1];
        *planes = 1;
    }
    while dims contains data like {8, 72, 144}, which may mean 8 planes, and each plane with size of 72*144?
    Does anyone have any idea of what happen, or I have misunderstood the use of this function?

···

--

HDF5 image specification does not mention the order of multi-dimension
images. Applications decide what order they want. HDFView 2.5 uses the
order of [no. of images][height][width].

http://www.hdfgroup.org/HDF5/doc/ADGuide/ImageSpec.html

ĺÈçÑ© wrote:

···

Hi, everyone:
I am trying to get image data from *.H5 file for further processing. When I have the *.H5 file ID, and the dataset name, which contains the image data, I would like to query the information of the image before I can do any other thing. The problem is that I am confused by the result when I run my code.
I use HDFView(2.5) to view the content of *.H5 file There is a sample file named hdf5_test.h5 under "/samples" folder, a subfolder of the installation folder of HDF5View. In HDFView, I can see an image with dataset name as "3D THG", the dataset has a dimension of 8*72*144, and in HDFView, it displayed as 8 planes with same size as 72 in height and 144 in width(in pixel). When I use H5IMget_image_info to query the information of this image, I get height as 8 while width as 72. Then I went to have look at the source code of H5IMget_image_info in H5M.c, I was surprised by the following code:
if ( has_attr == 1 )
{
...
}
else
/* This is a 8 bit image */
{
*height = dims[0];
*width = dims[1];
*planes = 1;
}
while dims contains data like {8, 72, 144}, which may mean 8 planes, and each plane with size of 72*144?
Does anyone have any idea of what happen, or I have misunderstood the use of this function?

--

------------------------------------------------------------------------
ûÓйã¸æµÄÖÕÉíÃâ·ÑÓÊÏä,www.yeah.net <http://www.yeah.net/?from=footer>
------------------------------------------------------------------------

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