Skip to content

Using CIVET with TFCE_mediation

trislett edited this page May 14, 2017 · 4 revisions

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

E.g.,

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

CIVET and TFCE_mediation

  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
  1. 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
  1. 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
  1. Run TFCE_mediation as normal; however, make sure use the -a option (Load custom adjacency set) for 'step1' analyses.

  2. 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 converted to *.ply object for viewing in Blender etc.