I found what causes the error myself.
The dimension of data I provided is 64 64 252 1 which is wrong. The
correct dimension should be 64 64 36 7.
Does anyone know any software can convert a DICOM image stack (which
contains 7 volumes in order) to a 4D analyze format?
Thanks for your kind help.