{"id":"weighted_ncc_kernel","title":"Weighted lag correlation score","family":"kernel","definition":"reference","intro_en":"This explicitly specified score averages normalized cross-correlations across lags using fixed symmetric weights. Nearby shifts receive more weight than large shifts; no winning lag is selected. The animation separates correlation, lag preference, multiplication and accumulation, making clear how the score differs from maximum NCC.","intro_zh":"该明确指定的分数使用固定对称权重对各滞后的归一化互相关求加权平均。较小位移得到较大权重，不选择获胜滞后。动图分别展示相关、滞后偏好、乘法和累计过程，说明其与最大 NCC 的计算区别。","steps_en":["Z-normalize the input and compute full-energy NCC for all zero-padded shifts.","Assign Gaussian lag weights with sigma=2 and normalize their sum to one.","Multiply every lag correlation by its corresponding weight.","Sum the contributions; this score averages lag evidence rather than selecting one lag."],"steps_zh":["对输入 z 标准化，并计算所有零填充位移的完整能量 NCC。","设置 sigma=2 的高斯滞后权重，并使权重总和为一。","将每个滞后相关乘以对应权重。","累计贡献；该分数平均滞后证据，不选取单个滞后。"],"formula":"K=sum_l w_l*NCC_l(z(x),z(y)); w_l proportional to exp(-l^2/(2*2^2))","caveats_en":["Weighting rules are part of the definition. This generic atlas formula does not supply a positive-semidefinite guarantee for arbitrary lag weights.","Full-series normalization, zero padding and centering differ from overlap-specific correlations. Constant inputs need a separate convention."],"caveats_zh":["权重规则是定义的一部分；通用图谱公式不为任意滞后权重提供半正定保证。","完整序列归一化、零填充和中心化与重叠区域相关不同；常数输入需要另行约定。"],"sources":[{"label":"EchoTime low-level similarity implementations","url":"https://github.com/ZipengWu365/EchoTime/blob/main/src/echotime/similarity_methods.py"},{"label":"EchoTime imported atlas: named formula conventions","url":"https://github.com/ZipengWu365/EchoTime/blob/main/src/echotime/data/ts_similarity_package_v2_registry.csv"}],"x":[0.2,0.4,1.1,2.4,3.2,2.5,1.2,0.3,-0.4,-0.1],"y":[0.1,0.3,0.5,1.2,2.6,3.1,2.3,1.1,0.2,-0.3],"input_label":"Deterministic illustrative arrays; no benchmark data","parameters":{"lag_sigma":2.0,"weights":[7.991883346614543e-06,6.691521999827503e-05,0.00043634204600584767,0.0022159277531582037,0.008764164276189704,0.026995526470205037,0.06475890149700968,0.12098555592953981,0.17603294517029064,0.1994714595085123,0.17603294517029064,0.12098555592953981,0.06475890149700968,0.026995526470205037,0.008764164276189704,0.0022159277531582037,0.00043634204600584767,6.691521999827503e-05,7.991883346614543e-06],"lags":[-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9],"normalization":"full-series energy; weights sum to one","centered":true},"result":{"label":"kernel score","value":0.28020318124495913,"detail":"The explicit definition and parameters shown on this card."},"frames":[{"phase":0,"caption":"Compute full-energy NCC for the indicated global lag","panel":{"kind":"lines","title":"Lag-wise NCC","x":[-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9],"a":[0.09494871655975544,0.13464842171062674,0.045867392574079124,-0.22342945084717433,-0.5166012133260065,-0.5039138364678445,-0.07379798698438757,0.5074491610206013,0.9029769867411556,0.8181751107808714,0.1967538201309181,-0.41150565616678014,-0.7206399446565447,-0.6112744500504822,-0.22551085404706583,0.10002978907713754,0.20709961838920218,0.18752524564904627,0.09119912991289209],"marker":0,"a_label":"NCC"},"value":0.09494871655975544,"value_label":"lag NCC"},{"phase":0,"caption":"Compute full-energy NCC for the indicated global lag","panel":{"kind":"lines","title":"Lag-wise NCC","x":[-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9],"a":[0.09494871655975544,0.13464842171062674,0.045867392574079124,-0.22342945084717433,-0.5166012133260065,-0.5039138364678445,-0.07379798698438757,0.5074491610206013,0.9029769867411556,0.8181751107808714,0.1967538201309181,-0.41150565616678014,-0.7206399446565447,-0.6112744500504822,-0.22551085404706583,0.10002978907713754,0.20709961838920218,0.18752524564904627,0.09119912991289209],"marker":4,"a_label":"NCC"},"value":-0.5166012133260065,"value_label":"lag NCC"},{"phase":0,"caption":"Compute full-energy NCC for the indicated global lag","panel":{"kind":"lines","title":"Lag-wise NCC","x":[-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9],"a":[0.09494871655975544,0.13464842171062674,0.045867392574079124,-0.22342945084717433,-0.5166012133260065,-0.5039138364678445,-0.07379798698438757,0.5074491610206013,0.9029769867411556,0.8181751107808714,0.1967538201309181,-0.41150565616678014,-0.7206399446565447,-0.6112744500504822,-0.22551085404706583,0.10002978907713754,0.20709961838920218,0.18752524564904627,0.09119912991289209],"marker":9,"a_label":"NCC"},"value":0.8181751107808714,"value_label":"lag NCC"},{"phase":0,"caption":"Compute full-energy NCC for the indicated global lag","panel":{"kind":"lines","title":"Lag-wise NCC","x":[-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9],"a":[0.09494871655975544,0.13464842171062674,0.045867392574079124,-0.22342945084717433,-0.5166012133260065,-0.5039138364678445,-0.07379798698438757,0.5074491610206013,0.9029769867411556,0.8181751107808714,0.1967538201309181,-0.41150565616678014,-0.7206399446565447,-0.6112744500504822,-0.22551085404706583,0.10002978907713754,0.20709961838920218,0.18752524564904627,0.09119912991289209],"marker":14,"a_label":"NCC"},"value":-0.22551085404706583,"value_label":"lag NCC"},{"phase":0,"caption":"Compute full-energy NCC for the indicated global lag","panel":{"kind":"lines","title":"Lag-wise NCC","x":[-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9],"a":[0.09494871655975544,0.13464842171062674,0.045867392574079124,-0.22342945084717433,-0.5166012133260065,-0.5039138364678445,-0.07379798698438757,0.5074491610206013,0.9029769867411556,0.8181751107808714,0.1967538201309181,-0.41150565616678014,-0.7206399446565447,-0.6112744500504822,-0.22551085404706583,0.10002978907713754,0.20709961838920218,0.18752524564904627,0.09119912991289209],"marker":18,"a_label":"NCC"},"value":0.09119912991289209,"value_label":"lag NCC"},{"phase":1,"caption":"Apply fixed symmetric lag weights, normalized to sum to one","panel":{"kind":"bars","title":"Gaussian lag weights (sigma=2)","a":[7.991883346614543e-06,6.691521999827503e-05,0.00043634204600584767,0.0022159277531582037,0.008764164276189704,0.026995526470205037,0.06475890149700968,0.12098555592953981,0.17603294517029064,0.1994714595085123,0.17603294517029064,0.12098555592953981,0.06475890149700968,0.026995526470205037,0.008764164276189704,0.0022159277531582037,0.00043634204600584767,6.691521999827503e-05,7.991883346614543e-06],"labels":["-9","-8","-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7","8","9"],"marker":0},"value":7.991883346614543e-06,"value_label":"lag weight"},{"phase":1,"caption":"Apply fixed symmetric lag weights, normalized to sum to one","panel":{"kind":"bars","title":"Gaussian lag weights (sigma=2)","a":[7.991883346614543e-06,6.691521999827503e-05,0.00043634204600584767,0.0022159277531582037,0.008764164276189704,0.026995526470205037,0.06475890149700968,0.12098555592953981,0.17603294517029064,0.1994714595085123,0.17603294517029064,0.12098555592953981,0.06475890149700968,0.026995526470205037,0.008764164276189704,0.0022159277531582037,0.00043634204600584767,6.691521999827503e-05,7.991883346614543e-06],"labels":["-9","-8","-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7","8","9"],"marker":4},"value":0.008764164276189704,"value_label":"lag weight"},{"phase":1,"caption":"Apply fixed symmetric lag weights, normalized to sum to one","panel":{"kind":"bars","title":"Gaussian lag weights (sigma=2)","a":[7.991883346614543e-06,6.691521999827503e-05,0.00043634204600584767,0.0022159277531582037,0.008764164276189704,0.026995526470205037,0.06475890149700968,0.12098555592953981,0.17603294517029064,0.1994714595085123,0.17603294517029064,0.12098555592953981,0.06475890149700968,0.026995526470205037,0.008764164276189704,0.0022159277531582037,0.00043634204600584767,6.691521999827503e-05,7.991883346614543e-06],"labels":["-9","-8","-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7","8","9"],"marker":9},"value":0.1994714595085123,"value_label":"lag weight"},{"phase":1,"caption":"Apply fixed symmetric lag weights, normalized to sum to one","panel":{"kind":"bars","title":"Gaussian lag weights (sigma=2)","a":[7.991883346614543e-06,6.691521999827503e-05,0.00043634204600584767,0.0022159277531582037,0.008764164276189704,0.026995526470205037,0.06475890149700968,0.12098555592953981,0.17603294517029064,0.1994714595085123,0.17603294517029064,0.12098555592953981,0.06475890149700968,0.026995526470205037,0.008764164276189704,0.0022159277531582037,0.00043634204600584767,6.691521999827503e-05,7.991883346614543e-06],"labels":["-9","-8","-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7","8","9"],"marker":14},"value":0.008764164276189704,"value_label":"lag weight"},{"phase":1,"caption":"Apply fixed symmetric lag weights, normalized to sum to one","panel":{"kind":"bars","title":"Gaussian lag weights (sigma=2)","a":[7.991883346614543e-06,6.691521999827503e-05,0.00043634204600584767,0.0022159277531582037,0.008764164276189704,0.026995526470205037,0.06475890149700968,0.12098555592953981,0.17603294517029064,0.1994714595085123,0.17603294517029064,0.12098555592953981,0.06475890149700968,0.026995526470205037,0.008764164276189704,0.0022159277531582037,0.00043634204600584767,6.691521999827503e-05,7.991883346614543e-06],"labels":["-9","-8","-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7","8","9"],"marker":18},"value":7.991883346614543e-06,"value_label":"lag weight"},{"phase":2,"caption":"Multiply each lag correlation by its weight","panel":{"kind":"bars","title":"Weighted lag contributions","a":[7.588190666563339e-07,9.0100287611871e-06,2.001387192072711e-05,-0.0004951035210051504,-0.004527577898868043,-0.013603419311070269,-0.004779076569799557,0.06139401885205602,0.1589536983970401,0.16320258348099914,0.03463515443115113,-0.04978624057948796,-0.04666785119082368,-0.01650167559689782,-0.001976414170932325,0.00022165878575859042,9.036627121497475e-05,1.2548293067836498e-05,7.288528075765784e-07],"labels":["-9","-8","-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7","8","9"],"marker":0},"value":7.588190666563339e-07,"value_label":"weighted contribution"},{"phase":2,"caption":"Multiply each lag correlation by its weight","panel":{"kind":"bars","title":"Weighted lag contributions","a":[7.588190666563339e-07,9.0100287611871e-06,2.001387192072711e-05,-0.0004951035210051504,-0.004527577898868043,-0.013603419311070269,-0.004779076569799557,0.06139401885205602,0.1589536983970401,0.16320258348099914,0.03463515443115113,-0.04978624057948796,-0.04666785119082368,-0.01650167559689782,-0.001976414170932325,0.00022165878575859042,9.036627121497475e-05,1.2548293067836498e-05,7.288528075765784e-07],"labels":["-9","-8","-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7","8","9"],"marker":4},"value":-0.004527577898868043,"value_label":"weighted contribution"},{"phase":2,"caption":"Multiply each lag correlation by its weight","panel":{"kind":"bars","title":"Weighted lag contributions","a":[7.588190666563339e-07,9.0100287611871e-06,2.001387192072711e-05,-0.0004951035210051504,-0.004527577898868043,-0.013603419311070269,-0.004779076569799557,0.06139401885205602,0.1589536983970401,0.16320258348099914,0.03463515443115113,-0.04978624057948796,-0.04666785119082368,-0.01650167559689782,-0.001976414170932325,0.00022165878575859042,9.036627121497475e-05,1.2548293067836498e-05,7.288528075765784e-07],"labels":["-9","-8","-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7","8","9"],"marker":9},"value":0.16320258348099914,"value_label":"weighted contribution"},{"phase":2,"caption":"Multiply each lag correlation by its weight","panel":{"kind":"bars","title":"Weighted lag contributions","a":[7.588190666563339e-07,9.0100287611871e-06,2.001387192072711e-05,-0.0004951035210051504,-0.004527577898868043,-0.013603419311070269,-0.004779076569799557,0.06139401885205602,0.1589536983970401,0.16320258348099914,0.03463515443115113,-0.04978624057948796,-0.04666785119082368,-0.01650167559689782,-0.001976414170932325,0.00022165878575859042,9.036627121497475e-05,1.2548293067836498e-05,7.288528075765784e-07],"labels":["-9","-8","-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7","8","9"],"marker":14},"value":-0.001976414170932325,"value_label":"weighted contribution"},{"phase":2,"caption":"Multiply each lag correlation by its weight","panel":{"kind":"bars","title":"Weighted lag contributions","a":[7.588190666563339e-07,9.0100287611871e-06,2.001387192072711e-05,-0.0004951035210051504,-0.004527577898868043,-0.013603419311070269,-0.004779076569799557,0.06139401885205602,0.1589536983970401,0.16320258348099914,0.03463515443115113,-0.04978624057948796,-0.04666785119082368,-0.01650167559689782,-0.001976414170932325,0.00022165878575859042,9.036627121497475e-05,1.2548293067836498e-05,7.288528075765784e-07],"labels":["-9","-8","-7","-6","-5","-4","-3","-2","-1","0","1","2","3","4","5","6","7","8","9"],"marker":18},"value":7.288528075765784e-07,"value_label":"weighted contribution"},{"phase":3,"caption":"Sum weighted correlations across lags instead of taking their maximum","panel":{"kind":"lines","title":"Cumulative weighted NCC","x":[-9,-8,-7,-6],"a":[7.588190666563339e-07,9.768847827843433e-06,2.9782719748570545e-05,-0.0004653208012565798],"marker":3,"a_label":"weighted total"},"value":-0.0004653208012565798,"value_label":"weighted score"},{"phase":3,"caption":"Sum weighted correlations across lags instead of taking their maximum","panel":{"kind":"lines","title":"Cumulative weighted NCC","x":[-9,-8,-7,-6,-5,-4,-3,-2],"a":[7.588190666563339e-07,9.768847827843433e-06,2.9782719748570545e-05,-0.0004653208012565798,-0.004992898700124623,-0.018596318011194893,-0.023375394580994448,0.03801862427106157],"marker":7,"a_label":"weighted total"},"value":0.03801862427106157,"value_label":"weighted score"},{"phase":3,"caption":"Sum weighted correlations across lags instead of taking their maximum","panel":{"kind":"lines","title":"Cumulative weighted NCC","x":[-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2],"a":[7.588190666563339e-07,9.768847827843433e-06,2.9782719748570545e-05,-0.0004653208012565798,-0.004992898700124623,-0.018596318011194893,-0.023375394580994448,0.03801862427106157,0.19697232266810166,0.3601749061491008,0.3948100605802519,0.345023820000764],"marker":11,"a_label":"weighted total"},"value":0.345023820000764,"value_label":"weighted score"},{"phase":3,"caption":"Sum weighted correlations across lags instead of taking their maximum","panel":{"kind":"lines","title":"Cumulative weighted NCC","x":[-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6],"a":[7.588190666563339e-07,9.768847827843433e-06,2.9782719748570545e-05,-0.0004653208012565798,-0.004992898700124623,-0.018596318011194893,-0.023375394580994448,0.03801862427106157,0.19697232266810166,0.3601749061491008,0.3948100605802519,0.345023820000764,0.2983559688099403,0.2818542932130425,0.2798778790421102,0.2800995378278688],"marker":15,"a_label":"weighted total"},"value":0.2800995378278688,"value_label":"weighted score"},{"phase":3,"caption":"Sum weighted correlations across lags instead of taking their maximum","panel":{"kind":"lines","title":"Cumulative weighted NCC","x":[-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9],"a":[7.588190666563339e-07,9.768847827843433e-06,2.9782719748570545e-05,-0.0004653208012565798,-0.004992898700124623,-0.018596318011194893,-0.023375394580994448,0.03801862427106157,0.19697232266810166,0.3601749061491008,0.3948100605802519,0.345023820000764,0.2983559688099403,0.2818542932130425,0.2798778790421102,0.2800995378278688,0.28018990409908373,0.2802024523921516,0.28020318124495913],"marker":18,"a_label":"weighted total"},"value":0.28020318124495913,"value_label":"weighted score"}],"animation_steps_en":["Compute full-energy NCC over zero-padded global shifts.","Assign symmetric Gaussian lag weights that sum to one.","Multiply each lag correlation by its corresponding weight.","Sum across lags instead of selecting a winning shift."],"echotime_status":"Low-priority addition","echotime_api":""}
