nvladimus / npy2bdv

Fast writing of numpy 3d-arrays into HDF5 Fiji/BigDataViewer files.
GNU General Public License v3.0
32 stars 12 forks source link

Data always saved as int16 #10

Open rharkes opened 2 years ago

rharkes commented 2 years ago

It would be nice if npy2bdv would also offer the option to store data in a different datatype than int16. Maybe the writer could give a warning if data might have been altered? This is the case for any data not in [np.uint8 np.int8 np.int16].

nvladimus commented 2 years ago

Hi, @rharkes The question is whether other formats are used in BigDataViewer for microscopy images. From my experience, microscopy data is almost always uint16. What's your application field? What format do you actually need?

rharkes commented 2 years ago

I ran into the problem when binning multiple pixels together. The value of the sum went over 65535 so I thought to store them as uint32. But I agree this is probably an exception. However, after some analysis has been applied, data is often in float32 format. For example after convolution filters. Also we very often have multi channel data from confocal microscopes with 8 bit pixels per channel. There it is a bit of a waste to store and open them as uint16 I would say.

nvladimus commented 2 years ago

I agree that float32 makes sense to add. I am unfortunately quite busy at the moment to add and test this properly. As for int8 that some confocal scopes generate by default, I consider this a micro-crime, and it should be reported to microscopy police 👮 🔬