This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
biac:analysis:physiological [2022/01/18 16:09] cmp12 |
biac:analysis:physiological [2023/02/23 18:43] (current) |
||
---|---|---|---|
Line 2: | Line 2: | ||
===== Generate resampled TSV from raw GE physio files automatically copied from the scanners | ===== Generate resampled TSV from raw GE physio files automatically copied from the scanners | ||
+ | |||
+ | Stock GE physio is hardcoded by GE to be 25Hz for respiration and 100Hz for pulse. | ||
+ | |||
< | < | ||
Line 23: | Line 26: | ||
</ | </ | ||
+ | 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. | |
- | ===== CIGAL specific ===== | + | |
- | + | ||
- | Currently this assumes that you have recorded your physiological responses through Cigal. | + | |
- | + | ||
- | ===== physio_run.py ===== | + | |
- | There is currently a tool for running AFNI-based correction of functional image data using physiological data. | + | |
< | < | ||
- | physio_run.py --help | + | / |
</ | </ | ||
- | < | + | By default you will get a 100Hz resampled TSV with headers and timing. |
- | Usage: | + | |
- | physio_run.py / | + | |
- | Program to produce formatted physiological data: | ||
- | Data will be corrected and recreated from the pdigm file based on information from run data | ||
- | BXH and PDIGM required | ||
- | OUTPUTPREFIX is the prefix for the physio-corrected output | ||
- | FORMAT: what pipeline to use, only supports ' | ||
- | Options: | + | The **--bidsout** flag will output a TSV without headers |
- | | + | |
- | -f string, --format=string | + | |
- | output format ( afni ) | + | |
- | </ | + | |
- | '' | ||
- | The outputs | + | The **--afnislicetime** flag will output two 1D slicetiming files to be used with RetroTS.py and afni_proc.py directly. |
- | ===== physio_create.py ===== | + | === Using afni === |
- | The underlying tool used by '' | + | You can create regressors for afni preprocessing |
- | + | ||
- | This tool uses various fields | + | |
- | + | ||
- | The python tool will call cigal functions directly to do the corrections, | + | |
< | < | ||
- | physio_create.py --help | + | python3 |
- | </code> | + | |
- | + | ||
- | < | + | |
- | physio_create.py --bxh /path/to/run4.bxh --pdigm | + | |
- | + | ||
- | Program to produce formatted physiological data: | + | |
- | Data will be corrected and recreated from the pdigm file based on information from run data | + | |
- | BXH and PDIGM required | + | |
- | OUTPATH defaults to PWD | + | |
- | HZ sampling rate | + | |
- | FORMAT: defaults to fsl | + | |
- | | + | |
- | - npm = time, | + | |
- | - afni = cardiac.txt, | + | |
- | Options: | + | -n #slices |
- | | + | -v TR in seconds |
- | -b FILE, --bxh=FILE | + | |
- | -p FILE, --pdigm=FILE | + | |
- | pdigm file for run | + | |
- | -f string, --format=string | + | |
- | output format ( fsl, | + | |
- | --hz sampling rate is hz ( 100 ) | + | |
- | -o PATH, --outpath=PATH | + | |
- | location to store output files | + | |
</ | </ | ||
- | ===== AFNI details ===== | + | RetroTS will produce " |
- | This section details the steps that the tool '' | ||
- | Create the AFNI formated physiological text data. | + | === setup afni despike, retroicor and slicetime correction === |
- | <code bash> | + | |
- | This would create my " | ||
- | < | + | < |
- | addpath | + | python3 |
- | Opt.Respfile = '/path/to/respiration.txt' | + | -subj_id sub-00104_run-4_ricor_phys \ |
- | Opt.Cardfile = '/path/to/cardiac.txt' | + | |
- | Opt.VolTR = 1.5 | + | |
- | Opt.Nslices = 34 | + | -tcat_remove_first_trs 2 \ |
- | Opt.PhysFS = 100 | + | -tshift_opts_ts -tpattern @/ |
- | Opt.SliceOrder = ' | + | -ricor_regs_nfirst 2 \ |
- | %please choose the correct order if not running interleaved: | + | |
+ | -verb 1 | ||
- | RetroTS(Opt) | ||
</ | </ | ||
- | The output of runnning the MATLAB script | + | The above will produce an afni script to throw out 2 timepoints, perform |
- | Convert | + | Convert |
- | <code bash> | + | |
- | Create the afni script which you will use to actually run the 3dretroicor functionality: | + | < |
- | < | + | bxh2analyze --niigz -s pb03.sub-00104_run-4_ricor_phys.r01.tshift+orig.HEAD sub-00104_run-4_physiocorrected |
- | ss_method ' | + | |
- | + | ||
- | The result of the above command would be a tcsh script, which would run the despiking and 3dretroicor correction only. Run it: | + | |
- | <code bash> | + | |
- | + | ||
- | There will be a resulting folder with all the afni data inside. | + | |
- | <code bash> | + | |
- | #convert afni to nii, create bxh | + | |
- | bxh2analyze --niigz -s 12345.results/ | + | |
</ | </ | ||
+ | |||
+ | |||
- | Run the resting state pipeline: | ||
- | <code bash> | ||
Line 143: | Line 90: | ||
+ | ====== CIGAL pdigm specific processing ====== | ||
+ | [[biac: | ||