GriffithsLab / whobpyt

Whole-Brain Modelling in PyTorch
https://griffithslab.github.io/whobpyt
MIT License
24 stars 22 forks source link

Visualization class: FC/PSD/TS/etc. #76

Open tmorshed opened 1 year ago

tmorshed commented 1 year ago

Figure out the data structure.

Andrew-Clappison commented 1 year ago

101 was done

figure out if we want a plotting object or append as method to other object next step is a proposed API for plotting

P-Oveisi commented 1 year ago

We can approach it in two ways:

  1. The visualization functions would be extra methods that we can add to data objects
  2. We could define a visualization object which would take in the data obj to be plotted + the representation we want (e.g., time series, PSD, FC mat, etc.) and the viz object will do the plotting.

I think the first option would make more sense if the data to be plotted isn't too complex. This would be similar to mne.evoked.plot() method in the MNE library.

In the case of more complex plots (for example 3D source localization) the second way would be more ideal. This is similar to the Brain object in mne (mne.viz.Brain).

What are people's thoughts? How do you think we should proceed?

Andrew-Clappison commented 1 year ago

John Recommendation: For simpler figures taking only a few lines of code then write them explicitly in examples, for more complex plots with many lines then have them encapsulated in methods/functions

Andrew-Clappison commented 12 months ago

Current focus to improve the figures in eg 003r and eg 004r

P-Oveisi commented 12 months ago

To do for Parsa

  1. look at the examples -> decide which ones need improvement
  2. Implement improvements as codes within the notebook itself
  3. Then determine which visualizations merit from being packaged as extra methods for each objects
    • (focus on example 3 and 4 visualizations)
P-Oveisi commented 10 months ago

Will make into MNE object to use MNE visualization funcitons.

Can also add the montage data to use .plot_joint() more comprehensive plots.

P-Oveisi commented 10 months ago

Added some code to generate clean-up visualizations: image image image

However, having issues when trying to build the html files:


Extension error:
Here is a summary of the problems encountered when running the examples

Unexpected failing examples:
/external/rprshnas01/netdata_kcni/jglab/MemberSpaces/po/lab/repos/whobpyt_po_fork/examples/eg004r__fitting_JR_example.py failed leaving traceback:
Traceback (most recent call last):
  File "/external/rprshnas01/netdata_kcni/jglab/MemberSpaces/po/lab/repos/whobpyt_po_fork/examples/eg004r__fitting_JR_example.py", line 58, in <module>
    eeg_data_all = np.load(eeg_file)
  File "/external/rprshnas01/netdata_kcni/jglab/MemberSpaces/po/lab/envs/whobpyt/lib/python3.8/site-packages/numpy/lib/npyio.py", line 405, in load
    fid = stack.enter_context(open(os_fspath(file), "rb"))
FileNotFoundError: [Errno 2] No such file or directory: '../Tepit/eeg_data.npy'

Which seems to happen because the example data is being downloaded from a gdrive which doesn't have public access: image

I think the folder is owned by @JohnWangDataAnalyst . Can you adjust the access please?

Davi1990 commented 9 months ago

@P-Oveisi is going to submit the PR #135 on Wed