Error using sub2ind Out of range subscript.

조회 수: 15 (최근 30일)
Basak Su
Basak Su 2025년 2월 6일
편집: Walter Roberson 2025년 2월 7일
I have this eeg data and I want to use fieldtrip to align the data. This is the code that Im using but whenever I try to interact with the graph it gives me it gives me this error; Error using sub2ind (line 71) Out of range subscript.
subjID = 'SubjectUCI29';
mri = ft_read_mri([subjID '_MR_acpc.nii']); % we used the dcm series
mri = ft_determine_coordsys(mri);
cfg = [];
cfg.method = 'interactive';
cfg.coordsys = 'acpc';
mri_acpc = ft_volumerealign(cfg, mri);
Its from the paper;
Analysis of human ECoG and sEEG recordings
Please help me
  댓글 수: 2
Walter Roberson
Walter Roberson 2025년 2월 6일
Which line is generatoring the error? Please show the complete error messages.
Basak Su
Basak Su 2025년 2월 7일
편집: Walter Roberson 2025년 2월 7일
cfg = [];
cfg.method = 'interactive';
cfg.coordsys = 'acpc';
mri_acpc = ft_volumerealign(cfg, mri);
This part of the code generates a a simulation where you can interact with but when I try to interact with it, it gives me this error;
Error using sub2ind (line 71)
Out of range subscript.
Error in ft_volumerealign>cb_redraw_ortho (line 1550)
ind = sub2ind(mri.dim(1:3), round(vox(1)), round(vox(2)), round(vox(3)));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in ft_volumerealign>cb_redraw (line 1396)
cb_redraw_ortho(h, eventdata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in ft_volumerealign>cb_buttonpress (line 1987)
cb_redraw(h);
^^^^^^^^^^^^
Error while evaluating Figure WindowButtonDownFcn.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Biomedical Signal Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by