App::AFNI:SiemensPhysio - Physio from Siemens into format suitable for AFNI's RetroTS retroicor routine
Get slice based respiration volume per time (RVT) regressors from physio collected on Siemens scanner
my $p = SiemensPhysio->new({VERB=>1}); # read MR data (get times, TR, nslices) # looks at all files in this directory with "dicom_hinfo" $p->readMRdir('MRRaw/10824_20111108/rest_384x384.21/'); # read pulse $p->readPhysio('10824/20111108/wpc4951_10824_20111108_110811.puls'); # write card: $protocol_$sessionTime.puls.dat $p->writeMRPhys; # read card $p->readPhysio('10824/20111108/wpc4951_10824_20111108_110811.resp'); # write resp: $protocol_$sessionTime.resp.dat $p->writeMRPhys; # $p->retroTS('matlab') # we could get the raw data # in this case, card was resp was loaded last # thats what will be returned) my @pval = $p->getMRPhys();
initialize object
MDH (default) or MPCU
Physio sample rate defaults to .2
defaults:
pulsStart =>'1 2 40 280' respStart =>'1 2 20 2'
alt+z (default) other options: alt-z,seq+z,seq-z,filename # slice order
set to true to be verbose, defaults false
don't check sample rate and index count against end-start time none=> check both MR => trust MR (TR) phys=> trust physio (PhRate as set by init) all => trust both
Note: just have to match reg exp, so MRphys is same as all
after intializing p, provide a file name
$p->readPhysio('10824/20111108/wpc4951_10824_20111108_110811.puls');
1 2 40 280 ... [long space delimn. list of measurements, maybe 5000 for trigger?] ECG Freq Per: 0 0 PULS Freq Per: 74 807 RESP Freq Per: 20 2860 EXT Freq Per: 0 0 ECG Min Max Avg StdDiff: 0 0 0 0 PULS Min Max Avg StdDiff: 527 1586 828 4 RESP Min Max Avg StdDiff: 2380 6700 3477 86 EXT Min Max Avg StdDiff: 0 0 0 0 NrTrig NrMP NrArr AcqWin: 0 0 0 0 LogStartMDHTime: 66439690 LogStopMDHTime: 71116595 LogStartMPCUTime: 66439512 LogStopMPCUTime: 71114802 6003
after intializing p, read in MR info from raw DICOM directory
$p->readMRdir('MRRaw/10824_20111108/rest_384x384.21/');
sets
dicom header info
dicom_hdr MRRaw/10824_20111108/rest_384x384.21/MR* |egrep 'protocol|acquisition Time|Echo Time|Repetition Time' -i 0008 0031 14 [620 ] // ID Series Time//164627.359000 0008 0032 14 [642 ] // ID Acquisition Time//164932.315000 0018 0080 4 [1418 ] // ACQ Repetition Time//1500 0018 0081 2 [1430 ] // ACQ Echo Time//29 0018 1030 4 [1612 ] // ACQ Protocol Name//rest 0019 100a 2 [1788 ] // // 29
shortend to
dicom_hinfo -tag 0008,0032 0008,0031 0018,0080 0018,0081 0018,1030 MR*
must already have nDcms (number of volumes in 4d) set
write phys during MR to file works on most recently loaded physio file
$p->writeMRPhys
This is kludgy code hacked together and untested :) =over
get/run command to get Resp. Vol./Time (RVT) via AFNI's retroTS a la http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2715870/ MUST have already read MR and written card and resp dat files
$p->retroTS('matlab')
how this step is handled is defined by the first argument
see
if using matlab+retroTS, the path to retroTS.m should be in your MATLABPATH export MATLABPATH="$HOME/afni_matlab/matlab/:$MATLABPATH"
1 POD Error
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
To install App::AFNI::SiemensPhysio, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::AFNI::SiemensPhysio
CPAN shell
perl -MCPAN -e shell install App::AFNI::SiemensPhysio
For more information on module installation, please visit the detailed CPAN module installation guide.