Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMM analysis with preprocessed eeglab .set data #68

Open
pauldhami opened this issue Feb 18, 2021 · 3 comments
Open

HMM analysis with preprocessed eeglab .set data #68

pauldhami opened this issue Feb 18, 2021 · 3 comments

Comments

@pauldhami
Copy link

pauldhami commented Feb 18, 2021

Dear OHBA Group,

Thank you very much for all the wonderful tools. I have gone over the documentation, but being new to OSL, I still had some outstanding questions.

I have some task data that has been preprocessed with EEGLAB (and is in .set files accordingly).

My goal is to perform a TDE-HMM analysis on this data (in source space).

  1. Because I have already preprocessed my data with EEGLAB, can I use the OSL tools to perform only registration and source localization for EEG? Or must I do all my preprocessing with OSL tools?

  2. For the EEG dataset I am working with, we do have the individual MRIs, but there were no Polhemus data collected. Can co-registration (and ultimately source localization) be conducted with OSL? How can I manually add the nasion, left, and right fiducials?

Sorry for what may be naive questions, but any insight would be greatly appreciated.

Thank you,
Paul

@woolrich
Copy link
Collaborator

woolrich commented Feb 22, 2021 via email

@pauldhami
Copy link
Author

pauldhami commented Feb 23, 2021

Dear Dr. Woolrich,

thank you very much for your help, it has got me up and running.

I am following the this tutorial to see if I can at least first do a simple sensor contrast with one condition (my epoched EEG data has just one condition).

https://ohba-analysis.github.io/osl-docs/matlab/osl_example_oat_1_sensorspace.html

Before following the example, I converted my eeglab .set file to the appropriate SPM M/EEG epoched format.

I then followed each step, but am running into the following error, which even after going through the code, I am unsure as to why it is occurring.

>> oat = osl_run_oat(oat);
Detected EEG data. Using default EEG settings
Warning: oat.source_recon.modalities not set, or not set properly. Will set to default:EEG 
> In osl_check_oat (line 107)
  In osl_run_oat (line 13) 
oat.source_recon.D_epoched set. OAT will do an epoched data trial-wise GLM
*************************************************************
Running source_recon
*************************************************************
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%  RUNNING OAT SOURCE RECON (SENSOR SPACE SETUP) ON SESS = 1  %%%%%%%%%%%%%%%%%%%%%%%
Using epoched data as input
Preparing source recon stage for /Users/prabhjotdhami/Desktop/HMM/OSL_Source_Preprocessing/yd-c001/spm_files/spmeeg_yd-c001_v3_lmc_cleaned_interp.mat
Will be designated session1

SPM12: spm_eeg_copy (v5079)                        20:27:00 - 22/02/2021
========================================================================

SPM12: spm_eeg_copy (v5079)                        20:27:01 - 22/02/2021
========================================================================
No temporal filtering applied \n\n
Source recon OAT stage has failed

ans =

    'Unrecognized function or variable 'D_epoched'.
     
     Error in oat_prepare_source_recon (line 244)
         S.D=D_epoched;
     
     Error in oat_run_source_recon_sensorspace (line 63)
         [source_recon_sess source_recon_sess_results source_recon_sess_results.report] = oat_prepare_source_recon(source_recon_sess, report_sess);
     
     Error in osl_run_oat (line 51)
                 [results_fnames results]=oat_run_source_recon_sensorspace(oat);'

By not specifying oat.source_recon.normalise_method = 'none', it seems to run okay, but I am not sure what I had to comment this line out for it to run when in the tutorial, it runs fine.

Also, if I may also ask, I am following the OAT 3 source analysis tutorial (https://ohba-analysis.github.io/osl-docs/matlab/osl_example_oat_3_sourcespace.html)

Although I am using mainly default input parameters for EEG, I run into this error when running osl_run_oat(oat):

    'Error using osl_inverse_model (line 63)
     The value of 'pca_order' is invalid. It must satisfy the function: @(x)isnumeric(x)&&isscalar(x)&&x>0&&~mod(x,1).
     
     Error in oat_run_source_recon (line 165)
         D = osl_inverse_model(D,mni_coords,S2);
     
     Error in osl_run_oat (line 53)
                 [results_fnames results]=oat_run_source_recon(oat);
     
     Error in LiveEditorEvaluationHelperESectionEval1c5e202b (line 157)
     oat = osl_run_oat(oat);
     
     Error in matlab.internal.editor.evaluateCode'

Any suggestions as to what I may be doing wrong would be great.

Also, apologizes if I should not be posting such questions here. Would the SPM mailing list be better?

Thank you in advance,
Paul

@pauldhami
Copy link
Author

Apologizes to add to this thread, but I think I figured out my past issue in regards by specifying oat.source_recon.pca_dim before calling osl_run_oat(oat).

However, I am now running into the following error, which I am not having much luck troubleshooting.

Item 'Jacobian modulation?', field 'val': No matching defaults value found.
Item 'Unwrapping method', field 'val': No matching defaults value found.
Item 'FWHM', field 'val': No matching defaults value found.
Item 'pad', field 'val': No matching defaults value found.
Item 'Weighted smoothing', field 'val': No matching defaults value found.
Item 'Template image for brain masking', field 'val': No matching defaults value found.
Item 'FWHM', field 'val': No matching defaults value found.
Item 'Number of erosions', field 'val': No matching defaults value found.
Item 'Number of dilations', field 'val': No matching defaults value found.
Item 'Threshold', field 'val': No matching defaults value found.
Item 'Regularization', field 'val': No matching defaults value found.
Item 'Defaults File', field 'val': No matching defaults value found.
Item 'VDM filename extension', field 'val': No matching defaults value found.
Item 'Jacobian modulation?', field 'val': No matching defaults value found.
Item 'Unwrapping method', field 'val': No matching defaults value found.
Item 'FWHM', field 'val': No matching defaults value found.
Item 'pad', field 'val': No matching defaults value found.
Item 'Weighted smoothing', field 'val': No matching defaults value found.
Item 'Template image for brain masking', field 'val': No matching defaults value found.
Item 'FWHM', field 'val': No matching defaults value found.
Item 'Number of erosions', field 'val': No matching defaults value found.
Item 'Number of dilations', field 'val': No matching defaults value found.
Item 'Threshold', field 'val': No matching defaults value found.
Item 'Regularization', field 'val': No matching defaults value found.
Item 'Defaults File', field 'val': No matching defaults value found.
Item 'VDM filename extension', field 'val': No matching defaults value found.
Item 'Distortion direction', field 'val': No matching defaults value found.
Item tools: No field(s) named
beamforming
Item tools: No field(s) named
beamforming
Item tools: No field(s) named
beamforming
Item tools: No field(s) named
beamforming
Item tools: No field(s) named
beamforming
Item tools: No field(s) named
beamforming
Source recon OAT stage has failed

ans =

    'Error using spm_jobman>fill_run_job (line 461)
     No executable modules, but still unresolved dependencies or incomplete module inputs.
     
     Error in spm_jobman (line 247)
             sts = fill_run_job('run', cjob, varargin{3:end});
     
     Error in osl_inverse_model (line 244)
     spm_jobman('run',matlabbatch)
     
     Error in oat_run_source_recon (line 165)
         D = osl_inverse_model(D,mni_coords,S2);
     
     Error in osl_run_oat (line 53)
                 [results_fnames results]=oat_run_source_recon(oat);'

Any help with regards to figuring this out would be greatly appreciated.

Thank you in advance,
Paul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants