def create_proj_geom(intype, *args):
    """Create a projection geometry.

This method can be called in a number of ways:

``create_proj_geom('parallel', detector_spacing, det_count, angles)``:

:param detector_spacing: Distance between two adjacent detector pixels.
:type detector_spacing: :class:`float`
:param det_count: Number of detector pixels.
:type det_count: :class:`int`
:param angles: Array of angles in radians.
:type angles: :class:`numpy.ndarray`
:returns: A parallel projection geometry.


``create_proj_geom('fanflat', det_width, det_count, angles, source_origin, origin_det)``:

:param det_width: Size of a detector pixel.
:type det_width: :class:`float`
:param det_count: Number of detector pixels.
:type det_count: :class:`int`
:param angles: Array of angles in radians.
:type angles: :class:`numpy.ndarray`
:param source_origin: Position of the source.
:param origin_det: Position of the detector
:returns: A fan-beam projection geometry.

``create_proj_geom('fanflat_vec', det_count, V)``:

:param det_count: Number of detector pixels.
:type det_count: :class:`int`
:param V: Vector array.
:type V: :class:`numpy.ndarray`
:returns: A fan-beam projection geometry.

``create_proj_geom('parallel3d', detector_spacing_x, detector_spacing_y, det_row_count, det_col_count, angles)``:

:param detector_spacing_*: Distance between two adjacent detector pixels.
:type detector_spacing_*: :class:`float`
:param det_row_count: Number of detector pixel rows.
:type det_row_count: :class:`int`
:param det_col_count: Number of detector pixel columns.
:type det_col_count: :class:`int`
:param angles: Array of angles in radians.
:type angles: :class:`numpy.ndarray`
:returns: A parallel projection geometry.

``create_proj_geom('cone', detector_spacing_x, detector_spacing_y, det_row_count, det_col_count, angles, source_origin, origin_det)``:

:param detector_spacing_*: Distance between two adjacent detector pixels.
:type detector_spacing_*: :class:`float`
:param det_row_count: Number of detector pixel rows.
:type det_row_count: :class:`int`
:param det_col_count: Number of detector pixel columns.
:type det_col_count: :class:`int`
:param angles: Array of angles in radians.
:type angles: :class:`numpy.ndarray`
:param source_origin: Distance between point source and origin.
:type source_origin: :class:`float`
:param origin_det: Distance between the detector and origin.
:type origin_det: :class:`float`
:returns: A cone-beam projection geometry.

``create_proj_geom('cone_vec', det_row_count, det_col_count, V)``:

:param det_row_count: Number of detector pixel rows.
:type det_row_count: :class:`int`
:param det_col_count: Number of detector pixel columns.
:type det_col_count: :class:`int`
:param V: Vector array.
:type V: :class:`numpy.ndarray`
:returns: A cone-beam projection geometry.

``create_proj_geom('parallel3d_vec', det_row_count, det_col_count, V)``:

:param det_row_count: Number of detector pixel rows.
:type det_row_count: :class:`int`
:param det_col_count: Number of detector pixel columns.
:type det_col_count: :class:`int`
:param V: Vector array.
:type V: :class:`numpy.ndarray`
:returns: A parallel projection geometry.

``create_proj_geom('sparse_matrix', det_width, det_count, angles, matrix_id)``:

:param det_width: Size of a detector pixel.
:type det_width: :class:`float`
:param det_count: Number of detector pixels.
:type det_count: :class:`int`
:param angles: Array of angles in radians.
:type angles: :class:`numpy.ndarray`
:param matrix_id: ID of the sparse matrix.
:type matrix_id: :class:`int`
:returns: A projection geometry based on a sparse matrix.

"""
    if intype == 'parallel':
        if len(args) < 3:
            raise Exception(
                'not enough variables: astra_create_proj_geom(parallel, detector_spacing, det_count, angles)'
                )
        return {'type': 'parallel', 'DetectorWidth': args[0],
            'DetectorCount': args[1], 'ProjectionAngles': args[2]}
    elif intype == 'fanflat':
        if len(args) < 5:
            raise Exception(
                'not enough variables: astra_create_proj_geom(fanflat, det_width, det_count, angles, source_origin, origin_det)'
                )
        return {'type': 'fanflat', 'DetectorWidth': args[0],
            'DetectorCount': args[1], 'ProjectionAngles': args[2],
            'DistanceOriginSource': args[3], 'DistanceOriginDetector': args[4]}
    elif intype == 'fanflat_vec':
        if len(args) < 2:
            raise Exception(
                'not enough variables: astra_create_proj_geom(fanflat_vec, det_count, V)'
                )
        if not args[1].shape[1] == 6:
            raise Exception(
                'V should be a Nx6 matrix, with N the number of projections')
        return {'type': 'fanflat_vec', 'DetectorCount': args[0], 'Vectors':
            args[1]}
    elif intype == 'parallel3d':
        if len(args) < 5:
            raise Exception(
                'not enough variables: astra_create_proj_geom(parallel3d, detector_spacing_x, detector_spacing_y, det_row_count, det_col_count, angles)'
                )
        return {'type': 'parallel3d', 'DetectorSpacingX': args[0],
            'DetectorSpacingY': args[1], 'DetectorRowCount': args[2],
            'DetectorColCount': args[3], 'ProjectionAngles': args[4]}
    elif intype == 'cone':
        if len(args) < 7:
            raise Exception(
                'not enough variables: astra_create_proj_geom(cone, detector_spacing_x, detector_spacing_y, det_row_count, det_col_count, angles, source_origin, origin_det)'
                )
        return {'type': 'cone', 'DetectorSpacingX': args[0],
            'DetectorSpacingY': args[1], 'DetectorRowCount': args[2],
            'DetectorColCount': args[3], 'ProjectionAngles': args[4],
            'DistanceOriginSource': args[5], 'DistanceOriginDetector': args[6]}
    elif intype == 'cone_vec':
        if len(args) < 3:
            raise Exception(
                'not enough variables: astra_create_proj_geom(cone_vec, det_row_count, det_col_count, V)'
                )
        if not args[2].shape[1] == 12:
            raise Exception(
                'V should be a Nx12 matrix, with N the number of projections')
        return {'type': 'cone_vec', 'DetectorRowCount': args[0],
            'DetectorColCount': args[1], 'Vectors': args[2]}
    elif intype == 'parallel3d_vec':
        if len(args) < 3:
            raise Exception(
                'not enough variables: astra_create_proj_geom(parallel3d_vec, det_row_count, det_col_count, V)'
                )
        if not args[2].shape[1] == 12:
            raise Exception(
                'V should be a Nx12 matrix, with N the number of projections')
        return {'type': 'parallel3d_vec', 'DetectorRowCount': args[0],
            'DetectorColCount': args[1], 'Vectors': args[2]}
    elif intype == 'sparse_matrix':
        if len(args) < 4:
            raise Exception(
                'not enough variables: astra_create_proj_geom(sparse_matrix, det_width, det_count, angles, matrix_id)'
                )
        return {'type': 'sparse_matrix', 'DetectorWidth': args[0],
            'DetectorCount': args[1], 'ProjectionAngles': args[2],
            'MatrixID': args[3]}
    else:
        raise Exception('Error: unknown type ' + intype)
