fix critical bug in write.nrrd (missing space dimension)

* this made the resultant nrrd files invalid