Convert image dtypes

Hi there,

I have a problem regarding storage of transformed images.
I applied several filters on 3D images and now I see after transformation the dtype changed because of the transformation from int16 (original image) to float32 (transformed image).

My question is: how to reduce the space for the images but not loose too much information (as these float values can not be stored in int)?

sitk.GetArrayFromImage((original_img)[82,:,:])
array([[-1024, -1024, -1024, …, -1024, -1024, -1024],
[-1024, -1024, -1024, …, -1024, -1024, -1024],
[-1024, -1024, -1024, …, -1024, -1024, -1024],
…,
[-1024, -1024, -1024, …, -1024, -1024, -1024],
[-1024, -1024, -1024, …, -1024, -1024, -1024],
[ 0, 0, 0, …, 0, 0, 0]], dtype=int16)

sitk.GetArrayFromImage((LoG_img)[82,:,:])
array([[ 3.80310001e-14, 3.88584726e-13, -2.41688917e-12, …,
6.98954403e-13, -3.71507295e-14, -1.73147141e-13],
[ 3.66081982e-14, 3.88977452e-13, -2.46619435e-12, …,
6.82724547e-13, -4.15325665e-15, -1.72151532e-13],
[ 5.34215142e-14, 4.18245950e-13, -2.53347083e-12, …,
6.88941092e-13, 3.52969641e-14, -1.56478942e-13],
…,
[ 4.03164481e-13, 1.00738938e-12, -5.48105008e-12, …,
5.36486166e-13, -9.33539677e-14, -1.66741566e-13],
[ 3.93933394e-13, 1.02557459e-12, -5.49871173e-12, …,
5.96517898e-13, -1.19890073e-13, -1.71319800e-13],
[ 3.74245448e-13, 1.00267516e-12, -4.71460111e-12, …,
6.80374431e-13, -1.12430275e-13, -1.70331753e-13]], dtype=float32)

Of the image formats ITK supports, I think only DICOM can avoid writing 32 bits per pixel (by writing 16-bit ints in the pixel buffer, combined with float rescale slope and intercept). Much easier is to enable compression - most formats support it.