The way dvolalloc() is used in conjunction with NifTI header information is inconsistent with the expected usage of dvolalloc().
This affects ReadNifTI3D() and WriteNifTI3D especially.
The programs responseestimation, hurst and conjunctions are affected.
dvol myarray = dvolalloc(z,y,x)
expects z to be the slowest varying index and x the fastest varying index. This is consistent with C ways of thing about arrays, i.e., myarray[z][y][x], with x the fastest varying index.
Unfortunately, when using dvolalloc() with nifti, we have
dvol myarray = dvolalloc(image.dim[1], image.dim[2], image.dim[3])
image.dim[1] is actually the fastest moving index for Nifti image. This means that for the double*** returned by dvolalloc, we now have myarray[X][Y][Z], with X the fastest varying index.
The result is that the 1D array containing the data, myarray[0][0] is INCOMPATIBLE with C standard array expectation.
So far, since this error had been applied consistently, the programs are behaving correctly.
However, this rules out mixing ReadNifTI3D(), WriteNifTI3D() with niftilib, in particular,
nim->data != myarray[0][0]