def transform_space(data, transform, voxel_dim, origin):
    """ Apply a 3x4 linear transform to the world coordinate system.

    This affects pose as well as TSDFs.
    """

    for frame in data['frames']:
        frame['pose'] = transform.inverse() @ frame['pose']

    voxel_sizes = [int(key[4:]) for key in data if key[:3]=='vol']

    for voxel_size in voxel_sizes:
        # compute voxel_dim for this voxel_size
        scale = voxel_size/min(voxel_sizes)
        vd = [int(vd/scale) for vd in voxel_dim]
        key = 'vol_%02d'%voxel_size

        # do transform
        data[key] = data[key].transform(transform, vd, origin)

    return data