But I noticed that some files (func_brainmask,struct_subcortical_mask) do not exist in the rel3_dhcp_fmri_pipeline and rel3_dhcp_anat_pipeline data. (I can use fsl to get inverse affine matrix)
I can find func_brainmask in release2, but there is a little different in transformation matrix between func_brainmask in release2 and func image in release3.
These files are created by running earlier stages of the dHCP fMRI pipeline.
The func_brainmask should be in the release torrent, but it seems several files are missing in the torrent. I will get someone to look into the missing files. In the interim you can recreate func_brainmask with:
from tempfile import TemporaryDirectory
from dhcp.util import fslpy as fsl
from dhcp.util.io import Path
mcdc = f'derivatives/dhcp_fmri_pipeline/sub-{subid}/ses-{sesid}/func/sub-{subid}_ses-{sesid}_task-rest_desc-mcdc_bold.nii.gz'
mcdc_brainmask = 'func_brainmask.nii.gz'
with TemporaryDirectory() as tmp:
brain = f'{tmp}/brain.nii.gz')
mean = f'{tmp}/mean.nii.gz')
fsl.fslmaths(mcdc).Tmean().run(mean)
fsl.bet(
input=mean,
output=brain,
mask=False,
fracintensity=0.4,
robust=True
)
fsl.fslmaths(input=brain).bin().run(output=mcdc_brainmask)
The struct_subcortical_mask is not in the torrent because we have not released surface fMRI yet. It can be created with:
from dhcp.util import mask
from dhcp.util import enums
dseg = f'derivatives/dhcp_anat_pipeline/sub-{subid}/ses-{sesid}/anat/sub-{subid}_ses-{sesid}_desc-drawem9_dseg.nii.gz'
mask.create_mask(
dseg=dseg,
dseg_type=enums.SegType.drawem,
labels=['sc', 'bs', 'cb'],
outname='T2w_scmask.nii.gz'
)
However, keep in mind that the surface mapping code you are using is still under evaluation. I think we are unlikely to use partial volume correction in the final version. I hope to have finalised our surface mapping protocol in the next week or so.
ERROR: all surfaces must have vertex correspondence
Some subjects can run surface.sample_to_native successfully(e.g sub-CC00056XX07_ses-10700), but this error will occure in some subjects(e.g sub-CC00057XX08_ses-11002)
Is this an image quality issue? or something wrong with my operation? or something wrong in partial volume correction as you mentioned?
It sounds like white, pial, and midthickness native surfaces do not have the same number of vertices… These native surfaces are created by the structural pipeline and should have vertex correspondence.
Can you check this by running wb_command -surface-information on each of the surfaces and reporting the results? Can you also advise if this is release 02 or 03 data?
Here are surface information for sub-CC00056XX07_ses-10700 ( run sample_to_native successfully)
Name: sub-CC00056XX07_ses-10700_hemi-left_midthickness.surf.gii
Type: Anatomical
Number of Vertices: 93910
Number of Triangles: 187816
Bounds: (-43.2767, 0.555677, -35.7739, 77.2255, -18.4223, 60.1389)
Spacing:
Mean: 0.761947
Std Dev: 0.164449
Minimum: 0.079924
Maximum: 1.629265
Name: sub-CC00056XX07_ses-10700_hemi-left_pial.surf.gii
Type: Anatomical
Number of Vertices: 93910
Number of Triangles: 187816
Bounds: (-44.0236, 1.42818, -36.3437, 77.6846, -18.818, 60.8258)
Spacing:
Mean: 0.796758
Std Dev: 0.273937
Minimum: 0.006241
Maximum: 2.075600
Name: sub-CC00056XX07_ses-10700_hemi-left_wm.surf.gii
Type: Anatomical
Number of Vertices: 93910
Number of Triangles: 187816
Bounds: (-42.7848, 0.431395, -35.2475, 76.7664, -18.0326, 59.675)
Spacing:
Mean: 0.748349
Std Dev: 0.115062
Minimum: 0.079939
Maximum: 1.629279
Number of Vertices and Number of Triangles are consistent among the midthickness, pial and wm。
Here are surface information for CC00057XX08_ses-11002 ( run sample_to_native unsuccessfully)
Name: sub-CC00057XX08_ses-11002_hemi-left_midthickness.surf.gii
Type: Anatomical
Number of Vertices: 93804
Number of Triangles: 187604
Bounds: (-49.2301, 4.28502, -40.9534, 67.6848, -18.0238, 52.6374)
Spacing:
Mean: 0.760819
Std Dev: 0.170681
Minimum: 0.000000
Maximum: 2.113620
Name: sub-CC00057XX08_ses-11002_hemi-left_pial.surf.gii
Type: Anatomical
Number of Vertices: 93804
Number of Triangles: 187604
Bounds: (-49.7727, 5.11741, -41.3548, 68.1142, -18.7199, 52.8151)
Spacing:
Mean: 0.793485
Std Dev: 0.273903
Minimum: 0.005009
Maximum: 2.125155
Name: sub-CC00057XX08_ses-11002_hemi-left_wm.surf.gii
Type: Anatomical
Number of Vertices: 93804
Number of Triangles: 187604
Bounds: (-48.7643, 3.53322, -40.552, 67.2555, -17.3276, 52.4597)
Spacing:
Mean: 0.747467
Std Dev: 0.115179
Minimum: 0.077172
Maximum: 1.493315
Number of Vertices and Number of Triangles are also consistent among the midthickness, pial and wm。
Then I check the function sample_to_native again, I found the pial, midthickness, and wm surface used in “wb_sample” step also have same vertex number:
CC00057XX08_ses-11002 ( run sample_to_native unsuccessfully):
Name: midthickness_hemi-left_mesh-native_space-func.surf.gii
Type: Anatomical
Number of Vertices: 93804
Number of Triangles: 187604
Bounds: (-49.1241, 3.80451, -40.3902, 69.6718, -17.9736, 50.463)
Spacing:
Mean: 0.760819
Std Dev: 0.170681
Minimum: 0.000000
Maximum: 2.113619
Name: pial_hemi-left_mesh-native_space-func.surf.gii
Type: Anatomical
Number of Vertices: 93804
Number of Triangles: 187604
Bounds: (-49.6853, 4.64433, -40.7854, 70.1031, -18.5606, 50.9066)
Spacing:
Mean: 0.793485
Std Dev: 0.273903
Minimum: 0.005008
Maximum: 2.125154
Name: white_hemi-left_mesh-native_space-func.surf.gii
Type: Anatomical
Number of Vertices: 93804
Number of Triangles: 187604
Bounds: (-48.5682, 3.05919, -39.995, 69.2404, -17.4403, 50.1174)
Spacing:
Mean: 0.747467
Std Dev: 0.115179
Minimum: 0.077172
Maximum: 1.493315
I hope this information will be helpful in solving this problem,Thank you again for your help!
I am experiencing the same error while trying to map to a ribbon constrained surface. I hope to help pinpoint the problem by saying I am using the exact same script that works fine for the second release, so it would seem to be related to the 3rd release surface giftis.
I also checked that the number of vertices is the same for all surfaces, maybe @lzjwilliams will know if there is any other possible difference between the pial, midthickness, and white matter surfaces that could be causing this problem? Thank you very much in advance!
Just a quick update. I have replicated the problem and I believe that it stems from the released native surfaces. I have slightly older (pre-release) versions of the same surfaces that run without problem. I have raised this internally with the dHCP team and I’ll let you know when we have a better understanding of the cause.
The cause of the problem with the native surfaces has been identified and a fix is being tested. We will update you when new surfaces are available for download.
Thank you very much for dealing with this issue. Do you know by any chnace if it affects every single session (in the 3rd rel)? I have not had opportunity to check that.
Unfortunately I don’t have a further update at this. AFAIK the fix was successful and we are still waiting for the data to be reprocessed. I will raise this with the project PIs to see if I can get an ETA on completion and release.
I’m wondering, for the subjects in the 2nd release, whether their surfaces in folder ‘rel3_dhcp_anat_pipeline’ in the 3rd release are consistent with those in the 2nd release. If not, what’s the difference between them.
Many thanks!
I am not sure exactly what you mean by “consistent”. However, release three introduced a wide range of pipeline improvements, as well as new versions of the initial reconstruction. We do not consider release 2 and release 3 to be compatible.
Thanks for reaching out. I am not able to check since my dhcp account has been disabled. I will try to e-mail the administrators and will get back to you.
Hi @lzjwilliams and @seanfitz! I seem to be encountering the same issue as xiangyu_kong described above. Has a solution be found for the vertex correspondence problem?
Thanks!
Lena
I have a question about the compatibility between Release 2 and Release 3. As you mentioned, there is a wide range of pipeline improvements, and these differences can be observed in fMRI signals for the same subjects in Release 2 and Release 3. However, I expected the age dependency of metrics like FALFF to be somewhat similar between the two releases, but the results surprised me.
I expected the time series of the same ROIs for the same subjects in the two releases to be correlated (I used fMRI data in native space and the parcels are registered to the native space). While in some ROIs, the correlation between time series was more than 0.8, in others, it was less than 0.5. Are such differences (age dependency and correlation between time series) common because of the improvements in the preprocessing pipeline?