Hi Dr. Tim,
I have a brief question about resampling dscalar.nii files from 32k fs_LR to 59k fs_LR surface. Because I can compare the cerebral cortex parcellation results of my 7T
rs-fMRI data which were processed on the 59k mesh with the results of HCP's retinotopy analysis (Benson et al.2018) on the same 59k fs_LR surface after
resampling. I also have tried to downsample the parcellation results of mine(func.gii) to 32k mesh, but this will result in lower accuracy and adjacent parcels will become closer and more crowded.
I used two methods to perform resampling. One is wb_command -cifti-resample, and the other one is wb_command -cifti-separate and -metric-resample. As the following figures show, the polar angle maps obtained by these two methods are almost the same(Fig. 2&Fig. 3), but they are quite different from the original 32k polar angle maps(Fig. 1). Many gray areas in the original result are colored in the resampled result.
wb_command orders:
1.
wb_command -cifti-resample S1200_7T_Retinotopy181.Fit1_PolarangleMirror_MSMAll.32k_fs_LR.dscalar.nii COLUMN 170494_Greyordinates.dscalar.nii COLUMN ADAP_BARY_AREA CUBIC <cifti-out > -surface-largest -left-spheres L.sphere.32k_fs_LR.surf.gii L.sphere.59k_fs_LR.surf.gii -left-area-surfs Conte69.L.midthickness.32k_fs_LR.surf.gii Conte69.L.midthickness.59k_fs_LR.surf.gii -right-spheres R.sphere.32k_fs_LR.surf.gii R.sphere.59k_fs_LR.surf.gii -right-area-surfs Conte69.R.midthickness.32k_fs_LR.surf.gii Conte69.R.midthickness.59k_fs_LR.surf.gii
2.
wb_command -cifti-separate S1200_7T_Retinotopy181.Fit1_PolarangleMirror_MSMAll.32k_fs_LR.dscalar.nii COLUMN -metric CORTEX_LEFT <metric-out>
wb_command -metric-resample
(I'm sure the usage of -cifti-separate and -metric-resample is correct)
Question
1. What's wrong with my wb_command orders? How could I resample the dscalar.nii files from 32k to 59k correctly? Actually, I only wanna resample the surface data of the CIFTI files.
Any help would be appreciated:)
Thank you for your time and best wishes!
Han






1) exact zeros in the original map next to nonzero values will not remain 0 in the resampled version - however, due to the extent of colors in the resampled versions, I think the first image was masked by something to remove regions that aren't clearly responding to visual input.
2) -surface-largest is not intended for continuous data, and can result in a more "speckled" look, though polar angle maps can have an extreme jump which other methods would "smooth"
3) is the third image the original 32k version? I'm guessing it has "display zeros" turned off, resulting in those scattered gray spots, but since you say you used -surface-largest, that should have carried over to the resampled version, which doesn't have these spots, suggesting you had display zeros on for that one?
When we resampled retinotopy maps, one method we used was to convert the polar angle and eccentricity into an x-y coordinate system, to get rid of the discontinuity at 360 degrees (and because simple interpolation in polar coordinates gives wrong answers because of eccentricity, consider the average of 5 degrees left and 5 degrees right - the correct answer is 0 degrees center, but averaging the polar coordinates will say something else, such as 5 degrees down). Once that is done, you can resample the x and y maps with interpolation, and then convert back to polar representation. I don't remember if there are real hard edged changes in the biology, but if there are, those will get a small interpolation fringe, but it should still make more sense this way than the same fringe from interpolating polar coordinates.
Tim
________________________________
From: hanhan <31201...@bit.edu.cn>
Sent: Wednesday, May 12, 2021 11:44 AM
To: Coalson, Timothy Scott (S&T-Student) <tsc...@mst.edu>; coal...@wustl.edu <coal...@wustl.edu>; hcp-...@humanconnectome.org <hcp-...@humanconnectome.org>
Subject: A question about resampling dscalar files
[cid:8d430ba91ad7d7eaaede98e87da129d8][cid:445d1fb73055c227aac09d21c65c5e56][cid:4523ddac6a55e28830acca79d859999a]
https://en.wikipedia.org/wiki/Polar_coordinate_system#Converting_between_polar_and_Cartesian_coordinates
You will need both the angle and eccentricity maps to do the x-y resampling trick. Most software uses radians for trig functions (including wb_command -cifti-math or -metric-math, which can do the needed conversion), so assuming the angle map is in degrees:
for x, "eccentricity * cos(angle * PI / 180)"
for y, "eccentricity * sin(angle * PI / 180)"
resample x and y maps
then back to polar:
for angle, "atan2(y, x) * 180 / PI"
for eccentricity, "sqrt(x^2 + y^2)"
Tim
________________________________
From: hanhan <31201...@bit.edu.cn>
Sent: Thursday, May 13, 2021 10:06 PM
To: Coalson, Timothy Scott (S&T-Student) <tsc...@mst.edu>; hcp-...@humanconnectome.org <hcp-...@humanconnectome.org>
Subject: Re:Re: A question about resampling dscalar files
Hi, Dr. Tim,
Thanks for your professional solutions.
1) What I was confused about before was many of the gray areas in the original 32k polar angle map (Fig. 1, the first image) are colored in the resampled version( Fig. 2&Fig. 3). I double-checked it after receiving your email and found that the original one does have a mask. The original version is thresholded at 9.8% variance explained.
2) The second image(Fig. 2) is the "-cifti-resample" version (from 32k to 59k). If I don't use -surface-largest, the result will have distinct boundaries(Fig. 4).
3)The third image is the "-cifti-separate" one(Fig. 3) and I did turn "display zeros" off. Because if I turn it on, the medial wall areas will be colored even though the scattered gray spots will disappear.
I'm excited to learn that you have a better method to resample retinotopy maps. But I'm sorry that I'm not following. I have no idea about converting polar angle files which are in CIFTI(dscalar.nii) format into an X-Y coordinate system CIFTI files. Should I use Connectome Workbench or MATLAB? Do you mind providing more details?
Thanks for your time and best wishes.
Han
[cid:9613827c8c845d58e085c526f02117d1][cid:6cb5dce6161f09d9d5c8331437580225][cid:694134ff56eca346356d9cff5df75424] [cid:8afca29708a9cd3f7302d317ba5724c4]



Hi EY,
You need to use a CIFTI template with subcortical data (the myelin maps don’t have it). Any of the fMRI .dscalar.nii files in the 91282 grayordinates space will do (and there are some templates in the global folder of the pipelines as well).
Matt.
--
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/74d9f2f4-bb3e-422f-a9f5-8314cbc9b1ben%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.
To view this discussion on the web visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/C206B6A1-FF52-4F5F-B3CE-831EC8266D02%40wustl.edu.