JuliaHealth / NeuroAnalyzer.jl

Julia toolbox for analyzing neurophysiological data
https://neuroanalyzer.org
BSD 2-Clause "Simplified" License
6 stars 1 forks source link

[BUG] Error with Reading Set Files #2

Closed TheCedarPrince closed 1 month ago

TheCedarPrince commented 1 month ago

In the example you gave me a while ago @AdamWysokinski for decomposing an EEGLAB set file from scratch, I am now running into a bug where the set file is not properly read on the latest NeuroAnalyzer release (24.9). I made a small PR to fix this as when the set file is read on my end, it gets interpreted as a Dict type from the matread function. Not sure how you want to proceed -- here was the error I was seeing without the fix:

julia> eeg = import_set("sub-01_ses-1_task-eyesopen_eeg.set"; detect_type=true)
ERROR: MethodError: no method matching ndims(::String)

Closest candidates are:
  ndims(::Type{Union{}}, Any...)
   @ Base abstractarray.jl:276
  ndims(::NLopt.Opt)
   @ NLopt ~/.julia/packages/NLopt/XaDCU/src/NLopt.jl:145
  ndims(::HDF5.Dataspace)
   @ HDF5 ~/.julia/packages/HDF5/Z859u/src/dataspaces.jl:95
  ...

Stacktrace:
 [1] import_set(file_name::String; detect_type::Bool)
   @ NeuroAnalyzer ~/FOSS/NeuroAnalyzer.jl/src/io/import_set.jl:63
 [2] top-level scope
   @ REPL[50]:1