napari-imagej
napari-imagej copied to clipboard
Get rid of the New button's ability to make plain NumPy arrays, or at least make xarray the default
When running a computer op, the awesome New button lets you make a new output image, which is by default dimensioned the same as the input image. But the default array type is NumPy, meaning it has no dimensional axis metadata, and so the dimensions are lost after performing the calculation. I propose to make the default xarray, or even just use xarray always (I forget what the third option is though; maybe we need to keep it?). The New dialog probably also needs to be enhanced to allow specifying the axis type of each dimension, same as how you can specify the dimensional sizes—and this axis types list should by default match the input image's. This will make it much simpler to execute filter-type ops without losing image metadata.
There is a related question if some of @elevans's work is relevant here. Maybe the input image's properties should transfer over to the output image? It gets quite tricky though, and we may instead want to work on the MetaViews/RichViews and use that somehow; I'm not sure. But just preserving axis labels is for sure something we should do.