Hi , Does anyone know how I can save tracks from matlab ? I imported a track file to remove outliers using mbaComputeFibersOutliers from the brain anatomy toolbox. Although I can visualize the result in a matlab figure, the exported one doesn’t work in the mrview. I tried different functions like fgWrite and write_mrtrix_tracks.
witt fgWrite function I got this error :
I got this mrview error: Invalid first line for key/value file ’ filename.tck’
and with write_mrtrix_tracks function
the result is meaningless
While the write_mrtrix_tracks() function is written specifically to export track data from MatLab to .tck file, it will only work if the track data you provide to it are in the format that it is designed to receive. The screenshot you have provided looks like the fundamental nature of the data have been somehow altered.
All I can suggest is:
Run read_mrtrix_tracks() on a known valid track file, then run write_mrtrix_tracks() on the data stored in MatLab to write the track data to a new file. The data should be unaltered, and both versions of the track file should appear identical in mrview.
Once you know that these functions are working correctly, you need to look closely at the nature of the data that are stored within MatLab as a result of read_mrtrix_tracks(), and compare this to the modified data that you are attempting to write to file using write_mrtrix_tracks(). There must be some major difference that is leading to the screenshot you provided; but what this difference may be is difficult to predict from the screenshot alone.