Some Useful Programs

                                                                                                         DOWNLOAD
Hi, all!
     Here are some useful programs written by me. I think these codes may be helpful for you.
     1. Program for converting T/F/R statistical image to Z statistical image. y_TFRtoZ.m
     2. Program for re-orienting the un-normalized image (diagonalize the complex affine matrix): y_reorient.m
     3. Program for changing the b vector file created by MRIcroN's dcm2nii suitable for DTI Studio: y_ChangeBVector.m
     4. Program for converting the NIfTI file in talairach space into .HEAD/.BRIK format which can be displayed with AFNI in Talairach View: y_ConvertTlrcNiftiToTlrcAFNI.m
     5. Program for Shrinking or Enlarging masks: y_MaskShrink.m and y_MaskEnlarge.m
     6. Program for performing Gaussian Random Field theory multiple comparison correction like easythresh in FSL: y_GRF_Threshold.m
     7. Program for performing robust regression analysis for brain images: y_RobustFit_Image.m
     8. Program for calculating the Intraclass correlation coefficient (ICC) for brain images: y_ICC_Image.m
     9. Program for reslicing images. y_Reslice.m. Now you can find it in REST->Utilities.
     10. Program for regressing out the covaribles. rest_Y_RegressOutCovariables.m. Now you can find it in REST->Utilities.
     11. Program for extracting ROI time courses. rest_Y_ExtractROITC.m. Now you can find it in REST->Utilities.
     12. Program for converting r value to p value, you will know if your Pierson's correlation coefficients are significant: y_Corr2p.m. For an alternative way, you can use REST Slice Viewer to convert T/F/R threshold value to P value or vise visa.

     Please report here if you encounter any problem with these programs.
  
     
           Best wishes!
                                           YAN Chao-Gan

                                                                                                         DOWNLOAD

Hey,
for running the y_reorient, my data are in nifti. Is this ok, because it doesn't work.
Error: ??? Input argument "vx" is undefined
Kind regards,
Leslie

Dear Leslie,
        vx is the new voxel size.
        vx=1 means new voxel size is 1x1x1, 2 means 2x2x2.
        I am sorry just cube voxel can be used currently.
        Best wishes!
                               Chao-Gan

New program has been added here: Program for converting the NIfTI file in talairach space into .HEAD/.BRIK format which can be displayed with AFNI in Talairach View: y_ConvertTlrcNiftiToTlrcAFNI.m
This program is for the combination usage of AFNI and REST/DPARSF. E.g. for brain tumor patients which can not perform normalization with SPM:
1. Use DPARSF to complete the pre-normalization steps: DICOM->NIfTI, Slice Timing, Realign, sturctural T1 .hdr/img coregister to the space of realigned mean functional image.
2. Use AFNI's command '3dWarp -deoblique' and '3drefit -markers' to convert the coregistered structural T1 .hdr/img into structural .HEAD/BRIK pair.
3. Use AFNI's command '3dTcat' to convert the realigned EPI .hdr/img into functional .HEAD/BRIK pair.
4. Use AFNI to manually normalize the structural .HEAD/BRIK into talairach coordinate system. Then use 'Define Datamode'->'Warp Ulay on Demand' to save and resample the structural .HEAD/BRIK and functional .HEAD/BRIK into '+tlrc.HEAD/BRIK' files in talairach space.
5. Use AFNI's command '3dAFNItoNIFTI' to convert functional '+tlrc.HEAD/BRIK' into 4d .nii files. Then use REST->Utilities->NIfTI .nii to NIfTI pairs to convert the 4d .nii into 3d .hdr/img.
6. Use DPARSF to perform the following analysis such as 'smooth->detrend->filter->ALFF,mALFF' based on the 3d .hdr/img files.
7. Use REST or SPM to perform the Statistical analysis.
8. Use the current program 'y_ConvertTlrcNiftiToTlrcAFNI' to convert the statistical result NIfTI file (which is in talairach space) into .HEAD/.BRIK format while keeping a Talairach View.
9. Use AFNI to view the results and generate the cluster report.
  Input:
    TlrcNiftiFileName - The file name of NIfTI file in talairach space.
  Output:
    TlrcNiftiFileName +tlrc.HEAD/BRIK - The .HEAD/.BRIK file which can be
    displayed with AFNI in Talairach View.

Thanks for Dr. DU Zhuo-Ying's post about this issue.

Hi,

Im trying to use the program nº6 and I obtain this error:

ADataDir

ADataDir =

F:\IMATGES\RESTINGS\BORJA\NORMALITZADES_MNI_BORJA_ALFF\DRET_REST1_N_detrend_filtered\FunImgNormalizedDetrendedFiltered\subject001

Regressing Out Covariables:
??? Input argument "ADataDir" is undefined.

Error in ==> rest_Y_RegressOutCovariables at 18
[AllVolume,VoxelSize,theImgFileList, Header] =rest_to4d(ADataDir);

Any suggestion will be appreciate!

Thanks!

It seems you did not call this functional correctly.
This function has been integrated into REST. You can find a GUI in REST->Utilities->Regress Out Covariables. You can use the GUI much easier.
Best wishes!

Hi,

Anyway, after using the GUI I obtain this error:

     Load mask "C:\Users\Cleofé\Desktop\spm5\toolbox\REST2007V1.3_091215\REST2007V1.3_091215\mask\BrainMask_05_53x63x46.img".Warning: Values other than 0 or 1 converted to logical 1.
> In rest_loadmask at 52
  In rest_RegressOutCovariates at 27
  In rest_RegressOutCovariates_gui>Run_Callback at 238
  In gui_mainfcn at 75
  In rest_RegressOutCovariates_gui at 26

     Build mask.    Wait............................................................

     Done>>

However, it seems work.

Thanks!

Hi!
This warning doesn't matter.

Hi all!
Some new Programs Added (multiple comparison correction, robust regression, Intraclass correlation).

6. Program for performing Gaussian Random Field theory multiple comparison correction like easythresh in FSL: y_GRF_Threshold.m
7. Program for performing robust regression analysis for brain images: y_RobustFit_Image.m
8. Program for calculating the Intraclass correlation coefficient (ICC) for brain images: y_ICC_Image.m

Best,

Chao-Gan