BytesAvailable_Callback error in digitizer

Can you try to reload the protocol? => right click on the protocol and then > Reload

Just to confirm, have you are looking at the Brainstorm GUI in the Functional data (iconStudyDBSubj) view rather than the Anatomy view (iconSubjectDB), right? Sometimes it can be easy to overlook.

1 Like

Hi,

I think that may have been the issue indeed. My apologies for forgetting about this thread and not responding sooner. The original issue with digitization was fixed at this point. However, a new error just popped a few days ago:

Warning: Error executing listener callback for PostSet event on TotalBytesWritten dynamic property in object of matlabshared.asyncio.internal.Channel class:
Intermediate dot '.' indexing produced a comma-separated list with 0 values, but it must produce a single value when followed by subsequent indexing operations.

Error in panel_digitize_2024>Save_Callback (line 1151)
    ChannelFile = file_fullpath(sStudy.Channel.FileName);
                                ^^^^^^^^^^^^^^^^^^^^^^^
Error in panel_digitize_2024>BytesAvailable_Callback (line 1642)
        Save_Callback(TmpPosFile);
        ^^^^^^^^^^^^^^^^^^^^^^^^^
Error in matlabshared.transportlib.internal.client.GenericClient/callbackFunction (line 946)
            obj.BytesAvailableFcn(obj.CallbackSource, dataAvailableInfo);
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in matlabshared.transportlib.internal.client.GenericClient>@(varargin)obj.callbackFunction(varargin{:}) (line 663)
                        obj.Transport.BytesAvailableFcn = @obj.callbackFunction;
                                                           ^^^^^^^^^^^^^^^^^^^^
Error in matlabshared.transportlib.internal.DataReceivedHandlerMixin/valuesWrittenUpdated

Error in matlabshared.transportlib.internal.DataReceivedHandlerMixin>@(src,evt)obj.valuesWrittenUpdated(src,evt)

Error in matlabshared.asyncio.internal.Channel/onPropertyChanged (line 573)
            obj.(name) = value;
            ^^^^^^^^^^
Error in matlabshared.asyncio.internal.Channel>@(source,data)obj.onPropertyChanged(data.Name,data.Value) (line 469)
                                                         @(source, data) obj.onPropertyChanged(data.Name, data.Value));
                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Related documentation 
> In matlabshared.asyncio.internal/Channel/onPropertyChanged (line 573)
In matlabshared.asyncio.internal.Channel>@(source,data)obj.onPropertyChanged(data.Name,data.Value) (line 469) 

These errors show up after I finish collecting the fiducials and start collecting the first EEG electrode location. I can make a separate post about this error if that's better, but since it is related, I thought I'll share it here first.

Thanks,
Parth

Hi Parth,

What is the version of Brainstorm that you are using?

Also, once the error is showed, can you run these lines and share with us the result:

global Digitize

Digitize.SubjectName

Digitize.ConditionName

Digitize.Points

sSubject = bst_get('Subject', Digitize.SubjectName)

sStudy = bst_get('StudyWithCondition', [Digitize.SubjectName '/' Digitize.ConditionName])

sStudy.Channel.FileName

ChannelFile = file_fullpath(sStudy.Channel.FileName)

Hi Raymundo,

We are using MATLAB R2024b; BST Version: 06-May-2025.

Here are the results from running your suggested lines of code:

global Digitize

Digitize.SubjectName

Digitize.ConditionName

Digitize.Points

sSubject = bst_get('Subject', Digitize.SubjectName)

sStudy = bst_get('StudyWithCondition', [Digitize.SubjectName '/' Digitize.ConditionName])

sStudy.Channel.FileName

ChannelFile = file_fullpath(sStudy.Channel.FileName)

ans =

    'Digitize'


ans =

    'Practice with mannequin-Seti_20250528_01'


ans = 

  1×39 struct array with fields:

    Label
    Type
    Loc


sSubject = 

  struct with fields:

                 Name: 'Digitize'
             Comments: ''
             FileName: 'Digitize/brainstormsubject.mat'
    DateOfAcquisition: ''
              Anatomy: [1×14 struct]
              Surface: [1×7 struct]
             iAnatomy: 1
               iScalp: 5
              iCortex: 3
          iInnerSkull: 6
          iOuterSkull: 7
              iFibers: []
                 iFEM: []
               iOther: []
       UseDefaultAnat: 0
    UseDefaultChannel: 0


sStudy = 

  0×0 empty struct array with fields:

    Name
    FileName
    DateOfStudy
    BrainStormSubject
    Condition
    Channel
    iChannel
    Data
    HeadModel
    iHeadModel
    Result
    Stat
    Image
    NoiseCov
    Dipoles
    Timefreq
    Matrix

Intermediate dot '.' indexing produced a comma-separated list with 0 values, but it
must produce a single value when followed by subsequent indexing operations.

Related documentation

Thanks,
Parth

Hello @parthchholak,

The issue was caused by spaces in the provided subject ID:
Practice with mannequin-Seti

The case for non-valid characters in subject ID is now automatically handled, commit: f9b5ef3

Thank you. I can confirm that it is now working at our end as well.