dchansen / Gadgetron.jl

MIT License
3 stars 1 forks source link

Issue to convert the xml part of the header into a MRDheader struct due to UserParameterBase64 #12

Open aTrotier opened 11 months ago

aTrotier commented 11 months ago

Hi David,

I am starting to take a look at your work with Julia. I am trying to load this dataset into julia : https://zenodo.org/record/5059979

But I have an error due when Gadgetron.jl try to convert the header xml into the MRDHeader struct due to the UserParameterBase64 field :

using Gadgetron
port = 18000
using Gadgetron.Sockets

# socket
socket = Sockets.listen(Sockets.IPv6(0),port) 
socket = Sockets.accept(socket)

# read cfg
cfg = Gadgetron.read_config(socket)

# read header
message_id = Gadgetron.read_id(socket)
head_str =  MRD.read_string(socket)

doc = parsexml(head_str)
MRD.MRDHeader(doc) ## ERROR

##  lets try to remove user_parameter Fields
write("/opt/code/julia_code/doc.xml",doc)
# delete lines by hand and read the new xml
doc_rm = readxml("/opt/code/julia_code/doc_delete_UserParameterBase64.xml")
a=MRD.MRDHeader(doc_rm) # it works

If I remove the userParameterBase64 field from the xml, I am then able to convert it. You will find attach the config file and the header xml.

More test :

I don't have any issue to read and reconstruct this file with a connection to matlab and even to perform the reconstruction with MRIReco.jl cfg_xml_plutonotebook.zip

As a workaround It seems to work if I comment that line : https://github.com/dchansen/Gadgetron.jl/blob/cc811e6e3a5638802d8c77d5f563a327b0143b5b/src/MRDHeader.jl#L169

aTrotier commented 11 months ago

Hum, seems that userParameterBase64::UN{Vector{UserParameter{String}}}=nothing,"~" give the same results as matlab.

if the user need to have access to something readable :

using Base64
String(base64decode(a.userParameters.userParameterBase64[1].value))

I don't really know what are stored in SiemensBuffer_PROTOCOL_MeasYaps and SiemensBuffer_PROTOCOL_Phoenix