problem to save a predicted big 3d image
rprisca opened this issue · comments
Prisca R commented
Hi,
I trained my own model and now I would like to predict a big 3d image : 512 slices (for z-axis) and 5888 (for x-axis) * 2048 (for y-axis)
I used the following function “model.predict_instances_big” for the prediction.
The prediction works well.
However when I want to save the predicted image with “save_tiff_imagej_compatible”, I have this warning “tiffwritter : truncating ImageJ file”, I’m afraid to lose some information. How do I fix this ?
Thank you for your help.
Uwe Schmidt commented
Prisca R commented
Hi @uschmidt83,
Finally, i use a function from tifffile
from tifffile import memmap
# reading
#labels : predicted image with StarDist
original_image = memmap('temp-1024slices.tif', shape=np.shape(labels), dtype='int16',
bigtiff=True)
# writing
for i in range(labels.shape[0]):
original_image[i]=(labels[i])
original_image.flush()
and it works.
Thank you !