Skip to content
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

Not yet supported #379

Closed
lukasfischer83 opened this issue Mar 17, 2017 · 12 comments · Fixed by #614
Closed

Not yet supported #379

lukasfischer83 opened this issue Mar 17, 2017 · 12 comments · Fixed by #614

Comments

@lukasfischer83
Copy link

Hi, I would like to read the timestamps of the attached file and get an "Not yet supported" error. Is there a way to just extract the column with the timestamp? Will this be supported in future?
Thanks, Lukas

example.h5.zip

@lukasfischer83
Copy link
Author

Any progress in that?

@ggggggggg
Copy link
Contributor

Can you do a bit more to help us understand what is going on? Try running h5dump (the command line tool) on your file, and post the output. This should tell us exactly what is in the file. And then can you post the exact code you used (starting at using HDF5) to get to your error, along with the complete error message?

@lukasfischer83
Copy link
Author

The file is attached in the first post, running h5dump gives:
h5dump example.h5
h5dump example.h5 HDF5 "example.h5" { GROUP "/" { GROUP "AcquisitionLog" { DATASET "Log" { DATATYPE H5T_COMPOUND { H5T_STD_U64LE "timestamp"; H5T_STRING { STRSIZE 20; STRPAD H5T_STR_NULLTERM; CSET H5T_CSET_ASCII; CTYPE H5T_C_S1; } "timestring"; H5T_STRING { STRSIZE 256; STRPAD H5T_STR_NULLTERM; CSET H5T_CSET_ASCII; CTYPE H5T_C_S1; } "logtext"; } DATASPACE SIMPLE { ( 2 ) / ( H5S_UNLIMITED ) } DATA { (0): { 131199159589280000, "02/10/2016 22:05:58", "Acquisition started" }, (1): { 131199165642100000, "02/10/2016 22:16:04", "End of acquisition" } } } } } }

image

@ggggggggg
Copy link
Contributor

ggggggggg commented May 11, 2017

You must have an out of date version of HDF5, I get a different error. It has to do with sizeof(filetype) being larger than typemax(UInt8) here:

membersize[i] = sizeof(filetype)

If I change membersize to a Vector{UInt16} I get a different error saying

ERROR: MethodError: no method matching unpad(::Array{UInt8,1}, ::Int64)
 in read_row(::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Array{Type,1}, ::Array{UInt16,1}) at /Users/user/.julia/v0.5/HDF5/src/HDF5.jl:1407

I don't know much about reading compound types, so I don't know what else to try.

@lukasfischer83
Copy link
Author

I tested again in with version 0.8.1, now I am getting this Error:


LoadError: InexactError()
while loading untitled, in expression starting on line 2
 in read(::HDF5.HDF5Dataset, ::Type{Array{HDF5.HDF5Compound{3},N}}) at HDF5.jl:1382
 in read(::HDF5.HDF5Dataset) at HDF5.jl:1196
 in read(::HDF5.HDF5File, ::String) at HDF5.jl:1184
 in h5read(::String, ::String) at HDF5.jl:623
 in include_string(::String, ::String) at loading.jl:441
 in include_string(::Module, ::String, ::String) at eval.jl:34
 in (::Atom.##59#62{String,String})() at eval.jl:73
 in withpath(::Atom.##59#62{String,String}, ::String) at utils.jl:30
 in withpath(::Function, ::String) at eval.jl:38
 in macro expansion at eval.jl:71 [inlined]
 in (::Atom.##58#61{Dict{String,Any}})() at task.jl:60

Any ideas how this could be fixed? Thanks, Lukas

@ggggggggg
Copy link
Contributor

Thats the first error I mentioned. There is a UInt8 array, and it tries to assign a number too large for UInt8 into that array. I don't know how to fix it.

@tknopp
Copy link
Contributor

tknopp commented Jul 2, 2017

I get the same error for the files located at:
https://sourceforge.net/projects/ismrmrd/files/data/
It is a data format for storing MRI data. Would be great if would be possible reading it in Julia.

@tknopp
Copy link
Contributor

tknopp commented Jul 2, 2017

I have a fix

tknopp added a commit that referenced this issue Jul 2, 2017
Fixes #379 by simple increasing the membersize field.
This was referenced Jul 2, 2017
@lukasfischer83
Copy link
Author

lukasfischer83 commented Jul 3, 2017

I tested your proposition and got several lines further, but with the original file (first post) I still get the error gggggggg mentioned earlier:

`MethodError: no method matching unpad(::Array{UInt8,1}, ::Int64)

in read_row(::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Array{Type,1}, ::Array{UInt64,1}) at HDF5.jl:1350
in read(::HDF5.HDF5Dataset, ::Type{Array{HDF5.HDF5Compound{3},N}}) at HDF5.jl:1403
in read(::HDF5.HDF5Dataset) at HDF5.jl:1196
in read(::HDF5.HDF5File, ::String) at HDF5.jl:1184
in h5read(::String, ::String) at HDF5.jl:623
in include_string(::String, ::String) at loading.jl:441
in eval(::Module, ::Any) at boot.jl:234
in (::Atom.##65#68)() at eval.jl:102
in withpath(::Atom.##65#68, ::Void) at utils.jl:30
in withpath(::Function, ::Void) at eval.jl:38
in macro expansion at eval.jl:101 [inlined]
in (::Atom.##64#67{Dict{String,Any}})() at task.jl:60

`

Any hints?

@tknopp
Copy link
Contributor

tknopp commented Jul 3, 2017

no, I also get stuck in that code path, see #426. But your error is different.

@lukasfischer83
Copy link
Author

Ok, I got it to work, at least in my case.
I changed the line 1350

push!(row, unpad(read(io, UInt8, dsize), H5T_STR_NULLPAD))

to

push!(row, unpad(String(read(io, UInt8, dsize)), Cint(H5T_STR_NULLPAD)))

and it works now... I don't know exactly what was going on there, just tried to get the function signature right and it worked. Maybe someone with higher skill could fix this properly.

@tknopp
Copy link
Contributor

tknopp commented Jul 3, 2017

see #393

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants