This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
biac:analysis:physiological [2011/10/25 19:08] petty created |
biac:analysis:physiological [2023/02/23 18:43] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Physiological Correction Methods ====== | ====== Physiological Correction Methods ====== | ||
- | Currently this assumes that you have recorded your physiological responses through Cigal. | + | ===== Generate resampled TSV from raw GE physio files automatically copied from the scanners |
- | There' | + | Stock GE physio is hardcoded by GE to be 25Hz for respiration and 100Hz for pulse. |
- | This tools uses various fields from the bxh and pdigm file to output " | ||
- | |||
- | The python tool will call cigal functions directly, then output new text data in the format requested. | ||
< | < | ||
- | physio_create.py --help | + | [cmp12@blade17 20211218_03399]$ / |
+ | usage: convert_GEphysio.py [-h] --xmlh XMLFNAME [--json JSONFNAME] --physdir | ||
+ | | ||
+ | | ||
+ | |||
+ | create 100Hz resampled TSV from raw GE physio data | ||
+ | |||
+ | optional arguments: | ||
+ | -h, --help | ||
+ | --xmlh XMLFNAME | ||
+ | --json JSONFNAME | ||
+ | --physdir PHYSDIR | ||
+ | --bidsout | ||
+ | --afnislicetime | ||
+ | --delay DELAYTIME | ||
+ | | ||
</ | </ | ||
+ | |||
+ | Provide a valid BXH ( and JSON if possible ) and a path to your subject physio folder to convert_GEphysio.py function. | ||
+ | |||
+ | This function will search the physio directory for physio files within a specified time range based on the functional scantime + timepoints + a default delay in writing. | ||
+ | |||
+ | If matching respiration and pulse files are found theoretical scan triggers on each TR will be created and the respiration and pulse data will be resampled to 100Hz and locked to the onset of the scan. If disdaqs are detected in the BXH the corresponding physio time will be discarded. | ||
< | < | ||
- | physio_create.py --bxh /path/to/run4.bxh --pdigm /path/to/ | + | / |
+ | </code> | ||
- | Program to produce formatted physiological data: | + | By default you will get a 100Hz resampled TSV with headers |
- | Data will be corrected | + | |
- | BXH and PDIGM required | + | |
- | OUTPATH defaults to PWD | + | |
- | FORMAT: defaults to fsl | + | |
- | - fsl = cardio, | + | |
- | - npm = time, | + | |
- | - afni = cardiac.txt, | + | |
- | Options: | + | The **--bidsout** flag will output a TSV without headers |
- | -h, --help show this help message | + | |
- | -b FILE, --bxh=FILE bxh file for run | + | |
- | -p FILE, --pdigm=FILE | + | The **--afnislicetime** flag will output two 1D slicetiming files to be used with RetroTS.py and afni_proc.py directly. |
- | pdigm file for run | + | |
- | | + | === Using afni === |
- | | + | |
- | -o PATH, --outpath=PATH | + | You can create regressors |
- | | + | |
+ | < | ||
+ | python3 / | ||
+ | |||
+ | -n #slices | ||
+ | -v TR in seconds | ||
</ | </ | ||
- | ===== AFNI ===== | + | RetroTS will produce " |
- | Create the AFNI formated physiological text data. | ||
- | <code bash> | ||
- | This would create my " | + | === setup afni despike, retroicor |
- | Now set-up build the regressors that will be used in afni with their matlab tool. | ||
- | < | + | < |
- | addpath | + | python3 |
- | Opt.Respfile = '/tmp/there/respiration.txt' | + | -subj_id sub-00104_run-4_ricor_phys \ |
- | Opt.Cardfile = '/tmp/there/cardiac.txt' | + | |
- | Opt.VolTR = 1.5 | + | |
- | Opt.Nslices = 34 | + | -tcat_remove_first_trs 2 \ |
- | Opt.PhysFS = 100 | + | |
+ | -ricor_regs_nfirst 2 \ | ||
+ | -ricor_regs / | ||
+ | -verb 1 | ||
- | RetroTS(Opt) | ||
</ | </ | ||
+ | |||
+ | The above will produce an afni script to throw out 2 timepoints, perform a despike, retroicor physio regression and slice time correction based on the RetroTS output and the physio TSV/json above. | ||
+ | |||
+ | Convert the afni corrected output back to nii.gz to be used for other pre-processing if not using AFNI for all steps | ||
+ | |||
+ | < | ||
+ | bxh2analyze --niigz -s pb03.sub-00104_run-4_ricor_phys.r01.tshift+orig.HEAD sub-00104_run-4_physiocorrected | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== CIGAL pdigm specific processing ====== | ||
+ | [[biac: | ||