AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
June 25, 2007 11:00AM
Hello AFNI Nation,

When the LDRR Philips 3T magnet was using research export tool version 4, I used the following script to convert the PAR/REC files into HEAD/BRIK files via to3d. I believe this script was written by one of the AFNI folks and modified by Dr. Butman and then again (slightly) modified by myself.

# /bin/csh
# Usage:
#
# PAR_to4d.csh oufile(afni) infile(PAR/REC)
#
# do not give filename extentions
#
set parFile = $2.PAR
set recFile = $2.REC

set NT = `cat $parFile | grep dynamics | cut -d: -f2 | sed 's/^[ \t]*//' | tr -d "\r"`
set NP = `cat $parFile | grep phases | cut -d: -f2 | sed 's/^[ \t]*//' | tr -d "\r"`
set NS = `cat $parFile | grep locations | cut -d: -f2 | sed 's/^[ \t]*//' | tr -d "\r"`
set XFOV = `cat $parFile | grep FOV | cut -d: -f2 | sed 's/^[ \t]*//' | tr -d "\r" | cut -d' ' -f3`
set ZFOV = `cat $parFile | grep FOV | cut -d: -f2 | sed 's/^[ \t]*//' | tr -d "\r" | cut -d' ' -f5`

# To get resolution from image line

set NX = `cat $parFile | head -92 | tail -1 | sed 's/^ *//g' | sed 's/ */ /g' | cut -d' ' -f10`

@ N2Dslices = ${NS} * ${NT} * ${NP}

set target = "3D:0:0:"${NX}":"${NX}":"${N2Dslices}":"${recFile}
set temporal = "time:tz "${NT}" "${NS}" 20s simult"
echo "Converting -${temporal} $target"

to3d -prefix $1 \
-in:1\
-skip_outliers \
-xFOV ${XFOV}S-I\
-yFOV ${XFOV}R-L\
-zFOV ${ZFOV}A-P\
-$temporal \
$target

Now that Philips has upgraded to research export tool version 4.1, the .PAR files have a slightly different layout which prevents the above script from teasing out the necessary information to convert the files. The AFNI error that the screen reads is as follows...

Converting -time:tz 1 45 20s simult 3D:0:0:::45:DBIEX_5_1.REC
++ to3d: AFNI version=AFNI_2007_05_29_1644 (Jun 1 2007) [32-bit]
++ Authored by: RW Cox
** Illegal value of nt after -time: option
** Can't find file 3D:0:0:::45:DBIEX_5_1.REC

** NO INPUT IMAGE FILES?

try 'to3d -help'

The problem clearly is that the above series of three colons between 0 and 45 should contain numbers, which I'm guessing the above script is calling $NX (the image resolution). Unfortunately, I am not familiar enough with "sed" (UNIX's non-interactive text manipulater), to modify the script to work with the new PAR format. I'll try and force feed this to myself, but someone more familiar with UNIX might be better equiped to answer this. For a copy of a version 4 PAR file and a version 4.1 PAR file, just email me at kanevskya@mail.nih.gov and I'll happily provide you with them. Thanks in advance!!

-Ariel kanevskya@mail.nih.gov
Subject Author Posted

PAR/REC to HEAD/BRIK conversion script no longer works with new Philips upgrade

Ariel June 25, 2007 11:00AM

Re: PAR/REC to HEAD/BRIK conversion script no longer works with new Philips upgr

Daniel Glen June 25, 2007 01:38PM

Re: PAR/REC to HEAD/BRIK conversion script no longer works with new Philips upgr

Ariel June 25, 2007 03:20PM

Re: PAR/REC to HEAD/BRIK conversion script no longer works with new Philips upgr

Daniel Glen June 25, 2007 03:35PM

Re: PAR/REC to HEAD/BRIK conversion script no longer works with new Philips upgr

Ariel June 25, 2007 05:51PM

Re: PAR/REC to HEAD/BRIK conversion script no longer works with new Philips upgr

Ariel June 26, 2007 10:12AM

Re: PAR/REC to HEAD/BRIK conversion script no longer works with new Philips upgr

Daniel Glen June 26, 2007 12:32PM

Re: PAR/REC to HEAD/BRIK conversion script no longer works with new Philips upgr

Ariel June 27, 2007 11:36AM

Re: PAR/REC to HEAD/BRIK conversion script no longer works with new Philips upgr

Daniel Glen June 27, 2007 11:42AM

Re: PAR/REC to HEAD/BRIK conversion script no longer works with new Philips upgr

Ariel June 27, 2007 01:56PM

Re: PAR/REC to HEAD/BRIK conversion script no longer works with new Philips upgr

Colm Connolly October 04, 2007 06:15AM

Re: PAR/REC to HEAD/BRIK conversion script no longer works with new Philips upgr

Keith McGregor October 03, 2007 08:41PM