I have used label convert,kindly see the update, i am still incurring the same error.
Hi,
The first figure is the diffusion data or the 5TT overlaid to the T1w? you could play a little bit with the opacity to see what’s going on.
In the second figure and the command line there is something that I don’t understand:
You seem to use Glasser’s parcellation in the command line, but the figure looks like the Dsikan-Killany with 84 ROIs. Also note that with labelconvert you are not doing label propagation, you simple are changing the values of you ROIs. You need to align your T1w to the diffusion data first, and then apply the same transformation to the labels.
I hope this helps.
Best regards,
Manuel
Dear ,
I have changed the reply , i am sorry for my mistake, now i have overlaid the glasser atlas.
- Yes first figure is 5tt overlaid on diffusion data.
I have transformed the Glasser labels into T1w space using
mrtransform hcpmmp1_parcels_nocoreg.mif -linear diff2struct_mrtrix.txt -
inverse -datatype uint32 hcpmmp1_parcels_coreg.mif
this is how i have generated diff2struct_matrix.txt
flirt -in myprefix0000.nii.gz -ref 5tt_nocoreg.nii.gz -interp nearestneighbour -dof 6 -omat diff2struct_fsl.mat
transformconvert diff2struct_fsl.mat mean_b0_preprocessed.nii.gz 5tt_nocoreg.nii.gz flirt_import diff2struct_mrtrix.txt
Hi,
Could you display together the 5TT and the label map? If indeed the two files are aligned between them and with the diffusion, I’m running out of ideas.
How many streamlines are you generating?
Best regards,
Manuel
Hi,
I can not see if they overlay or not, could play a little bit with the opacity to be able to see the two images superposed?
Also my feeling is that 1 million streamlines is a very low number for this parcellation, try to increase that to 10 or 100 and see what happens.
Best regards,
Manuel
Indeed there is an overlay problem
I dont know what i have done wrong in this case, i have tried to overlay 5TT image on label map.
Could you please let me know how to resolve this issue.
Hi,
By the coreg, at the end of the 5TT name, I assume that the 5TT is aligned to the diffusion.
Then, I can think of two possibilities:
- the transformation was not applied to the labels
- the T1w used for the 5TT and the parcellation are with different orientations
For the first case, you said that the transformation was applied to the labels. What about the second possibility? are you using the raw T1w for the 5TT? I’m not familiar with freesurfer, maybe they perform an internal reorientation of the data?
Best regards,
Manuel
5TT is aligned with the diffusion file
this is the procedure i have used
flirt -in myprefix0000.nii.gz -ref 5tt_nocoreg.nii.gz -interp nearestneighbour -dof 6 -omat diff2struct_fsl.mat
transformconvert diff2struct_fsl.mat mean_b0_preprocessed.nii.gz 5tt_nocoreg.nii.gz flirt_import diff2struct_mrtrix.txt
mrtransform 5tt_nocoreg.mif -linear diff2struct_mrtrix.txt -inverse 5tt_coreg.mif
I have got myprefix0000.nii.gz by using fslsplit and i used b0 from dwi file and registered it to 5tt_nocoreg.nii.gz
Hi,
flirt -in myprefix0000.nii.gz -ref 5tt_nocoreg.nii.gz -interp nearestneighbour -dof 6 -omat diff2struct_fsl.mat
You should use the T1w to guide the registration, not the 5TT. It would be something like:
flirt -in myprefix0000.nii.gz -ref T1w.nii.gz -dof 6 -omat diff2struct_fsl.mat
transformconvert diff2struct_fsl.mat mean_b0_preprocessed.nii.gz T1w.nii.gz flirt_import diff2struct_mrtrix.txt
You can also play with other cost functions like bbr, please see here
And then, if your parcellation is already aligned with your T1w data, you only need to do:
mrtransform labels_nocoreg.mif -linear diff2struct_mrtrix.txt -inverse labels_coreg.mif
If is not, the first try to find the cause for this miss-alignment. The you have two options, or repeat the process with the other T1w, or align the two T1ws
Best regards,
Manuel
it did not change a bit, i am still getting the same error
Could you overlay the 5tt_nocoreg.mif and the hcpmmp1_parcels_nocoreg.mif? In the overlay image could you setup the lower threshold for display at 0.7 or something similar?
I have changed the threshold and there seems to registration problem :overlay 5tt_nocoreg.mif and the hcpmmp1_parcels_nocoreg.mif
Hi,
I think that the T1w output of freesurfer and the T1w used for 5TT are in different spaces. Registering the output of freesurfer to the other, and applying the transformation to the labels should do the trick. Then you only have to apply the transformation you calculated before to both.
Best regards,
Manuel
This is the registration procedure that i have applied to register Freesurfer labels to DWI space
mri_aparc2aseg --old-ribbon --s KON11 --annot hcpmmp1 --o hcpmmp1.mgz
mrconvert –datatype uint32 hcpmmp1.mgz hcpmmp1.mif
labelconvert hcpmmp1.mif hcpmmp1_original.txt hcpmmp1_ordered.txt hcpmmp1_parcels_nocoreg.mif
mrtransform hcpmmp1_parcels_nocoreg.mif -linear diff2struct_mrtrix.txt -inverse -datatype uint32 hcpmmp1_parcels_coreg.mif
Is there anything wrong that i have done here ?.
Hi,
I’m no familiar with freesurfer commands, but it looks like the transformation you are applying (diff2struct_mrtrix.txt
) is not defined in the same space than the hcpmmp1.mgz
, I could try to open the T1w image you are using to generate the 5TT and overlay the norm.mgz
generated by freesurfer.
If you see a miss-alignment something like this should work:
mrconvert –datatype uint32 norm.mgz norm.nii.gz
flirt -in norm.nii.gz -ref T1w.nii.gz -omat norm_2_t1w -dof 6 -out norm_2_t1w.nii.gz
Then you apply this transformation to your labels befor applying the other transformation (or you can concatenate them)
Best regards,
Manuel
Again i am facing the the problem
I tried applying this transform first to the labels
mrconvert –datatype uint32 hcpmmp1.mgz hcpmmp1.nii.gz
flirt -in hcpmmp1.nii.gz -ref norm_2_t1w.nii.gz -applyxfm -init norm_2_t1w.mat -out hcpmmp1_labels.nii.gz
then i did
labelconvert hcpmmp1_labels.nii.gz hcpmmp1_original.txt hcpmmp1_ordered.txt hcpmmp2_parcels_nocoreg.mif
now i am getting an error
labelconvert: Image “hcpmmp1_labels.nii.gz” stored with floating-point type; need to check for non-integer or negative values
labelconvert: [100%] uncompressing image “hcpmmp1_labels.nii.gz”
labelconvert: [100%] Verifying parcellation image
labelconvert: [ERROR] Floating-point number detected in image “hcpmmp1_labels.nii.gz”; label images should contain integers only.
Hi,
When you apply a transformation to the labels with flirt, you should add the flag -interp nearestneighbour
to the command.
Best regards,
Manuel
Yes, i have done that but still i have a problem, for the label 120 the streamlines are not assigned
tck2connectome: [100%] Constructing connectome
tck2connectome: [WARNING] The following nodes do not have any streamlines assigned:
tck2connectome: [WARNING] 120
tck2connectome: [WARNING] (This may indicate a poor registration)
Hi,
This could be to several reasons:
- Small number of streamlines, 1million I think is very small number for this parcellation.
- It could be that this area is specially difficult to tract and you need to refine your tractography parameters
- Maybe remains unassigned, because all the area falls inside of the GM, and therefore no tracts are allowed to reach that part. I encountered this problem with some areas for some subjects (neonates).
First I would inspect the image, to see that are aligned and the node 120 is not all covered by GM, then I would create a tractography with 100million streamlines and see if the warning is still there. There is a paper discussing some of these issues.
Best regards,
Manuel