Beauchamp:ALICE: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
No edit summary
Line 8: Line 8:


   FS segmentation selected: /Users/fosterlab/Documents/MATLAB/CTMR/DATA/YBK/ALICE/data/FreeSurfer/t1_class.nii
   FS segmentation selected: /Users/fosterlab/Documents/MATLAB/CTMR/DATA/YBK/ALICE/data/FreeSurfer/t1_class.nii
This file was originally called YBK_fs_ribbon_rh_class.nii  **not sure where it came from
This file was originally called YBK_fs_ribbon_rh_class.nii  (renamed version of rh.ribbon.nii)
 
   CT scan selected: /Users/fosterlab/Documents/MATLAB/CTMR/DATA/YBK/ALICE/data/CT/CT_highresRAI.nii
   CT scan selected: /Users/fosterlab/Documents/MATLAB/CTMR/DATA/YBK/ALICE/data/CT/CT_highresRAI.nii
This file was originally called YBK_CT.nii
This file was originally called YBK_CT.nii

Revision as of 11:32, 21 July 2017

This page shows the steps used by the ALICE package to localize electrodes. These steps are called from within a Matlab GUI.


The GUI has three steps. Here is the log file from the first step (an edited version of /Volumes/data/UT/YBK/ALICE/log_info/Step1_log.txt with comments added )

 MRI scan selected: /Users/fosterlab/Documents/MATLAB/CTMR/DATA/YBK/ALICE/data/MRI/YBK_T1.nii
 FS segmentation selected: /Users/fosterlab/Documents/MATLAB/CTMR/DATA/YBK/ALICE/data/FreeSurfer/t1_class.nii

This file was originally called YBK_fs_ribbon_rh_class.nii (renamed version of rh.ribbon.nii)

 CT scan selected: /Users/fosterlab/Documents/MATLAB/CTMR/DATA/YBK/ALICE/data/CT/CT_highresRAI.nii

This file was originally called YBK_CT.nii

  Aligning CT to MRI... This might take several minutes. Please wait...
  tcsh -x alignCTtoT1_shft_res.csh -CT_path CT_highresRAI.nii -T1_path../MRI/YBK_T1.nii

This shell script contains the following steps

 @Align_Centers -base $t1  -dset $ct
 3dresample -input CT_highresRAI_shft.nii -prefix CT_highresRAI_res_shft.nii  -master $t1  -dxyz 1 1 1 -rmode NN
 align_epi_anat.py -dset1 $t1 -dset2  CT_highresRAI_res_shft.nii -dset1_strip None -dset2_strip None -dset2to1 -suffix _al  -feature_size 1  -overwrite -cost nmi -giant_move -rigid_body > status.txt
 3dcopy  CT_highresRAI_res_shft_al+orig CT_highresRAI_res_al.nii
 3dcopy $t1 ./temp_ANAT.nii
 afni -com "SWITCH_UNDERLAY temp_ANAT.nii" -com "SWITCH_OVERLAY CT_highresRAI_res_al.nii"


The log file from the second step does not contain the called commands, the list below has been extracted from the Matlab file ctmrGUI.m Three parameters are set in the GUI: electrode max intensity, electrode volume, inter electrode space. For subject YBK, the max intensity that worked best was 3500. Electrode volume was set to “2”, space was set to “1”. The GUI then calls this script:

 tcsh -x 3dclustering.csh -CT_path ../CT/CT_highresRAI.nii -radius ' num2str(obj.settings.R) ' -interelectrode_space ' num2str(obj.settings.IS) ' -clip_value ' num2str(obj.settings.CV)]);

This script contains the following commands:

 3dclust -savemask 3dclusters_r${r}_is${is}_thr${cv}.nii -overwrite -1Dformat -1clip $cv $is $r $ct  > clst.1D 
 # make sure the clusters all show up in afni with distinct colors
 3drefit -cmap INT_CMAP 3dclusters_r${r}_is${is}_thr${cv}.nii 
 # now resample the clusters, erode, dilate and cluster again
 # this helps separate the clusters that overlap
 3dresample -prefix temp_clusts_rs0.5 -overwrite -rmode NN -dxyz 0.5 0.5 0.5 -inset 3dclusters_r${r}_is${is}_thr${cv}.nii
 3dmask_tool -dilate_inputs -1 +2 -prefix temp_clusts_rs0.5_de2 -overwrite -inputs temp_clusts_rs0.5+orig
 3dclust -savemask 3dclusters_r${r}_is${is}_thr${cv}.nii -overwrite -1Dformat -1clip $cv $is $r temp_clusts_rs0.5_de2+orig > clst.1D 
 3drefit -cmap INT_CMAP 3dclusters_r${r}_is${is}_thr${cv}.nii 
 rm temp_clusts*.HEAD temp_clusts*.BRIK*
 IsoSurface -isorois+dsets -mergerois+dset -autocrop -o_gii 3dclusters_r${r}_is${is}_thr${cv}.gii -input 3dclusters_r${r}_is${is}_thr${cv}.nii  
 echo "Clustered dataset saved as 3dclusters_r${r}_is${is}_thr${cv}.nii"
 echo "Table of coordinates saved as clst.1D"