Skip to content

Bug: DecodingAlgorithms gamma broadcasting in PPDecodeFilterLinear #20

@iahncajigas

Description

@iahncajigas

Bug Description

In DecodingAlgorithms.m lines 496-501 and 664-665, when there are multiple cells (C > 1) but only a single gamma vector, the code reuses the loop variable c from an already-terminated for c=1:C loop:

gammaNew(:,c) = gamma;

Since c retains its final value C after the loop exits, gammaNew(:,c) only writes to the LAST column, leaving all other columns as zeros. This affects multi-cell decoding with shared gamma parameters.

Expected Fix

gammaNew = repmat(gamma, 1, C);

Found during comprehensive cross-toolbox audit. Python nSTAT-python handles this correctly via np.repeat in _normalize_gamma().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions