ggseg / ggsegExtra

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

ggsegExtra costum atlases (annot2dpv) #39

Closed AnnaFurtjes closed 3 years ago

AnnaFurtjes commented 3 years ago

Dear Dr. Mowinkel,

Thank you so much for making your ggseg packages available in R! I found them so useful for brain visualisations!

I have been trying to create custom 3D atlases using this description for ggsegExtra, but I cannot find the annot2dpv function (used in the aparc_2_mesh step). For some reason, R doesn't recognise it, and it doesn't seem to have been installed with the package. Also, I can't seem to find the function on the ggsegExtra GitHub.

I wondered if it might be possible for you to share this function with me? Or alternatively, is there another way to create custom atlases without this function?

Thank you so much for taking the time to read this! Best, Anna

drmowinckels commented 3 years ago

Hi Anna!

Can you show me the error message you are getting? The function is in the package, but is not an exported function as its only used internally.

https://github.com/ggseg/ggsegExtra/blob/master/R/fs-utils.R#L583

--Mo

AnnaFurtjes commented 3 years ago

Thanks for getting back to me! I am running: mri_surf2surf_rereg(subject = "bert", annot = "mpm.vpnl", hemi = "lh", target_subject = "fsaverage5", output_dir = wd)

dt <- make_aparc_2_3datlas(annot = "mpm.vpnl", hemisphere = "lh", surface = "inflated", annot_dir = wd, output_dir = wd, subject = "bert")

And I get this error message:

Error in $<-.data.frame(*tmp*, "label", value = c(NA, "FG1", "FG2", : replacement has 9 rows, data has 8

I have tried running this with a couple of different .annot files, and always get the same error message.

Can you tell from this what might be going wrong? Thank you so much. Best, Anna

drmowinckels commented 3 years ago

could you send me the "mpm.vpnl" file you are using, so I could test with that. That would speed things up I think, its a file type I am unfamiliar with.

AnnaFurtjes commented 3 years ago

Thank you so much for your help!

"mpm.vpnl" refers to a .annot file. I only used the lh.mpm.vpnl.annot file to play with the software. When you are testing it, could you please use lh.shen268cort.annot or lh.gordon333dil.annot (annot_files.zip)? I downloaded these .annot files from https://github.com/faskowit/multiAtlasTT and they are the actual atlases I am interested in.

Looking forward to hearing from you!

drmowinckels commented 3 years ago

H again!

I have been testing a bit, and from what I can tell, these atlases you pointed me to are registered to "fsaverage" not "bert", so when you re-register with mri_surf2surf you need to alter the subject to "fsaverage" rather than bert. And it should work.

Thanks to the pointer to this repo with atlases. This is a reat convenience for us in making atlases when people have already created the annot files.

drmowinckels commented 3 years ago

Hi again!

I have been making lots of the atlases from this repo. You can find the Gordon atlas here:

https://github.com/ggseg/ggsegGordon

There was something wrong with the shen atlas, unfortunately, so I could not create that.

Hope this helps!

--Mo

AnnaFurtjes commented 3 years ago

Thank you so much for looking into this!

Can you tell what was wrong about the Shen atlas? I'm planning to use the Shen atlas .annot files in my analysis, and it would be helpful to know what you've discovered. Thanks!

Best, Anna

drmowinckels commented 3 years ago

There is something wrong with the projection. I talked to the repo maintainer about it, so he's not going to support it anymore.

https://github.com/faskowit/multiAtlasTT/issues/10