Skip to content

Commit

Permalink
WB: fix recursive resolving dependet stimsets (e.g. formulas)
Browse files Browse the repository at this point in the history
the algorithm in WB_StimsetChildren referenced the wrong column
of the WPT wave.
Fix: use the right stimset epoch type column (EPOCH_TYPE_COMBINE).

since introduction of dependent stimsets (EPOCH_TYPE_COMBINE)
  • Loading branch information
MichaelHuth committed Mar 13, 2024
1 parent 8388477 commit f926fef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Packages/MIES/MIES_WaveBuilder.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -2313,7 +2313,7 @@ static Function/S WB_StimsetChildren([stimset])
// search for stimsets in all formula-epochs by a regex pattern
for(i = 0; i < numEpochs; i += 1)
if(SegWvType[i] == 8)
formula = WPT[6][i][EPOCH_TYPE_CUSTOM]
formula = WPT[6][i][EPOCH_TYPE_COMBINE]
numStimsets = CountSubstrings(formula, "?")
for(j = 0; j < numStimsets; j += 1)
WAVE/T/Z wv = SearchStringBase(formula, "(.*)\\b(\\w+)\\b\\?(.*)")
Expand Down
12 changes: 12 additions & 0 deletions Packages/tests/Basic/UTF_AnalysisBrowserTest.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

static StrConstant PXP_FILENAME = "input:AB_LoadSweepsFromIgorData.pxp"
static StrConstant PXP2_FILENAME = "input:AB_SweepsFromMultipleDevices.pxp"
static StrConstant PXP3_FILENAME = "input:SourceOfDependentStimset.pxp"
static StrConstant NWB1_FILENAME = "input:AB_SweepsFromMultipleDevices-compressed-V1.nwb"
static StrConstant NWB2_FILENAME = "input:AB_SweepsFromMultipleDevices-compressed-V2.nwb"
static StrConstant NWB3_FILENAME = ":_2017_09_01_192934-compressed.nwb"
Expand Down Expand Up @@ -152,3 +153,14 @@ static Function LoadStimsetsFromNWB()

KillWindow $abWin
End

static Function LoadDependentStimsetsFromPXP()

string abWin, sweepBrowsers, formulaSet

[abWin, sweepBrowsers] = OpenAnalysisBrowser({PXP3_FILENAME}, loadStimsets = 1)
formulaSet = MIES_WB#WB_StimsetChildren(stimset="baseset_DA_0")
CHECK_EQUAL_STR(formulaSet, "formula_da_0;")

KillWindow $abWin
End
Binary file not shown.

0 comments on commit f926fef

Please sign in to comment.