wm and csf mask

450 views
Skip to first unread message

Yi Zheng

unread,
Aug 9, 2022, 3:35:42 AM8/9/22
to HCP-Users
Hello, 

I have two problems when I work on the HCP task data. I was wondering if you could answer my questions. 

1. The files such as "tfMRI_WM_LR.nii.gz" from the HCP minimally preprocessed task data are the motion corrected 3T volume data, right? 
2.  Are "wm_mask.nii.gz" and "csf_mask.nii.gz" provided in the HCP minimally preprocessed task data? If not, how could I get them?

Thank you very much for your kind consideration and I am looking forward to hearing from you.
Best regards,
Yi 

Harms, Michael

unread,
Aug 9, 2022, 11:47:53 AM8/9/22
to hcp-...@humanconnectome.org

1. Yes.  In the not too distant future (2023) we hope to provide sICA-FIX + temporal-ICA cleaned HCP-YA task-fMRI data through the Amazon S3 bucket as well.

2. No.  You would need to create them yourself.  As recently explained on this list, RestingStateStats needs an overhaul, but you could look at that code for an example of how to get WM and CSF masks from the existing FreeSurfer segmentation (with a proper amount of erosion, to avoid contaminating with GM).

 

Cheers,

-MH

 

-- 

Michael Harms, Ph.D.

-----------------------------------------------------------

Associate Professor of Psychiatry

Washington University School of Medicine

Department of Psychiatry, Box 8134

660 South Euclid Ave.                        Tel: 314-747-6173

St. Louis, MO  63110                          Email: mha...@wustl.edu

 

From: Yi Zheng <yzhen...@gmail.com>
Reply-To: "hcp-...@humanconnectome.org" <hcp-...@humanconnectome.org>
Date: Tuesday, August 9, 2022 at 2:35 AM
To: HCP-Users <hcp-...@humanconnectome.org>
Subject: [hcp-users] wm and csf mask

 

* External Email - Caution *

--
You received this message because you are subscribed to the Google Groups "HCP-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hcp-users+...@humanconnectome.org.
To view this discussion on the web visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/ec41ff52-b45b-4333-9aa6-ff84487da431n%40humanconnectome.org.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Yi Zheng

unread,
Aug 10, 2022, 5:23:20 AM8/10/22
to HCP-Users, mha...@wustl.edu
Hello, 

Thank you very much for your reply. It is really helpful.

I am now trying to create the WM and CSF masks myself and derive the mean WM and CSF signal for task data. However, I have some problems and I was wondering if you could answer my questions.

1. The first one is about data, taking subject 61645 as an example. In the folder /616645/MNIINonLinear, there are many T1 images, T1w.nii.gz,T1w_restore.2.nii.gz,T1w_restore.nii.gz,T1w_restore_brain.nii.gz, which one should I use to create masks? Are these images already align with task data such as tfMRI_WM_LR.nii.gz, so that once I get the eroded masks in the native space, I could directly apply them to the fucntional data by using the wb_command -volume-stats to get the mena signal, right?

2. I trying to get masks by using SPM segment module. Its outputs are probability maps, and I need to turn them into binary maps, right? What are the suggested thresholds for WM and CSF?

3. When running the command  wb_command -volume-erode, what is the suggested parameter for distance? Is 4 ok?

Thank you very much for your kind consideration and I am looking forward to hearing from you.
Best regards,
Yi 

Coalson, Timothy Scott (S&T-Student)

unread,
Aug 10, 2022, 10:35:37 AM8/10/22
to HCP-Users, mha...@wustl.edu
Everything inside the MNINonLinear folder should align with the preprocessed fMRI data.

For HCP data, the freesurfer-derived files already represent a precise segmentation of the WM and pial boundaries using information from both the T1w and T2w scans.  Redoing the segmentation with only the T1w image will almost certainly be worse.  RestingStateStats uses the wmparc file to define the WM and CSF ROIs (though it appears to use the label file resampled to fMRI resolution, when it could be more accurate to binarize at the anatomical resolution before resampling), and instead of eroding the ROI, it subtracts a dilated version of the cortex ROI, with the relevant code starting about here:


After some more thought, eroding the CSF volume isn't going to do what you want, dilating the gray matter ROI and then excluding that is a better strategy (including for some parts of white matter).

I don't remember if we found WM/CSF regression to have no benefit compared to ICA+FIX, or no benefit even without FIX.  Since our recommendations are to use FIX, we generally don't have specific recommendations for methods that don't include FIX.  4mm corresponds to a distance of 2 axis-aligned fMRI voxels in HCP data, which may be reasonable, we don't actually use this type of nuisance regressor in the pipelines so I'm not sure what to recommend, but RestingStateStats effectively uses 2 voxels of exclusion in fMRI space (which due to using FSL dilation actually means a longer distance in diagonal directions, not sure if this is more likely to match the PSF or other effects).  You can always correlate the resulting signal against the gray matter signal to check (though as the gray matter signal is excluded, the remaining signal may have much less fluctuation overall, so the correlation may stay high for a surprising amount of exclusion - correlation accurately reflects what regression is likely to do, as regression will happily amplify a weak "nuisance" timecourse up to the same scale as the signal).

Tim



From: Yi Zheng <yzhen...@gmail.com>
Sent: Wednesday, August 10, 2022 4:23 AM
To: HCP-Users <hcp-...@humanconnectome.org>
Cc: mha...@wustl.edu <mha...@wustl.edu>
Subject: Re: [hcp-users] wm and csf mask
 
WARNING: This message has originated from an External Source. This may be a phishing expedition that can result in unauthorized access to our IT System. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.

Yi Zheng

unread,
Aug 12, 2022, 4:50:23 AM8/12/22
to HCP-Users, tsc...@mst.edu, mha...@wustl.edu

Hello, 

Thank you very much for your kind reply. It is really helpful. However, I have some questions about the code, and I was wondering if you could answer my questions.

1.What are the values for the inputs of the RestingStateStats.sh when analyzing HCP data? For example, what are values for high-pass, low-res-mesh, final-fmri-res, brain-ordinates-res, smoothing-fwhm, output-proc-string? Especially, when I want to extract WM and CSF, what are the inputs for wm and csf? They are supposed to FreeSurfer Label Config File in the code. Are they provided in the HCP data? How could I get them?

2. What are the roles of -metric-to-volume-mapping and -volume-label-import commands? I have found explanations on the workbench website, but I still don't understand them very well, can you explain them more?

3. How could I run this bash for single subject? Should I just run on the terminal with the command like "RestingStateStats.sh --path=* --study-folder=* --wm=* --csf=*" ?  How should I do when I try to do batch processing?

Thank you very much for your kind consideration and I am looking forward to hearing from you.
Best regards,
Yi 

Yi Zheng

unread,
Aug 12, 2022, 8:20:11 AM8/12/22
to HCP-Users, tsc...@mst.edu, mha...@wustl.edu
Hello,

I also have another question. WMReg.2.nii.gz and CSFReg.2.nii.gz in the MNINonLinear\ROIs of the HP data are the masks that have been processed by the command -volume-label-import, -metric-to-volume-mapping and fslmaths (binarized and subtracting a dilated version of the cortex ROI), right? So that I could just use the fslmeants to create white matter and CSF timeseries related stats, right?

Coalson, Timothy Scott (S&T-Student)

unread,
Aug 12, 2022, 9:11:03 PM8/12/22
to Yi Zheng, HCP-Users, mha...@wustl.edu
Most of those parameters are whatever was used while running earlier pipelines, particularly GenericfMRISurface:


Many of them are related to cifti, particularly gray matter, and do not pertain to WM or CSF.  The lookup text files are here:


Reading the text from 'wb_command -gifti-help' and 'wb_command -volume-help' may clear up some of the terminology, also available here:
Metric files contain values that correspond to vertices of a surface mesh made of triangles, and do not have the regular grid characteristics of a volume file.  As for "labels", there are two very different ways to go about displaying values in a file, either by using the value to pick a color from a smooth gradient (good for displaying activation), or by having each integer have an independent meaning, and looking that integer up in a table to find the meaning, and a specific color (which may have no relation to the color/name of the next integer), which is good for displaying parcellations.  We use metadata stored inside the file to tell wb_view how to display each file, and the label-import commands add the label-specific metadata to the file.  In this particular case, we are actually using it to zero out all the structures that aren't part of white matter, or csf, respectively, because the freesurfer segmentation output is a single file with different integers for every single structure it automatically segments.

It looks like we don't currently have an example launcher for restingstatestats.  However, if you only care about the WM and CSF regressor parts, figuring out how to run the whole thing may be overkill.  Also, I recall you are on windows, so you probably can't directly run our pipeline scripts, since windows doesn't include a native bash shell (and fsl doesn't have native windows executables).

I don't know if the files in MNINonLinear/ROIs have the gray matter exclusion that is coded into restingstatestats.  You could load them and the gray matter segmentation in wb_view and see if there is a 2-voxel gap.

Tim


From: Yi Zheng <yzhen...@gmail.com>
Sent: Friday, August 12, 2022 7:20 AM
To: HCP-Users <hcp-...@humanconnectome.org>
Cc: Coalson, Timothy Scott (S&T-Student) <tsc...@mst.edu>; mha...@wustl.edu <mha...@wustl.edu>
Reply all
Reply to author
Forward
0 new messages