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

TOML Serialisation of Sequences, Protocols and Scanner #42

Open
nHackel opened this issue Aug 4, 2022 · 2 comments
Open

TOML Serialisation of Sequences, Protocols and Scanner #42

nHackel opened this issue Aug 4, 2022 · 2 comments
Assignees

Comments

@nHackel
Copy link
Member

nHackel commented Aug 4, 2022

No description provided.

@nHackel nHackel self-assigned this Aug 4, 2022
@tknopp
Copy link
Member

tknopp commented Aug 4, 2022

It's not just TOML. We also need to get this into the MDF's. There are different possibilities. The common would be to make this "first class" and add various fields in the MDF itself, i.e. store all sequence values as HDF5 values.. This will make the MDF pretty dynamic. The alternative is to store the TOML's as strings in the MDF. That is very flexible but I cannot see all the consequences.

Right now, we do the first approach with our reconstruction data: https://github.com/MagneticParticleImaging/MPIFiles.jl/blob/master/src/RecoData.jl
There we put everything into Dicts and then serialize/deserialize.

What also needs to be taken into account that Sequences/Protocols/Scanners may change over time and that the stored versions (in an MDF) may be different from the ones installed at the scanner. This is not necessary a problem but we certainly want to have a way of checking for equality of sequences, so that we at least know if the sequence is currently installed in the scanner.

@nHackel
Copy link
Member Author

nHackel commented Aug 4, 2022

I already started one some of those tasks in the nh/toToml Branch. As a first try I defined these functions:
https://github.com/MagneticParticleImaging/MPIMeasurements.jl/blob/nh/toToml/src/Utils/StructToToml.jl

And then each struct defines the toDict! and toDictValue depending if they need special treatment. At the moment I created the dicts in the same way that they are being parsed during sequenceFromToml and can go back and forth from Sequence struct to Toml. The branch also works for the more simpler protocols already.

For equality I generated "==" functions for the types we defined, that essentially just compares all fields of a struct with "==" atm (

for T in [Sequence, GeneralSettings, AcquisitionSettings, MagneticField, TxChannel, ContinuousElectricalChannel, ContinuousMechanicalRotationChannel,
)

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

No branches or pull requests

3 participants