aimsdata  5.0.5
Neuroimaging data handling
Volumes

AimsData will soon be deprecated. Don't use it anymore. carto::Volume will replace it. It is defined in a new library: cartodata.

In the meantime, AimsData will only be a wrapper to carto::Volume. This means carto::Volume is actually used behind the scene. AimsData wrapper is still provided for compatibility (and because it would have been too much work to eradicate it from our own codes), but should progressively disapear from all codes.

carto::Volume API will be accessible from a AimsData object so programs working with AimsData can switch to carto::Volume whenever they want.

In the other way, making an AimsData from a carto::Volume is trivial: just give it to AimsData constructor.

This way, compatibility is provided in both ways: old code will continue to work as is using AimsData, and new code using carto::Volume will be able to use old processing routines written for AimsData.

The native AimsData class (the old one, without a wrapper) has been replaced by the wrapper (<aims/data/cartodatavolume.h>) in Aims 3.0.

In the future, other base classes (meshes, buckets, texture...) may move to a cleaner and more modern version into cartodata library.

Things that must change soon (now!)

A complete 100% compatibility is difficult to achieve (not to say impossible), so there will be a small number of behaviour change in AimsData. These affect mainly IO and copy operations:

  • AimsData::setHeader() will now perform a copy of all attributes of the given header, not just grab the pointer. This is needed by the underlying carto::Volume header (which is builtin, not a changeable pointer). To keep most compatibility with the former behaviour, giving a Header* to setHeader() will still transfer ownership of the header to the target AimsData. But as the input header will not be kept at all, it will just be deleted by setHeader(). This has two consequences:
    • a header is no longer usable after it has been passed to setHeader, whereas it used to still live until the AimsData was deleted. So keep in mind that you must perform all operations on the header before passing it to the volume.
    • working on a header after it is passed to setHeader() will be a double mistake: you will work on a deleted structure, and changes will not affect at all the AimsData owning it.
  • copying an AimsData will not copy its header anymore: the data block was and will still be ref-counted, but now the data block is not separable from its header anymore: they are tied in a single carto::Volume structure, so the header will be shared just like the data. Changes done to the header of a copied volume will also affect the original volume (unless a clone() is performed instead of a regular copy).