def create_vol_geom(*varargin):
    """Create a volume geometry structure.

This method can be called in a number of ways:

``create_vol_geom(N)``:
    :returns: A 2D volume geometry of size :math:`N \\times N`.

``create_vol_geom((Y, X))``:
    :returns: A 2D volume geometry of size :math:`Y \\times X`.

``create_vol_geom(Y, X)``:
    :returns: A 2D volume geometry of size :math:`Y \\times X`.

``create_vol_geom(Y, X, minx, maxx, miny, maxy)``:
    :returns: A 2D volume geometry of size :math:`Y \\times X`, windowed as :math:`minx \\leq x \\leq maxx` and :math:`miny \\leq y \\leq maxy`.

``create_vol_geom((Y, X, Z))``:
    :returns: A 3D volume geometry of size :math:`Y \\times X \\times Z`.

``create_vol_geom(Y, X, Z)``:
    :returns: A 3D volume geometry of size :math:`Y \\times X \\times Z`.

``create_vol_geom(Y, X, Z, minx, maxx, miny, maxy, minz, maxz)``:
    :returns: A 3D volume geometry of size :math:`Y \\times X \\times Z`, windowed as :math:`minx \\leq x \\leq maxx` and :math:`miny \\leq y \\leq maxy` and :math:`minz \\leq z \\leq maxz` .


"""
    vol_geom = {'option': {}}
    if len(varargin) == 1 and isinstance(varargin[0], int) == 1:
        vol_geom['GridRowCount'] = varargin[0]
        vol_geom['GridColCount'] = varargin[0]
        vol_geom['option']['WindowMinX'] = -varargin[0] / 2.0
        vol_geom['option']['WindowMaxX'] = varargin[0] / 2.0
        vol_geom['option']['WindowMinY'] = -varargin[0] / 2.0
        vol_geom['option']['WindowMaxY'] = varargin[0] / 2.0
    elif len(varargin) == 1 and len(varargin[0]) == 2:
        vol_geom['GridRowCount'] = varargin[0][0]
        vol_geom['GridColCount'] = varargin[0][1]
        vol_geom['option']['WindowMinX'] = -varargin[0][1] / 2.0
        vol_geom['option']['WindowMaxX'] = varargin[0][1] / 2.0
        vol_geom['option']['WindowMinY'] = -varargin[0][0] / 2.0
        vol_geom['option']['WindowMaxY'] = varargin[0][0] / 2.0
    elif len(varargin) == 1 and len(varargin[0]) == 3:
        vol_geom['GridRowCount'] = varargin[0][0]
        vol_geom['GridColCount'] = varargin[0][1]
        vol_geom['GridSliceCount'] = varargin[0][2]
        vol_geom['option']['WindowMinX'] = -varargin[0][1] / 2.0
        vol_geom['option']['WindowMaxX'] = varargin[0][1] / 2.0
        vol_geom['option']['WindowMinY'] = -varargin[0][0] / 2.0
        vol_geom['option']['WindowMaxY'] = varargin[0][0] / 2.0
        vol_geom['option']['WindowMinZ'] = -varargin[0][2] / 2.0
        vol_geom['option']['WindowMaxZ'] = varargin[0][2] / 2.0
    elif len(varargin) == 2:
        vol_geom['GridRowCount'] = varargin[0]
        vol_geom['GridColCount'] = varargin[1]
        vol_geom['option']['WindowMinX'] = -varargin[1] / 2.0
        vol_geom['option']['WindowMaxX'] = varargin[1] / 2.0
        vol_geom['option']['WindowMinY'] = -varargin[0] / 2.0
        vol_geom['option']['WindowMaxY'] = varargin[0] / 2.0
    elif len(varargin) == 6:
        vol_geom['GridRowCount'] = varargin[0]
        vol_geom['GridColCount'] = varargin[1]
        vol_geom['option']['WindowMinX'] = varargin[2]
        vol_geom['option']['WindowMaxX'] = varargin[3]
        vol_geom['option']['WindowMinY'] = varargin[4]
        vol_geom['option']['WindowMaxY'] = varargin[5]
    elif len(varargin) == 3:
        vol_geom['GridRowCount'] = varargin[0]
        vol_geom['GridColCount'] = varargin[1]
        vol_geom['GridSliceCount'] = varargin[2]
    elif len(varargin) == 9:
        vol_geom['GridRowCount'] = varargin[0]
        vol_geom['GridColCount'] = varargin[1]
        vol_geom['GridSliceCount'] = varargin[2]
        vol_geom['option']['WindowMinX'] = varargin[3]
        vol_geom['option']['WindowMaxX'] = varargin[4]
        vol_geom['option']['WindowMinY'] = varargin[5]
        vol_geom['option']['WindowMaxY'] = varargin[6]
        vol_geom['option']['WindowMinZ'] = varargin[7]
        vol_geom['option']['WindowMaxZ'] = varargin[8]
    return vol_geom
