I have a short question about
To set the stage, a typical pattern for me is (pseudo-code):
// transform an image RandomAccessibleInterval rai; rra = RealViews.transform( Views.interpolate( Views.extend( rai ) ), transform); // create a "rastered" image transformedRai = Views.interval( Views.raster( rra ), transform.estimateBounds( rai ) );
This is fine, however sometimes I would like to create my
transformedRai at particular
voxelDimensions, because, e.g. the
transform might include a voxel calibration (as it is for example the case in the
AffineTransform specified in
The only way I currently know how to achieve this is to put a scaling transform on top of the actual transform:
// scale the transformed image such that integer coordinates correspond to desired voxel spacing: double[ ] scalings = createScalings( originalVoxelSpacings, desiredVoxelSpacings ); scalingTransform = new Scale( scalings ); transformIncludingScalingToVoxelGrid = transform.preConcatenate( scalingTransform); // and the rest as above
This works but somehow I felt that something like a
Views.raster( rra, voxelDimensions ) would make sense and be more readable. Is there a reason that this does not exist?
How are you guys achieving the task of going back from a
rra to a voxel grid?