ggseg / ggseg3d

ggseg3d R package for cisualising brain atlases through plotly
https://ggseg.github.io/ggseg3d/
Other
30 stars 9 forks source link

Adding points #5

Closed jaromilfrossard closed 4 years ago

jaromilfrossard commented 4 years ago

Hello,

Is there a way to add points in a ggseg3d() plot?

I have intracranial EEG data and I would like to vizualise the electrodes in space with an atlas of the brain region in background.

Thanks!

drmowinckels commented 4 years ago

I really want to say yes, because I am quite wire this should be possible within the plotly framework. I didnt have much time to play about with it today, but if you try googling something like combining plotly mesh3d and scatter3d or the like, that should take you in the right direction.

My gut feeling tells me you should be able to use

ggseg() %>%
  add_trace(electrode_position_data, ~x, ~y, ~z, marker="scatter3d") 

or something like that.

mwvoss commented 3 years ago

@jaromilfrossard I'm looking for the same functionality. Did you get a working version of this?

jaromilfrossard commented 3 years ago

You can add point using:

ggseg3d()%>% add_trace(x = 50, y = 00, z = 80, type = "scatter3d", mode = "markers", inherit = F)

However, I did not investidate further as I had some problems with the scales (relatively to gged3d() ) of the data I wanted to plot.