Skip to content

Using CIVET with TFCE_mediation

trislett edited this page Jun 26, 2017 · 4 revisions

CIVET and TFCE_mediation

These steps assume that $TFCE_mediation variable has been exported to the environment.

export TFCE_mediation=/path/to/tfce_mediation/clone/directory

1. Convert the MNI obj polygons to freesurfer triangular mesh

tm_tools convert-surface -i_mni LH_Surface.obj -o_fs LH_Surface.srf
tm_tools convert-surface -i_mni RH_Surface.obj -o_fs RH_Surface.srf

2. Create adjacency set for newly converted surfaces to be used later for applying surface based TFCE (~3-4 min)

$TFCE_mediation/tfce_mediation/misc_scripts/create_adjacency_list_mni.py -d 1 4 --surfaces LH_Surface.srf RH_Surface.srf

3. Convert the cortical thickness text file to an mgh.

For group analysis, you will need to paste each subjects surface values into a csv formatted file. TFCE_mediation assumes freesurfer output so you will rename the mgh files to the following convention ?h.all.{surface}.03B.mgh.

$TFCE_mediation/tfce_mediation/misc_scripts/tm_mgh_txt_converter.py -i lh_cortical_thickness_for_all_subjects.csv
mv lh_cortical_thickness_for_all_subjects.csv.mgh lh.all.thickness.03B.mgh
$TFCE_mediation/tfce_mediation/misc_scripts/tm_mgh_txt_converter.py -i rh_cortical_thickness_for_all_subjects.csv
mv rh_cortical_thickness_for_all_subjects.csv.mgh rh.all.thickness.03B.mgh

4. Run TFCE_mediation as normal

Note: make sure use the -a option (Load custom adjacency set) for 'step1' analyses.

5. View results

After statistical analysis, *mgh in the output folder can converted back to text file using 'tm_mgh_txt_converter.py -s'. Otherwise, the results can be visualized in freeview or convert to *.ply object for viewing in Blender etc.