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  

|
Daniel Glen
June 26, 2007 12:32PM
Actually there were several changes required for your script. My guess is that this particular script was made for a particular type of dataset because several items are hard-coded , and other scripts were used in your group for other types. Along with changes in Philips export tool, even more changes were needed.

In any case, this is a modification of your script with the principal changes in the x,y resolution, adding a "TR" for volumes, byte-swapping, switching the time-slice order (as you found), reversing orientation information. You'll have to verify left-right with the fiducial marker information in the images. I'll take a look at modifying the 3dPAR2AFNI script too, but this should work for you for now.

# PAR_to4d.csh oufile(afni) infile(PAR/REC)
#
# do not give filename extensions
#
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`

# Get resolution from line describing last slice in volume at end of file
set NX = `cat $parFile | tail -3 | head -1 | sed 's/^ *//g' | awk '{print$10}'`
set NY = `cat $parFile | tail -3 | head -1 | sed 's/^ *//g' | awk '{print$11}'`
set TR = `cat $parFile | grep "Repetition time" | cut -d: -f2 | sed 's/^[ \t]*//' | tr -d "\r"`
#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}":"${NY}":"${N2Dslices}":"${recFile}
set temporal = "time:zt "${NS}" "${NT}" ${TR}ms simult"
echo "Converting -${temporal} $target"

to3d -prefix $1 \
-in:1\
-skip_outliers \
-2swap \
-xFOV ${XFOV}I-S\
-yFOV ${XFOV}R-L\
-zFOV ${ZFOV}P-A\
-$temporal \
$target
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