def crt_prf_tc(aryNrlTc, varNumVol, varTr, varTmpOvsmpl, switchHrfSet,<EOL>tplPngSize, varPar, dctPrm=None, lgcPrint=True):
<EOL>if switchHrfSet == <NUM_LIT:3>:<EOL><INDENT>lstHrf = [spmt, dspmt, ddspmt]<EOL><DEDENT>elif switchHrfSet == <NUM_LIT:2>:<EOL><INDENT>lstHrf = [spmt, dspmt]<EOL><DEDENT>elif switchHrfSet == <NUM_LIT:1>:<EOL><INDENT>lstHrf = [spmt]<EOL><DEDENT>tplInpShp = aryNrlTc.shape<EOL>aryNrlTc = np.reshape(aryNrlTc, (-<NUM_LIT:1>, aryNrlTc.shape[-<NUM_LIT:1>]))<EOL>if varPar == <NUM_LIT:1>:<EOL><INDENT>aryNrlTcConv = cnvl_tc(<NUM_LIT:0>, aryNrlTc, lstHrf, varTr,<EOL>varNumVol, varTmpOvsmpl, None, dctPrm=dctPrm)<EOL><DEDENT>else:<EOL><INDENT>lstNrlTc = np.array_split(aryNrlTc, varPar)<EOL>queOut = mp.Queue()<EOL>lstPrcs = [None] * varPar<EOL>lstConv = [None] * varPar<EOL>if lgcPrint:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>for idxPrc in range(<NUM_LIT:0>, varPar):<EOL><INDENT>lstPrcs[idxPrc] = mp.Process(target=cnvl_tc,<EOL>args=(idxPrc,<EOL>lstNrlTc[idxPrc],<EOL>lstHrf,<EOL>varTr,<EOL>varNumVol,<EOL>varTmpOvsmpl,<EOL>queOut),<EOL>kwargs={'<STR_LIT>': dctPrm},<EOL>)<EOL>lstPrcs[idxPrc].Daemon = True<EOL><DEDENT>for idxPrc in range(<NUM_LIT:0>, varPar):<EOL><INDENT>lstPrcs[idxPrc].start()<EOL><DEDENT>for idxPrc in range(<NUM_LIT:0>, varPar):<EOL><INDENT>lstConv[idxPrc] = queOut.get(True)<EOL><DEDENT>for idxPrc in range(<NUM_LIT:0>, varPar):<EOL><INDENT>lstPrcs[idxPrc].join()<EOL><DEDENT>if lgcPrint:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>lstConv = sorted(lstConv)<EOL>aryNrlTcConv = np.zeros((<NUM_LIT:0>, switchHrfSet, varNumVol), dtype=np.float32)<EOL>for idxRes in range(<NUM_LIT:0>, varPar):<EOL><INDENT>aryNrlTcConv = np.concatenate((aryNrlTcConv, lstConv[idxRes][<NUM_LIT:1>]),<EOL>axis=<NUM_LIT:0>)<EOL><DEDENT>del(aryNrlTc)<EOL>del(lstConv)<EOL><DEDENT>tplOutShp = tplInpShp[:-<NUM_LIT:1>] + (len(lstHrf), ) + (varNumVol, )<EOL>return np.reshape(aryNrlTcConv, tplOutShp).astype(np.float32)<EOL>
Convolve every neural time course with HRF function.

    Parameters
    ----------
    aryNrlTc : 4d numpy array, shape [n_x_pos, n_y_pos, n_sd, n_vol]
        Temporally upsampled neural time course models.
    varNumVol : float, positive
        Number of volumes of the (fMRI) data.
    varTr : float, positive
        Time to repeat (TR) of the (fMRI) experiment.
    varTmpOvsmpl : int, positive
        Factor by which the data hs been temporally upsampled.
    switchHrfSet : int, (1, 2, 3)
        Switch to determine which hrf basis functions are used
    tplPngSize : tuple
        Pixel dimensions of the visual space (width, height).
    varPar : int, positive
        Number of cores for multi-processing.
    dctPrm : dictionary, default None
        Dictionary with customized hrf parameters. If this is None, default
        hrf parameters will be used.
    lgcPrint: boolean, default True
        Should print messages be sent to user?

    Returns
    -------
    aryNrlTcConv : 5d numpy array,
                   shape [n_x_pos, n_y_pos, n_sd, n_hrf_bases, varNumVol]
        Neural time courses convolved with HRF basis functions