you need to run msm registration between the dHCP template and the HCP template using folding as the feature
You can then resample the HCP template onto the dHCP template; from there you can also sample onto each individual surface individual surface. Boht using wb_command -label-resample commands
If this is too complicated then we will release the template aligned surfaces in the next dHCP data release and can do the dHCP-HCP template alignment also if it would help?
Now it is more clear but I have new doubts:
The structural pipeline did not aligned the surfaces to the dHCP templates, so where can I find the dHCP templates? I had a look in the structural-pipeline github with no success.
Files like:
sub-CC00073XX08_ses-27800_hemi-L_space-T2w_sphere.surf.gii
are the projection of the preprocessed T2w without allignment to the sphere. Are those the files you identify as native in your script?
And, I don’t think it is too complicated, but the amount of different files and being not familiar with the procedure can make you feel overwhelmed.
However, I think I understand most of the procedure.
I started working on it and I’ve faced the first question:
Should I estimate the prerotation for every subject given the respective week template? if so, while running the script for a test subject I faced 2 errors regarding MSM inputs written in the config file:
–regoption=3
–dopt=HOCR
they were reported as not being an option in msm. After removing them the script worked. Will this affect the result?
Hi,
yes I’ve inspected the result and they are imprecise I would say. I will try both the new config file and with MSM HOCR.
When doing the resample between subject aligned to dHCP and the subject’s native space, should I use the dHCP template sphere or the subject’s dhcp registered sphere as label-in for -label-resample?
I’m asking this since the result for the former is better.
You need to run registration of ALL subjects to dHCP template AND register the dHCP template to the HCP template. You then need to combine those transformations, or run them in reverse to get your labels back to subject native space.
I don’t really understand how your resampling will work with either the template or the registered as they should have different numbers of vertices. Nor are you making it clear what direction you are resampling in.
Sorry I made a mistake in the question, I will explain better.
The last question was about the last label-resample step. (So after registering the subject to the to the dhcp template, after registering dHCP and HCP templates and after passing the dHCP-HCP registration sphere to the first label-resample)
At this point, I will have to use the “current-sphere” input for labes-resample from the dHCP template space, but I’m confuse about which one I have to use:
the dHCP template sphere, or, the subject’s sphere that is output of the registration subject-dhcp template?
wb_command -label-resample
- the label file to resample
- a sphere surface with the mesh that the label file is
currently on
- a sphere surface that is in register with
and has the desired output mesh
- the method name
- output - the output label file
So current sphere is the sphere with the same number of vertices for which the label file has data points, and the new sphere is another sphere, in alignment with the current sphere but with different numbers of vertices.
Both the spheres I wrote have the same number of vertices.
At this point I assume my question doesn’t make sense, so I assume it is correct to use the dHCP template sphere as current sphere. That’s because after the first resampling the rois are aligned with the dHCP template.
I think it’s not a good idea to use it just because it looks right - this could lead to problems further on. Copy and paste the commands into a reply - with comments so I know where all of the files have come from and I will check.
indeed, that is why I was suspecting that my question was a nonsense
Ok, so that is the last resampling procedure I’ve runned:
First HCP -> dHCP: wb_command -label-resample $masksdir/$maskL $HCPdir/S1200.L.sphere.32k_fs_LR.surf.gii $dHCPdir/L.sphere.reg.surf.gii ADAP_BARY_AREA $outdir/L.test1.label.gii -area-metrics $HCPdir/sep_S1200.L.sulc_MSMAll.32k_fs_LR.shape.gii $dHCPdir/L.transformed_and_reprojected.func.gii
/L.sphere.reg.surf.gii registation output of the HCP-dHCP spheres
L.test1.label.gii output
sep_S1200.L.sulc_MSMAll.32k_fs_LR.shape.gii sulci from HCP atlas (output of -cifti-separate)
/L.transformed_and_reprojected.func.gii sulci from HCP-dHCP template registration -> replaced dHCP.week42.L.sulc.shape.gii
then folowed by this one that uses the the template sphere (which is the one I wrote I think it is correct): wb_command -label-resample $indir/L.test1.label.gii $dHCPdir/dHCP.week41.L.sphere.surf.gii $subdir/sub-CC00073XX08_ses-27800_hemi-L_space-dHCP_sphere.reg.surf.gii ADAP_BARY_AREA $outdir/L.test2.label.gii -area-metrics $dHCPdir/dHCP.week41.L.sulc.shape.gii $subdir/sub-CC00073XX08_ses-27800_hemi-L_space-T2w_sulc.shape.gii
Where L.test1.label.gii are the labels registered in to dhcp template,
dHCP.week41.L.sphere.surf.gii the template sphere,
sub-CC00073XX08_ses-27800_hemi-L_space-dHCP_sphere.reg.surf.gii the msm output of align_to_surface.sh,
L.test2.label.gii the output
dHCP.week41.L.sulc.shape.gii template sulci
sub-CC00073XX08_ses-27800_hemi-L_space-T2w_sulc.shape.gi the subject sulci in the native space
Edit: I’ve runned the script with the config file you suggested earlier and I’ve replaced the reference metrics (L.transformed_and_reprojected.func.gii) in the first -label-resample with dHCP.week42.L.sulc.shape.gii or the sulci file from the dhcp template.
Of your command is correct. for -area-metrics it is expecting areal distortion measures - if you really want to run ADAP_BARY_AREA you should use -area-surfs and then supply each surface’s midthickness (or white) surface.
It does have 84k vertices. I’ve tried to use -area-surfs with the white matter and the result are sligtly better than using the sulci! Here the results, do you think they are good enough also with that not perfect alignment?
sorry for some reason I didn’t catch this message.
It’s very difficult to say. The HCP parcelation ideally requires multimodal (myelin and rfMRI) registration and its likely that many of the regions in the adult aren’t present in the neonate. Also - you’ve only shown the medial side of the surface
However, when using the resulting ROIs in bedpostx2 (exactly half of the rois), the software returns the following error:
terminate called after throwing an instance of ‘NEWMAT::IndexException’ Aborted (core dumped)
I suspect there could be some errors in some adult-babies registration, probably since some adults regions in the adult aren’t present in the neonate as you wrote.
Do you have any clue why a subset the ROIs are not working in probtrack only? I converted the surf.gii files in .asc using whitematter as surface
I think you should probably direct this question to the FSL list. a NEWMAT::IndexException could refer to so many things in the code but it’s saying that basically it’s trying to index a position in an array that doesn’t exist i.e. you are trying to put something in row 10 of a matrix when it only has 9 rows. Perhaps somewhere you have defined the number of ROIs present as wrong for example - good to check that all the label files all have the same number of regions - though I can’t see how they would not following the registration you describe - maybe there’s a masking issue or something.