Generating Track-Weighted Functional Connectivity (TW-FC) maps

This example demonstrates how these maps were derived, precisely as performed
in the relevant NeuroImage paper.

Assumes that you have a whole-brain tractogram named tracks.tck, and a 3D volume named FC_map.mif representing an extracted FC map with appropriate thresholding.

Initial TWI generation:

$ tckmap tracks.tck temp.mif < -template / -vox options > -contrast scalar_map -image FC_map.mif -stat_vox mean -stat_tck sum

Deriving the mask (voxels with at least 5 streamlines with non-zero TW values):

$ tckmap tracks.tck - -template temp.mif -contrast scalar_map_count -image FC_map.mif | mrcalc - 5 -ge mask.mif -datatype bit

Apply the mask:

$ mrcalc temp.mif mask.mif -mult TWFC.mif