Data import through import_scn for structural covariance network

64 views
Skip to first unread message

Lei Guo

unread,
Sep 14, 2020, 10:49:07 AM9/14/20
to brainGraph-help
Dear Chris,

Thank you very much for developing this great package! I'm starting to use this package to analyze my structural imaging results from Freesurfer. However, I was confused while I using function import_scn. The manual says that subcortical gray matter would also be imported if applicable. But even if I extracted subcortical gray matter volumes from Freesurfer and renamed it to asegstats.csv, the aseg value in imported data was still NULL.  I wonder if I did it wrong. I don't know if I should not import thickness data and subcortical volume simultaneously. 

Here below is my code and data:

raw_data <- import_scn(datadir = '../data/brainGraphData/',
                       atlas = 'dk',modality = 'thickness')

微信截图_20200914223340.png

And this is the files in my data directory:
微信截图_20200914223512.png

I have checked the data are in the required form because the thickness data were imported successfully. 
 I'm new in this area, and really thanks a lot for your time.

best wishes 

Lei Guo

Chris Watson

unread,
Sep 14, 2020, 10:52:50 AM9/14/20
to brainGr...@googlegroups.com
If you would like to include subcortical volumes, you must select an atlas that includes subcortical regions. In your case, it should probably be 'dk.scgm'.

Chris

--
You received this message because you are subscribed to the Google Groups "brainGraph-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brainGraph-he...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/0174e947-faf0-4660-914e-ea9679a1554cn%40googlegroups.com.

Lei Guo

unread,
Sep 14, 2020, 11:06:40 AM9/14/20
to brainGraph-help
Dear Chris,

Sorry for ignoring this detail. Many thanks for your quick reply. It worked   : ) 

Lei Guo

Alice Ballerini

unread,
Oct 6, 2021, 4:24:52 AM10/6/21
to brainGraph-help
Dear Chris,

I'm using this space because I have the same problem of Lei Guo.

I'm using brainGraph 3.0.2 and R version 4.1.1.
This is my directory:
- aparc_lh_thickness.csv
- aparc_rh_thickness.csv
- asegstats.csv
- covars.csv

When I run 
> raw_data <- import_scn(datadir, atlas='dk', modality='thickness', exclude.subs=exclude.subs)
aseg is NULL

If I replace 'dk' with 'dk.scgm', as you recommended, the output is the following error:
> raw_data <- import_scn(datadir, atlas='dk.scgm', modality='thickness', exclude.subs=exclude.subs)
Error in update_fs_names(asegfile, "aseg", exclude.subs) :
argument "exclude.subs" absent, no default value

What is your advice to fix this error?

Thank you in advance,
Alice

Chris Watson

unread,
Oct 6, 2021, 7:06:14 AM10/6/21
to brainGr...@googlegroups.com
This is actually a bug. You would have to edit the relevant line either in "import.R" or in the function "import_scn". It should be:

scgm <- update_fs_names(asegfile, 'aseg', parc=NULL, hemi=NULL, exclude.subs=exclude.subs)

If you update the R file, you will have to run

source('import.R')

Sorry about this simple bug. I am not sure when I will have time to push an update to GitHub.
Chris

Alice Ballerini

unread,
Oct 7, 2021, 4:48:29 AM10/7/21
to brainGraph-help
Hi Chris,
I solved the error by modifying the code string in "import.R" file, now it works.

Thank you so much,
have a nice day.

Alice
Reply all
Reply to author
Forward
0 new messages