Sources should return a non-null VoxelDimensions
Closed this issue · 5 comments
AbstractSource
s, and therefore RandomAccessibleIntervalSource
return a null VoxelDimensions
.
I think I'd prefer returning a "default" with spacings of "1" with units of "pixels" or "voxels". Without this, anything depending on a Source
that uses VoxelDimensions
have to check whether it's null
or not (e.g. bigwarp - see this gitter conversation)
Any objections?
Agree.
I am OK with a returning a reasonable non-null
default VoxelDimension
. It does not affect me either way because I ignore the VoxelDimensions
in all my projects, for two reasons:
- In Paintera, "global" space is in nano meters (implicit).
- The meaning of
VoxelDimensions
is not entirely clear to me. Is it the size of a voxel of the transformed source in global space? Or is it the size of the transformed source before the transformation is applied? Does the source transform encode theVoxelDimensions
anyway?
Well, the above has the easiest reasonable, non-breaking fix.
With the complication that, to prevent this from changing the constructor of AbstractSource
,
the default voxeldimensions itself can't know how many dimensions it has, so this looks ugly.
Should have written in the comment that the number of dimensions there does not matter, since
DefaultVoxelDimensions
will always return 1
as its spacing..
If we're okay with this, I can PR (after giving a documenting the new DefaultVoxelDimensions
class.
sounds good