New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for H5T_REFERENCE #42

Open
RyanHope opened this Issue Feb 24, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@RyanHope
Copy link

RyanHope commented Feb 24, 2017

Matlab file format version 7.3 is actually HDF5 but not all of the fields can be read/accessed with your h5 package.

> d.r['EEG/chanlocs/labels']
Error in GetDataSetType(dsetptr) : Datatype unknown.
> d.r['EEG/chanlocs'][]
Error in d.r["EEG/chanlocs"][] : object of type 'S4' is not subsettable

This is what it looks like in matlab:

>> EEG.chanlocs

ans = 

  1×128 struct array with fields:

    labels
    type
    theta
    radius
    X
    Y
    Z
    sph_theta
    sph_phi
    sph_radius
    urchan
    ref

What can I do to help you get this supported? If I provided a test file would that help?

@mannau

This comment has been minimized.

Copy link
Owner

mannau commented Feb 25, 2017

@RyanHope

This comment has been minimized.

Copy link

RyanHope commented Feb 25, 2017

Here is a link to a test file: https://cmu.box.com/shared/static/gwi0m0uls4rgbf1f5t5zeaq3k2ea2293.set
What other information do you need from me about the problem? It seems like I can't access any "struct arrays" in matlab terms. In the output below I can't access the data in any of the fields that start with a +. Supposedly this python package supports matlab files (https://github.com/frejanordsiek/hdf5storage) but for some reason it also has an issue loading my test file. However, it at least claims to support matlabs struct arrays and might be a good reference.

> require(h5)
> d = h5file('debug.set', 'r')
> d['EEG']
H5Group '/EEG'
+ chaninfo
+ chanlocs
+ etc
+ event
+ reject
+ stats
+ urevent
D comments
D condition
D data
D datfile
D dipfit
D epoch
D epochdescription
D eventdescription
D filename
D filepath
D group
D history
D icaact
D icachansind
D icasphere
D icasplinefile
D icaweights
D icawinv
D nbchan
D pnts
D ref
D saved
D session
D setname
D specdata
D specicaact
D splinefile
D srate
D subject
D times
D trials
D urchanlocs
D xmax
D xmin
A MATLAB_class
A MATLAB_fields 

Here is what some of those fields look like in Matlab:

>> EEG.etc

ans = 

  struct with fields:

                      T0: [2016 12 7 9 59 1]
              eeglabvers: '14.0.0'
      clean_channel_mask: [1×143 logical]
       clean_sample_mask: [1×2045440 logical]
                ICAnotes: [1×1 struct]
    icaweights_beforerms: [89×85 double]
     icasphere_beforerms: [85×85 double]
>> EEG.event

ans = 

  1×11 struct array with fields:

    latency
    game
    type
    init_index
    init_time
    urevent
    duration
>> EEG.stats

ans = 

  struct with fields:

              jp: []
             jpE: []
           icajp: []
          icajpE: []
            kurt: []
           kurtE: []
         icakurt: []
        icakurtE: []
        compenta: []
        compentr: []
       compkurta: []
       compkurtr: []
    compkurtdist: []
@mannau

This comment has been minimized.

Copy link
Owner

mannau commented Aug 27, 2017

According to h5dump labels is an object reference (H5T_REFERENCE):

$ h5dump --header -d EEG/chanlocs/labels debug.set

HDF5 "debug.set" {
DATASET "EEG/chanlocs/labels" {
   DATATYPE  H5T_REFERENCE { H5T_STD_REF_OBJECT }
   DATASPACE  SIMPLE { ( 128, 1 ) / ( 128, 1 ) }
}
}

This is currently not supported by h5.

@mannau mannau changed the title Matlab 7.3 support Add support for H5T_REFERENCE Aug 27, 2017

@mannau mannau added the enhancement label Aug 27, 2017

@agilebean

This comment has been minimized.

Copy link

agilebean commented Mar 15, 2018

May I ask about the release planning for this feature?
Is the support for H5T_REFERENCE object reference within the scope of the next 1-2 months?
Would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment