Unified the computation of the required memory that needs to be allocated when loading a nifti-file.
Fixed handling of d3matrix that caused the allocation of too much memory for matrices