-
Notifications
You must be signed in to change notification settings - Fork 0
plot topography #2
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
Conversation
|
Looks like a good place to start. We should update the project.toml file if we add dependencies |
palday
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I've got some comments to help transition it from "user code" to "package code"
Project.toml
Outdated
| version = "0.1.0" | ||
|
|
||
| [deps] | ||
| GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only depend on Makie for top-level package stuff and let the user load their preferred backend
src/NeuroPlots.jl
Outdated
| plot_topography(PlotTopography.my_channel, rand(59)) | ||
| ``` | ||
| """ | ||
| function plot_topography(channelList::Vector{String}, channelValues::Vector{Number}; gridSize = 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should probably be made internal (_plot_topography) and instead plot_topography should take a Tables.jl table.
(I'll help do this when I get a few minutes)
|
|
||
| # Extend data beyond the boundary, see: | ||
| # https://www.mathworks.com/matlabcentral/fileexchange/72729-topographic-eeg-meg-plot | ||
| extendData = append_nearest_values(channelXs, channelYs, channelValues) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
original license here appears to be BSD-3, may need to add more license-related documentation at the method definition
| end | ||
|
|
||
|
|
||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably convert these constants to Tables.jl table, where each row is channel name + coordinates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even just a NamedTuple. It might make sense to have a formal ElectrodeTemplate type at some point that is a table.
EDIT:
Actually, it would probably be good to have something like ROITable with optionally 2d or 3d coordinates. We can then add networks on top of that in the future, treating it like plotted graph. But that level of detail may be outside the scope of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, I stored it as a named tuple.
modified: Project.toml modified: src/NeuroPlots.jl
|
Thanks for this, @likanzhan. You're awesome! @palday, since you have experience with plotting packages, what's your advice on testing here? |
|
@likanzhan and @Tokazama The "best" way is to use something like Percy that does visual testing, so that you know if your plots change. But that takes a bit of effort and potentially a paid account, and I haven't done for my plotting packages yet, so I can't help do it quickly. The next best way is a combination of two things:
The combination of these two things are generally enough to get an impression about the state of the package and detect e.g. if a Makie version bump breaks anything. |
|
That's super helpful. Thank you. I'm going to go ahead and merge this so we can incrementally build on this. |
(cc @SimonDanisch who has been interested in developing an OSS/Julia-developer-friendly alternative to Percy for Makie + Julia ecosystem :) good to know there are use cases here) |
No description provided.