def worldToVoxelCoord(worldCoord, origin, spacing): """ only valid if there is no rotation component """ voxelCoord = np.rint((worldCoord-origin)/ spacing).astype(np.int); return voxelCoord