8000 geom_brain() plots dorsal/ventral sides when present in an atlas by monicathieu · Pull Request #108 · ggseg/ggseg · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

geom_brain() plots dorsal/ventral sides when present in an atlas #108

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

monicathieu
Copy link

This is almost the final PR for dorsal/ventral ggseg atlas support! This, along with using updated atlases generated with the associated update of ggsegExtra, would close #74 . I have tested it locally on a tentative update of the ggsegGlasser atlas (because I needed that atlas specifically for my current study).

Major changes:

  • geom_brain() works as expected (ish, see below) when an atlas including dorsal and ventral sides is used!!!
    • Shows dorsal and ventral views with frontal pole on top, at 12 o'clock (see upstream functionality)
    • position_brain() should behave the same on existing atlases with only lat/med views (and subcort atlases).
    • For atlases with lat/med/dors/vent views, position_brain() handles them in the following ways:
      • when position is a grid formula,stack_grid() now stacks either 2x4 or 4x2
      • when position is horizontal or vertical, default_order() now expects dorsal/ventral views and spaces them properly, putting dorsal and ventral as the 3rd and 4th sides in the order

Minor changes:

  • side argument of geom_brain() can now take a vector of sides by way of calling match.arg(several.ok = TRUE). I imagine this functionality didn't make sense before with only 2 sides in cortical atlases, but with 4 possible sides now it makes sense to pick 2.

Remaining bugs/weirdness:

  • The biggest thing is that plots mixing lat/med and dors/vent views look funky, with the dors/vent hemispheres being weirdly far from one another. The reason is that the internal function get_sep() uses the max bounding box across hemispheres, and since the dors/vent hemispheres are narrow in the x direction, they look very far from one another when placed using the bounding box for the lat/med hemispheres. I didn't want to change the functionality of get_sep(), so I'm leaving this weirdness in to see if you or a 8000 nyone else have a better idea of how to deal with it.
    • The weirdness can be temporarily worked around by calling geom_brain(side = c('dorsal', 'ventral')) (or with either dorsal or ventral alone). When only "narrow" hemispheres are included, they get spaced appropriately closer together.
  • testthat tests for scale-brain are failing because the old plot snapshots don't have any NA scale_fill/colour_brain values, but when I R CMD check on my local machine, the atlases being called do have parcels that aren't being mapped to a scale value. I haven't chased this down that closely (I didn't modify any of the atlases called in the test??) but I can if it's important that that test pass as it was. Local R CMD check throws no other errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Superior and inferior views of the dk brain
1 participant
0