Recreating same connectivity matrix on python

For a research project, We are trying to recreate the same connectivity matrix that is generated from Mrtrix (see the command line code below, for specific options) in Python. We extract coreg_parcellation file and tck file from Mrtrix and the use the relevant functions in nilearn and dipy packages in Python (see the full code attached). But we are not able to get the same connectome as is outputted by Mrtrix. Do you have any thoughts on what we might be missing?

code2pdf_6644dafb32ad4.pdf (47.4 KB)