-
Notifications
You must be signed in to change notification settings - Fork 33
Estimating bundle specific myelin content
Assuming you have a tractogram called tractogram.tck, a co-registered myelin volume fraction map myelin_map.nii.gz and a white-matter mask WM_mask.nii.gz in the same directory, with the following code you can perform Myelin Streamline Decomposition (MySD) to reproduce results as in Schiavi et al., 2022.
import commit
commit.setup() # NB: this is required only the first time you run COMMIT# Load the tractogram
from commit import trk2dictionary
trk2dictionary.run(
filename_tractogram = 'tractogram.tck',
filename_mask = 'WM_mask.nii.gz',
fiber_shift = 0.5,
ndirs = 1
)# Set parameters
mit = commit.Evaluation()
# Load the myelin data
mit.load_data( 'myelin_map.nii.gz' )Now that the data are loaded, you are ready to run MySD. Please note that the steps are the same as in the Getting Started tutorial, except for the model selection.
# Set model and generate the response functions
mit.set_model( 'ScalarMap' )
mit.generate_kernels()
mit.load_kernels()
# Load dictionary and buid the operator
mit.load_dictionary()
mit.set_threads()
mit.build_operator()
# Fit model to the data
mit.fit( tol_fun=1e-3, max_iter=1000 )
mit.save_results()Once the fitting has reached convergence, you find the estimated myelin contributions of each streamline in the file COMMIT/Results_ScalarMap/streamline_weights.txt, which is a text file with one row for each streamline; you can use this information in your usual analysis pipeline to evaluate e.g. the myelination of different bundles or the myelin-weighted connectivity.
Diffusion Imaging and Connectivity Estimation (DICE) lab