def cnvl_tc(idxPrc, aryPrfTcChunk, lstHrf, varTr, varNumVol, varTmpOvsmpl,<EOL>queOut, varHrfLen=<NUM_LIT>, dctPrm=None):
<EOL>tplInpShp = aryPrfTcChunk.shape<EOL>aryPrfTcChunk = aryPrfTcChunk.reshape((-<NUM_LIT:1>, aryPrfTcChunk.shape[-<NUM_LIT:1>]))<EOL>lstBse = []<EOL>aryTme = np.linspace(<NUM_LIT:0>, varHrfLen, (varHrfLen // varTr) * varTmpOvsmpl)<EOL>for fnHrf in lstHrf:<EOL><INDENT>if dctPrm is None:<EOL><INDENT>vecTmpBse = fnHrf(aryTme)<EOL><DEDENT>else:<EOL><INDENT>vecTmpBse = fnHrf(aryTme, **dctPrm)<EOL><DEDENT>vecTmpBse = np.divide(vecTmpBse, np.sum(vecTmpBse))<EOL>lstBse.append(vecTmpBse)<EOL><DEDENT>vecFrms = np.arange(<NUM_LIT:0>, varTr * varNumVol, varTr)<EOL>vecFrmTms = np.arange(<NUM_LIT:0>, varTr * varNumVol, varTr / varTmpOvsmpl)<EOL>aryConv = np.zeros((aryPrfTcChunk.shape[<NUM_LIT:0>], len(lstHrf), varNumVol),<EOL>dtype=np.float16)<EOL>for idxTc in range(<NUM_LIT:0>, aryConv.shape[<NUM_LIT:0>]):<EOL><INDENT>vecTcUps = aryPrfTcChunk[idxTc, :]<EOL>for indBase, base in enumerate(lstBse):<EOL><INDENT>base = base.astype(np.float64)<EOL>vecTcUps = vecTcUps.astype(np.float64)<EOL>col = fftconvolve(base, vecTcUps, mode='<STR_LIT>')[:vecTcUps.size]<EOL>f = interp1d(vecFrmTms, col)<EOL>aryConv[idxTc, indBase, :] = f(vecFrms + varTr/<NUM_LIT><EOL>).astype(np.float16)<EOL><DEDENT><DEDENT>tplOutShp = tplInpShp[:-<NUM_LIT:1>] + (len(lstHrf), ) + (varNumVol, )<EOL>if queOut is None:<EOL><INDENT>return aryConv.reshape(tplOutShp)<EOL><DEDENT>else:<EOL><INDENT>lstOut = [idxPrc,<EOL>aryConv.reshape(tplOutShp)]<EOL>queOut.put(lstOut)<EOL><DEDENT>
Convolution of time courses with HRF model.

    Parameters
    ----------
    idxPrc : int, positive
        Process ID of the process calling this function (for CPU
        multi-threading). In GPU version, this parameter is 0 (just one thread
        on CPU).
    aryPrfTcChunk : np.array
        2D array with model time course to be convolved with HRF.
    lstHrf : list
        List containing the different HRF functions.
    varTr : float, positive
        Time to repeat (TR) of the (fMRI) experiment.
    varNumVol : float, positive
        Number of volumes of the (fMRI) data.
    varTmpOvsmpl : float, positive
        Factor by which the time courses should be temporally upsampled.
    queOut : multiprocessing.queues.Queue
        Queue to put the results on.
    varHrfLen : float, positive, default=32
        Length of the HRF time course in seconds.
    dctPrm : dictionary, default None
        Dictionary with customized hrf parameters. If this is None, default
        hrf parameters will be used.

    Returns
    -------
    lstOut : list
        int, positive : Process ID of the process calling this function.
        2D np.array, float16 : Model time course convolved with HRF.

    References:
    -----
    [1] https://github.com/fabianp/hrf_estimation