VH-Lab / NDI-matlab

NDI (Neuroscience Data Interface) is a cross-platform interface standard for reading neuroscience data and storing the results of analyses
Other
12 stars 9 forks source link

Discussion of Tutorial 2.3 #178

Open stevevanhooser opened 3 years ago

stevevanhooser commented 3 years ago

Enter your comments, questions, bugs, or discussion items for Tutorial 2.3 here.

KellyZhangL commented 3 years ago

Codeblock 2.3.2.1 p = S.getprobes('type','n-trode'); returns a 0x0 cell This later prompts the below error when I run se.extract(p{1},[],my_extraction_name{1},redo);

Index exceeds the number of array elements (0).

KellyZhangL commented 3 years ago

I believe the above error was caused by running S.database_clear('yes'); to see if I could resolve a "File not found or you do not have permission to access this" error when running se.extract(p{1},[],my_extraction_name{1},redo);

I retyped code from Tutorials 2.1 and 2.2 to see if I could add something that would help with p = 0 probes (p resulted in 2 probes this time, both I believe are from the 2.1 Tutorial). I am getting the below error again when I run se.extract(p{1},[],my_extraction_name{1},redo);

Warning: File not found or permission denied

stevevanhooser commented 3 years ago

Hi Kelly -

If you run S.database_clear('yes'); then you'll need to start back at Code block 2.3.2.1

Also, instead of opening the session with ndi.session.dir, you'd need to re-add the daq systems. I changed the tutorial so that code block 2.3.2.1 now uses ndi.setup.vhlab instead of ndi.session.dir, which should re-build the basic daq systems.

So, please try from Code block 2.3.2.1 and if you're still getting errors we will get to the bottom of them!

Thanks Steve

KellyZhangL commented 3 years ago

I tried what you suggested but I'm still getting the same "Warning: File not found or permission denied" error after se.extract(p{1},[],my_extraction_name{1},redo);.

stevevanhooser commented 3 years ago

Hmm. OK, seems like this is what we should troubleshoot. Does it give you an error or just this warning? Can you paste in the complete warning/error stack? (usually it will tell you which function produced the warning).

Tomorrow we can zoom about it if we can't solve it here...

KellyZhangL commented 3 years ago

Warning: File not found or permission denied

In release_lock_file (line 48) In vlt.file/dumbjsondb/closebinaryfile (line 346) In ndi.database.implementations.database/matlabdumbjsondb/do_closebinarydoc (line 109) In ndi/database/closebinarydoc (line 124) In ndi/session/database_closebinarydoc (line 361) In ndi.app/spikeextractor/extract (line 276) Warning: File not found or permission denied In release_lock_file (line 48) In vlt.file/dumbjsondb/closebinaryfile (line 346) In ndi.database.implementations.database/matlabdumbjsondb/do_closebinarydoc (line 109) In ndi/database/closebinarydoc (line 124) In ndi/session/database_closebinarydoc (line 361) In ndi.app/spikeextractor/extract (line 277) Warning: File not found or permission denied In release_lock_file (line 48) In vlt.file/dumbjsondb/closebinaryfile (line 346) In ndi.database.implementations.database/matlabdumbjsondb/do_closebinarydoc (line 109) In ndi/database/closebinarydoc (line 124) In ndi/session/database_closebinarydoc (line 361) In ndi.app/spikeextractor/extract (line 276) Warning: File not found or permission denied In release_lock_file (line 48) In vlt.file/dumbjsondb/closebinaryfile (line 346) In ndi.database.implementations.database/matlabdumbjsondb/do_closebinarydoc (line 109) In ndi/database/closebinarydoc (line 124) In ndi/session/database_closebinarydoc (line 361) In ndi.app/spikeextractor/extract (line 277)

stevevanhooser commented 3 years ago

OK, I think we should zoom about this one. Can you also put in the output of ver from Matlab? Thanks

KellyZhangL commented 3 years ago

MATLAB Version: 9.10.0.1649659 (R2021a) Update 1 MATLAB License Number: 711743 Operating System: Microsoft Windows 10 Home Version 10.0 (Build 19042) Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

MATLAB Version 9.10 (R2021a) Simulink Version 10.3 (R2021a) Bioinformatics Toolbox Version 4.15.1 (R2021a) Control System Toolbox Version 10.10 (R2021a) Curve Fitting Toolbox Version 3.5.13 (R2021a) Image Processing Toolbox Version 11.3 (R2021a) Matlab Toolbox for Dimensionality Reduction Version 0.8
Optimization Toolbox Version 9.1 (R2021a) Parallel Computing Toolbox Version 7.4 (R2021a) Signal Processing Toolbox Version 8.6 (R2021a) Simscape Version 5.1 (R2021a) Simscape Multibody Version 7.3 (R2021a) Simulink Control Design Version 5.7 (R2021a) Stateflow Version 10.4 (R2021a) Statistics and Machine Learning Toolbox Version 12.1 (R2021a) Symbolic Math Toolbox

KellyZhangL commented 3 years ago

Codeblock 2.3.3.1 after running sorting_param_doc = ssa.add_appdoc('sorting_parameters',sorting_params_struct,'Replace',my_sorting_name);, I get:

Dot indexing is not supported for variables of this type.

Error in ndi.app/spikesorter/find_appdoc (line 402) doc = ndi_app_spikesorter_obj.session.database_search(sorting_search);

Error in ndi.app/appdoc/add_appdoc (line 85) doc = ndi_app_appdoc_obj.find_appdoc(appdoc_type, varargin{:});

stevevanhooser commented 3 years ago

There's a typo on the line above that is now fixed. It should read:

ssa = ndi.app.spikesorter(S);

KellyZhangL commented 3 years ago

After running Codeblock 2.3.3.1 sorting_param_doc = ssa.add_appdoc('sorting_parameters',sorting_params_struct,'Replace',my_sorting_name);

Error using matlab.ui.Figure/get Invalid or deleted object.

Error in vlt.neuro.spikesorting.cluster_spikewaves_gui (line 230) ud = get(fig,'userdata');

Error in ndi.app/spikesorter/spike_sort (line 200) [clusterids, clusterinfo] = vlt.neuro.spikesorting.cluster_spikewaves_gui('waves', waveforms, ...

stevevanhooser commented 3 years ago

OK, the spike cluster window is now resizeable. Need to update vhlab-toolbox-matlab. Updater should work!

andrewhu02 commented 3 years ago

I'm getting the same error that Kelly was getting in 2.3.2.1. The command window reads Warning: File not found or permission denied

In release_lock_file (line 48) In vlt.file/dumbjsondb/closebinaryfile (line 346) In ndi.database.implementations.database/matlabdumbjsondb/do_closebinarydoc (line 109) In ndi/database/closebinarydoc (line 124) In ndi/session/database_closebinarydoc (line 361) In ndi.app/spikeextractor/extract (line 276) In Tutorial2_3 (line 21) Warning: File not found or permission denied In release_lock_file (line 48) In vlt.file/dumbjsondb/closebinaryfile (line 346) In ndi.database.implementations.database/matlabdumbjsondb/do_closebinarydoc (line 109) In ndi/database/closebinarydoc (line 124) In ndi/session/database_closebinarydoc (line 361) In ndi.app/spikeextractor/extract (line 277) In Tutorial2_3 (line 21) Warning: File not found or permission denied In release_lock_file (line 48) In vlt.file/dumbjsondb/closebinaryfile (line 346) In ndi.database.implementations.database/matlabdumbjsondb/do_closebinarydoc (line 109) In ndi/database/closebinarydoc (line 124) In ndi/session/database_closebinarydoc (line 361) In ndi.app/spikeextractor/extract (line 276) In Tutorial2_3 (line 21) Warning: File not found or permission denied In release_lock_file (line 48) In vlt.file/dumbjsondb/closebinaryfile (line 346) In ndi.database.implementations.database/matlabdumbjsondb/do_closebinarydoc (line 109) In ndi/database/closebinarydoc (line 124) In ndi/session/database_closebinarydoc (line 361) In ndi.app/spikeextractor/extract (line 277) In Tutorial2_3 (line 21)

I also got the version information if that's necessary.

MATLAB Version: 9.10.0.1669831 (R2021a) Update 2 MATLAB License Number: 711743 Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19041) Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

MATLAB Version 9.10 (R2021a) Simulink Version 10.3 (R2021a) Control System Toolbox Version 10.10 (R2021a) Curve Fitting Toolbox Version 3.5.13 (R2021a) Image Processing Toolbox Version 11.3 (R2021a) Matlab Toolbox for Dimensionality Reduction Version 0.8
Optimization Toolbox Version 9.1 (R2021a) Signal Processing Toolbox Version 8.6 (R2021a) Simscape Version 5.1 (R2021a) Statistics and Machine Learning Toolbox Version 12.1 (R2021a)

I'm not really sure how ndi.add_appdoc works- the parameters are (NDI_APPDOC_OBJ, APPDOC_TYPE, APPDOC_STRUCT, DOCEXISTSACTION, [additional arguments]), but we input ('extraction_parameters', extraction_param_struct, 'Replace', my_extraction_name{1}). 'extraction_parameters' is a possible APPDOC_TYPE, and extraction_param_struct is an object of class ndi.app.appdoc. I expected that reversing these two would resolve the problems, but I got this error after doing that: Error using ndi.app/appdoc/add_appdoc (line 74) APPDOC_STRUCT was a character array, so it was assumed to be a file. But file reading failed with error Unrecognized function or variable 'appdoc_strut'..

Error in Tutorial2_3 (line 13) extraction_param_doc = se.add_appdoc(extraction_param_struct,'extraction_parameters','Replace',my_extraction_name{1}); I think the problem may be that APPDOC_STRUCT is not there- the arguments go right from APPDOC_TYPE to DOCEXISTSACTION. The documentation does that that APPDOC_STRUCT can be left empty, but I would think you would need to input a null value instead of skipping the parameter entirely.

stevevanhooser commented 3 years ago

Thanks! Did you re-run ndi_install this week? I fixed this bug when Kelly encountered it. It was a bug. Thanks! If you've fixed the bug and you're still seeing this, then there might be another one. It affected Windows machines only.

Thanks Steve

connorjohnson1 commented 1 year ago

e = S.getelements('element.type','spikes','element.name','ctx_1')

returns a 0x0 cell, causing me to be unable to move forward with the tutorial.