REST in scipts

1 ReHo computing in scripts
1.1 Brief description
This sample would remove the linear trend and do band pass filtering, then run the ReHo algorithm, and divide the global mean in a predefined mask. In the meantime, save this person’s result for further t test.
1.2 Scripts
rest_detrend(‘someone’, ’_detrend’); % someone should be the full path of some person’s 3d+time directory, which containing all the funcional data preprocessed by slice timing, head motion correction and spational normalization. The results would be saved in directory “someone_detrend”.

rest_bandpass(‘someone_detrend’, 2, 0.08, 0.01, ‘Yes’, ‘BrainMask_05_61x73x61.img’); %TR=2s, 0.01~0.08Hz band pass filter, and use mask

reho(‘someone_detrend_filtered’, 27, ‘BrainMask_05_61x73x61.img’, ‘reho_result.img’); % compute ReHo and save result as “reho_result.img”

rest_DivideMeanWithinMask(‘reho_result.img’, ‘reho_mean_result.img’, ‘BrainMask_05_61x73x61.img’) %divide the mean ReHo result within a mask

2 SliceViewer sample interfaces in codes
2.1 Brief description
This sample would show howto customize your own SliceViewer actions in codes for speeding up results checking or other intentions. It would load ch2 as underlay, and change display style to trasverse view, load two overlays, montage as 3x2, spacing as 3 and showing label. Then change the colorbar and thresholds. The ch2.nii and two overlays should be replaced with full path. “pause(10)” is just for showing the effects of calling each REST’s SliceViewer’s API.
2.2 Codes
fig=rest_sliceviewer('ShowImage','ch2.nii'); pause(10);
rest_sliceviewer('TransverseView', fig); pause(10);
rest_sliceviewer('ShowOverlay',fig,'t-test.img'); pause(10);
rest_sliceviewer('Montage', fig, 2, 3, 3, 1); pause(10);
rest_sliceviewer('AddExtraOverlay', fig, 't-test2.img'); pause(10);
rest_sliceviewer('ChangeColormap', fig, 0, 'winter(64)'); pause(10);
thd.type='MaxMinThrd'; thd.Min=0; thd.Max=inf;
rest_sliceviewer('ThresholdOverlayValue',fig,1,thd); pause(10);
thd.type='AbsMinThrd'; thd.AbsValue=2;
rest_sliceviewer('ThresholdOverlayValue',fig,1,thd); pause(10);