Registration / transformation issues are always difficult to comment on without having access to the raw data, but I’ll make a few comments based on what I can see:
In my own experience I’ve found affine registration to a population template to be quite lacking, even for a crude parcellation such as AAL. There’s simply more variation in brain shape than can be captured with 12 degrees of freedom. So personally I’d advise including non-linear registration in your pipeline.
It seems to me that step 3 is applying an affine transformation to the parcellation image in order to transform the data into subject space. As such, it’s not clear why a second explicit transformation step (5) would be necessary.
mrtransform aal2highres.mif -linear diff2struct_mrtrix.txt -inverse -datatype uint32 hcpmmp1_parcels_coreg.mif
The affine transformation text file specified here is not generated by any of your previous steps; the output file name is also probably not appropriate given the parcellation with which you are operating. But if I were to assume that it has been generated and contains what it claims to (transform from diffusion to structural), then the fact that the registration was performed between the structural image and the template, and the transformation of the parcellation was then performed in order to bring it into alignment with the structural image, I do not think that the transformation that was necessary to align the DWI data with the structural image is appropriate to be applying to the parcellation image that is nominally already aligned with the structural image.
… especially when i used diff2struct_mrtrix.txt in step 5 for having all datas in mni and atlas space?
To answer this with any confidence I would need to know exactly how that file was generated. But there seems to be a discrepancy between the steps you have described and your interpretation as stated here. The purpose of inverting the transformation from T1w structural image to the template, and then applying that inverted transformation to the parcellation image, is very deliberately to perform processing in subject space, not MNI / atlas space.
ERROR----->tck2connectome: [WARNING] The following nodes are missing from the parcellation image:
tck2connectome: [WARNING] 7, 11
tck2connectome: [WARNING] (This may indicate poor parcellation image preparation, use of incorrect or incomplete LUT file(s) in labelconvert, or very poor registration)
what is the problem and what should i do?
I’m not sure how much I can expand on this over and above the error message issued. The purpose of the
labelconvert step is to produce a parcellation image where the parcels are numbered incrementally from 1 with no gaps, so that when you then produce a connectome matrix, the rows & columns correspond to your parcels of interest, and there are no empty rows / columns. The fact that this has been detected to have not been achieved in your case suggests that there’s something wrong with the pipeline; but there are multiple possible avenues by which such an error may have arisen. It’s therefore up to you to interrogate the intermediate steps of your pipeline to find out why it is the case that in the parcellation image that you have provided to
tck2connectome, there are no voxels with the values 7 or 11.