This is a convenience method to safely wrap any given VTK data object
    to its appropriate ``vtki`` data object.

def wrap(vtkdataset):
    """This is a convenience method to safely wrap any given VTK data object
    to its appropriate ``vtki`` data object.
    """
    wrappers = {
        'vtkUnstructuredGrid' : vtki.UnstructuredGrid,
        'vtkRectilinearGrid' : vtki.RectilinearGrid,
        'vtkStructuredGrid' : vtki.StructuredGrid,
        'vtkPolyData' : vtki.PolyData,
        'vtkImageData' : vtki.UniformGrid,
        'vtkStructuredPoints' : vtki.UniformGrid,
        'vtkMultiBlockDataSet' : vtki.MultiBlock,
        }
    key = vtkdataset.GetClassName()
    try:
        wrapped = wrappers[key](vtkdataset)
    except:
        logging.warning('VTK data type ({}) is not currently supported by vtki.'.format(key))
        return vtkdataset # if not supported just passes the VTK data object
    return wrapped