Skip to content

Solved problem with tag set by HumSilencer #11

@Mijar007

Description

@Mijar007

abfload runs into an error in line 860 if the HumSilencer of the Axon Digidata 1550B digitalizer was enabled during the recording using Clampex 11.2 (At least for episodic recordings).
The reason is that at the end of Part 3, the tags are assigned to the corresponding episodes based on their start time. However, while the HumSilencer tag was created at time 0, the first episode starts a bit later (~0.02 during a 10 kHz recording).
Therefore, the code runs into the condition, but the variable tmp remains empty, which is why it cannot be used for indexing in the next line, leading to an error.
So I added another condition which checks if the tag was created at time 0. If yes, it will be assigned to episode 0.
Here is my code snippet which replaces lines 857-862:

if ~isempty(h.tags) && isfield(h,'sweepStartInPts')
    for i=1:numel(h.tags)
        if h.tags(i).timeSinceRecStart > 0 %Comments added during recording
            tmp=find(h.tags(i).timeSinceRecStart>=h.sweepStartInPts/1e6*h.si);
            h.tags(i).episodeIndex=tmp(end);
        elseif h.tags(i).timeSinceRecStart == 0 %HumSilencer comment at timeSinceRecStart = 0
            h.tags(i).episodeIndex = 0; %Will be added to episode 0
        end
    end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions