dfsp-spirit / fsbrain

R library for structural neuroimaging. Provides high-level functions to access (read and write) and visualize surface-based brain morphometry data for individuals and groups.
Other
64 stars 13 forks source link

Inflated views intertwined #35

Closed signebray closed 2 years ago

signebray commented 2 years ago

When I display inflated views the left and right hemispheres intertwine for the anterior/posterior and superior/inferior views.

I can't figure out how to display them on their own or get an angled view as in Figure 5B here https://cran.r-project.org/web/packages/fsbrain/vignettes/fsbrain.html

I am using vis.region.values.on.subject and export functions -- the 'si' view also intertwines the two hemispheres. and those functions don't have a hemi option.

dfsp-spirit commented 2 years ago

The coordinates for the inflated hemispheres do indeed overlap (due to the inflation). This has been discussed and a solution provided in #7: You can use the rglactions parameter to shift the hemis apart like this: rglactions = list('shift_hemis_apart'=TRUE).

A full example follows:

So if you copy & paste the example provided in the documentation of the vis.region.values.on.subject() function, you can adapt the last command like this to display on the inflated surface instead:

cm = vis.region.values.on.subject(subjects_dir, 'subject1', atlas, lh_region_value_list, rh_region_value_list, surface="inflated", rglactions = list('shift_hemis_apart'=TRUE));

vis_region_inflated

You can also export it, of course: export(cm, output_img = "~/export.jpg")

export

Does this help?

signebray commented 2 years ago

Yes, thank you! Apologies for not looking more closely at the closed issues!

dfsp-spirit commented 2 years ago

No worries, it's hard to find. Glad it works now!