Numpy python Tif Format of a 3D stack


#1

I have the following problem. I want to save a tif file with numpy in python of a 3D array and open it with imageJ in a macro. The problem ist that, whenever I save it, and manually open it in ImageJ it is recognizes as a hyperstack. I think the problem is that the file is over 4GB, is that possible?


#2

Hi @Varlor,

How are you saving the tif exactly?

Can you elaborate? Do you mean that ImageJ thinks the third axis is time (or channels?)
rather than a third spatial dimension?

If so, then I’d bet that however you’re writing the tiff is not saving metadata that ImageJ uses to interpret the 3rd (or 4th or 5th) dimension.

I havn’t tried these, but you may have luck saving to a different format, e.g. nrrd or nifti.
ImageJ can read both of these.

John


#3

Ok, that could be. I saving them with io.imsave(‘test.tif’,array.astype(np.npunit16)), the problem is that I have to use the standard packages for python. If i do it with a smaller array, it works and imageJ open it as 3d stack.


#4

whoa, weird…
What size does it work for and what for size does it fail?


#5

I have to check this, maybe by creating random arrays. I think its when the file becomes larger than 4GB. Then it also has no information about x,y,z ranges in the properties of the files.