def cnvlTc(idxPrc,<EOL>aryPrfTcChunk,<EOL>lstHrf,<EOL>varTr,<EOL>varNumVol,<EOL>queOut,<EOL>varOvsmpl=<NUM_LIT:10>,<EOL>varHrfLen=<NUM_LIT:32>,<EOL>):
<EOL>print("<STR_LIT>" + str(idxPrc) +<EOL>"<STR_LIT>")<EOL>vecFrms = np.arange(<NUM_LIT:0>, varTr * varNumVol, varTr)<EOL>vecFrmTms = np.arange(<NUM_LIT:0>, varTr * varNumVol, varTr / varOvsmpl)<EOL>varRes = varTr / float(varOvsmpl)<EOL>lstBse = []<EOL>for hrfFn in lstHrf:<EOL><INDENT>vecTmpBse = hrfFn(np.linspace(<NUM_LIT:0>, varHrfLen,<EOL>(varHrfLen // varTr) * varOvsmpl))<EOL>lstBse.append(vecTmpBse)<EOL><DEDENT>print("<STR_LIT>" + str(idxPrc) +<EOL>"<STR_LIT>")<EOL>tplInpShp = aryPrfTcChunk.shape<EOL>aryPrfTcChunk = aryPrfTcChunk.reshape((-<NUM_LIT:1>, aryPrfTcChunk.shape[-<NUM_LIT:1>]))<EOL>aryConv = np.zeros((aryPrfTcChunk.shape[<NUM_LIT:0>], len(lstHrf),<EOL>aryPrfTcChunk.shape[<NUM_LIT:1>]))<EOL>print("<STR_LIT>" + str(idxPrc) +<EOL>"<STR_LIT>")<EOL>for idxTc in range(<NUM_LIT:0>, aryConv.shape[<NUM_LIT:0>]):<EOL><INDENT>vecTc = aryPrfTcChunk[idxTc, :]<EOL>vecTcUps = np.zeros(int(varNumVol * varTr/varRes))<EOL>vecOns = vecFrms[vecTc.astype(bool)]<EOL>vecInd = np.round(vecOns / varRes).astype(np.int)<EOL>vecTcUps[vecInd] = <NUM_LIT:1.><EOL>for indBase, base in enumerate(lstBse):<EOL><INDENT>col = np.convolve(base, vecTcUps, mode='<STR_LIT>')[:vecTcUps.size]<EOL>f = interp1d(vecFrmTms, col)<EOL>aryConv[idxTc, indBase, :] = f(vecFrms)<EOL><DEDENT><DEDENT>tplOutShp = tplInpShp[:-<NUM_LIT:1>] + (len(lstHrf), ) + (tplInpShp[-<NUM_LIT:1>], )<EOL>lstOut = [idxPrc,<EOL>aryConv.reshape(tplOutShp)]<EOL>queOut.put(lstOut)<EOL>
Convolution of time courses with HRF model.