(core): session management and "atoms" overhaul
Description
currently, we use atoms mechanism to serialize our data and our activities using a proprietary format, unusable outside sight, although we could have used well known format, like .obj for a mesh, DICOM for an image... The other problem is atoms which seems hard to maintain: for example, adding a new data type is difficult (you need to make a "patch", sometimes a "mapper", etc.).
This issue main goal is to propose a design to replace the atom and also the activity serialization (the famous jsonz) to be able to store and retrieve a "session" or "workspace", once the the application is closed. The saved session should be a compressed and optionally encrypted archive that would contain:
- all data, stored in well known format, deduplicated.
- an index (json ?) to know which data belongs to which activity.
- all log files to ease debug
Session archive format
graph TD;
application.sight --> activity1([activity: 1]);
application.sight --> activity2([activity: 2]);
application.sight --> slmlog([slm.log]);
application.sight --> ogrelog([ogre.log]);
application.sight --> dicom([dicom: UUID:0001]);
application.sight --> vtk([vtk: UUID:0002]);
application.sight --> mesh([obj: UUID:0003]);
dicom --> filename([filename: skull.dcm]);
dicom --> origin([origin: https://pacs.ircad.fr/xxx/xxx]);
dicom --> various([...]);
activity1 --> requirements1([json: UUID:0001, UUID:0003, ...]);
activity2 --> requirements2([json: UUID:0002, UUID:0003, ...]);
Steps
We propose to modify Sight in several steps:
- Create new class SessionWriter and SessionReader in library io_base (#682 (closed)):
- Update embeded minizip from https://github.com/zlib-ng/minizip-ng
- Move libs/data/location/* to /libs/core/location/*
- implement new ArchiveReader / Writer to replace ReadZipArchive and WriteZipArchive (#696 (closed))
- Serialize GenericObject. They should be serialized as simple string stored in json (like before) (#683 (closed)):
- Serialize Composite (#684 (closed)).
- Serialize Image (.vti ?), Mesh (.ply ?) (#685 (closed))
- Serialize other objects (#739 (closed))
- Create a service to serialize a complete activity. This may be a drop in replacement for
SReader
andSWriter
(#752 (closed)) - Be able to serialize objects that do not belong to Sight (#775 (closed))
- Remove module::io::atoms and use
io::session::SReader
andio::session::SWriter
everywhere: (#776 (closed)) - Save logs inside session
- Automatic session saving