What would be an efficient way to store an image?

I’m currently writing a few ROOT classes for the analysis of images.

These images are rather large (1024x1024 on average) and coded on 12 bits. I need a few operators on them (averaging, boolean operations between images, etc…)

During the first stage of the development, I stored the image data as a single dimension Int_t array (type Int_t*) in a class deriving from TObject. This was giving rather good results with CINT, however generating the dictionary for this class was impossible. rootcint was giving me the following error:

X.h […] no size specified
X.h […] pointer to fundamental type (manual intervention required)

(By the way, would anyone know the meaning of these errors ? Are dynamic allocations of Int_t arrays prohibited in classes because of some kinds of size considerations ?)

I have therefore switched to using a TArrayI object, however the performance is significantly worse. What would you suggest me to use ? Would using a TClonesArray with the “UncheckedAt” methods give better results ?

Thanks a lot.

[quote]During the first stage of the development, I stored the image data as a single dimension Int_t array (type Int_t*) in a class deriving from TObject. This was giving rather good results with CINT, however generating the dictionary for this class was impossible. rootcint was giving me the following error:

X.h […] no size specified
X.h […] pointer to fundamental type (manual intervention required)

(By the way, would anyone know the meaning of these errors ? Are dynamic allocations of Int_t arrays prohibited in classes because of some kinds of size considerations ?)[/quote]

You can choose one of these solutions
solution 1

int n;
int *data; //[n]

solution 2

TArrayS data;

solution 3’

std:;:vector data; //I/O will work only in ROOT 4.02 or newer

Using a TArrayI (or TArrayS) in your case should not introduce any performance
penalty

Rene