MagneticResonanceImaging / MRIReco.jl

Julia Package for MRI Reconstruction
https://magneticresonanceimaging.github.io/MRIReco.jl/latest/
Other
85 stars 22 forks source link

A small misalignment with the ISMRMRD standard #192

Closed atsanda closed 2 weeks ago

atsanda commented 2 weeks ago

According to the schema for the ISMRMRD header, the echoTrainLength is not obligatory:

  <xs:complexType name="encodingType">
    <xs:all>
      ....
      <xs:element maxOccurs="1" minOccurs="0" name="echoTrainLength" type="xs:long" />
    </xs:all>
  </xs:complexType>

Yet, it is expected to be present in the parsing code. Here: https://github.com/MagneticResonanceImaging/MRIReco.jl/blob/52c3c0373e5b470dde20c6fc6bc77e0ce5f1ef06/MRIFiles/src/ISMRMRD/Parameters.jl#L181C1-L181C55

It can cause errors when trying to read a header without this field which are not self-explanatory. I propose to either add a custom error message indicating this difference with the standard or make it optional.

tknopp commented 2 weeks ago

then it should be optional

atsanda commented 2 weeks ago

I am sorry. I've double-checked the error, it turns out that the field was empty and not missing.

<echoTrainLength/>

Then it is expected to have an error.

It also works correctly when the field is missing.

atsanda commented 2 weeks ago

not a bug