Conversion from tck to mat

Dear MRTRIX community

I am trying to figure out how to convert tck files to mat to make them compatible with ExploreDTI. Does anybody know if there is a straight forward way of doing this?

Many thanks in advance
Vasilis

Hi!
did you manage to convert? if yes, could you please guide how you did it. Thanks!

There is a MatLab function within the code repository for getting contents of .tck files into MatLab. I however can’t comment on any esoteric requirements of ExploreDTI beyond that.
Rob

Hi Rob,
I managed to use the Matlab function to read the .tck file and have extracted the fiber index and 3d tract values. I am trying to align a muscle mesh (.stl) with the extracted fibres. Please correct me if wrong, the muscle mesh is already in mm and the fiber tracks values of .tck are also in mm? My T1-scan: 0.7x0.7x1 mm and Diffusion scan: 2x2x4 mm.
In the attached image, the muscle tracks and mesh are not in the same plane. Do I need to correct it only for registration i.e. scale, roatate or translate? or do I also need to do correction regarding the scan dimmensions? if yes, could you guide how to proceed?

I did ACT based deterministic tractography and I thought that the muscle mesh and the tracked fibres will automatically align, as I had already done the registration via FSL in mrtrix before performing ACT. But when I imported these in MATLAB, they both seem off.

Thanks!

Unfortunately there are far more ways that this can go wrong than there are ways in which it can go right. Stating that both datasets are “in mm” only guarantees that they are scaled equivalently; it says nothing about the origin that they define as [0, 0, 0], or the reference axes that each of the values in a triplet are defined with respect to.

You have not provided any information about how the muscle mesh STL was generated, so I can’t comment on how that may or may not align with streamlines generated by MRtrix. If that surface was itself generated using MRtrix using the voxel2mesh command, then its vertices should be defined within scanner / real space just as the streamline vertices are. You would need to look into whether eg. you may have generated that surface from the T1-weighted image prior to performing registration & transforming the image data from which it was computed, or erroneously run the meshconvert command and applied a transform. Or if you have generated that surface using some other software, then maybe it generates its vertices in voxel space rather than real / scanner space.

Hi @rsmith ,

Thanks for replying. I looked into the .stl and the problem was that the file was formed in 3dslicer. Now, I used the mrtrix ‘voxel2mesh’ command to create the .stl file by applying the marching cubes algorithm. The fiber tracts and the resultant .stl file both seem to be in same scanner plane. But there is an offset (see in picture). My question is:

  1. The offset is because of the different resolution?
  2. How do I take care of the resolution of the tck file? I think I can’t downsample it. My end goal is to calculate the fiber lengths. To do so, it ll be imp to have it in the same size.
  3. The .stl mesh obtained via mrtrix have a region with big hole inside. is there anyway that I can fill this hole? The .stl obtained from the 3dslicer had no holes.

P.s. The resolution of my T1scan (.stl based) is 0.7x0.7x1 mm and the resolution of my Diffusion scan (.tck based) is 2x2x4 mm.

RAS Origin (voxel space)
T1: 251.4208, -145.7618, 792.600 mm
Diffusion: 206.5792, -147.8471, 324.1 mm