ggseg / ggsegExtra

Repository for extra atlases for the ggseg-package
https://ggseg.github.io/ggsegExtra/
Other
52 stars 18 forks source link

Crop out empty areas in custom created aseg atlas #41

Open shinhm91 opened 3 years ago

shinhm91 commented 3 years ago

Hello,

First, thank you for creating this helpful package. I was able to utilize this package to create a nice visual representation of my data.

I was just wondering if ggseg() or ggplot()+geom_brain() functions had an option to set axis limits in the plot area like xlim() or x_scale_continuous() does. For my customized subcortical plot, axial and coronal view plots have a large empty area that I would like to remove but I wasn't able to do so using xlim() or other axis limiting functions.

Below is an example of my subcortical plot with coronal view. I would like to remove empty areas by only showing where coronal map is and not show x coordinates from 400 until 600 where it is empty.

coronal-aseg-crop

drmowinckels commented 2 years ago

Hi!

Thanks for using our pakcage and I'm so pleased to see your atlas creation is working!

This is acutally not empty space, if you notice, there is a little spec around x = 550 y = 0. That is what making the grid around the remaining to large. We will need to remove it. You can do directly into the SF object and try to locate it to remove it, but that cat be tricky.

The volumetric creation pipeline has ar argument called vertex_size_limits which by default is set to c(3*10^6, 3*10^7). By adjusting these values, you should be able to remove vertices that are super small. This would likely need some trial and error to find the correct value, but you will only need to run the pipeline from step 5 and onwards (i.e. setting steps = 5:8 ).

I hope this will help you get the atlas you are looking for.