[VoxBo] problem with vb2cub command

Lila Chrysikou evangelg at psych.upenn.edu
Wed Sep 9 16:46:16 EDT 2009


Hello,

I have been experiencing a problem with a pre-processing script that I have
used successfully dozens of times in the past.
I am pasting the script below for your reference with highlighted the lines
I think cause the problem.

Early on, I get a bad job associated with the following log message:

[I] vb2cub: converting Anatomy/Anatomical_BET.img to
Anatomy/Anatomical_BET.cub
[E] vb2cub: couldn't make a valid cube out of Anatomy/Anatomical_BET.img

I have tried my script with several different subjects with the same result.

Is there a way to fix this problem? Has the vb2cub command been replaced by
vbconv? Have any directories changed?
Again, this script has been used several times in the past without problems.

Any advice would be greatly appreciated.

Thanks in advance,

~Lila


*Script*

SEQUENCENAME RawPrep_GenS01_022207
DIR /xjet/lila/generation/GenS01_022207/

EMAIL evangelg at psych.upenn.edu

PRIORITY 2

globals FirstLoc=0001_localizer
globals MPRAGE1=0002_t1_mpr_AX_MPRAGE
globals RawEPI=0003_ep2d_pace
globals RealignScan=0004_ep2d_pace_180
globals RealignImage=0

FILE scan=GenS01_022207_01 raw=0004_ep2d_pace_180
FILE scan=GenS01_022207_02 raw=0005_ep2d_pace_180
FILE scan=GenS01_022207_03 raw=0006_ep2d_pace_180
FILE scan=GenS01_022207_04 raw=0007_ep2d_pace_212
FILE scan=GenS01_022207_05 raw=0008_ep2d_pace_212
FILE scan=GenS01_022207_06 raw=0009_ep2d_pace_212


#######
# Settings
########

LOGGING 2
globals thresh=200
globals xa=1
globals ya=1
globals za=1
globals xf=3
globals yf=3
globals zf=3

globals refvol=/usr/local/spm2/templates/T1.mnc
globals paramfile=params.mat
globals anat=Anatomical.cub
globals func=Functional.cub

globals "bb_anat=[-79,-112,-51;79,76,86]"
globals "bb_func=[-78,-111,-50;78,75,85]"
globals "bb_disp=[-79,-112,-50;79,76,85]"


#######
# Reset any previous analysis
#######

#runonce shellcommand "mv -f */raw/* ./"
#runonce shellcommand "mv -f unused_moco/* ./"
#runonce shellcommand "mv -f Models old_Models"
#runonce shellcommand "rm -rf Models"
#runonce shellcommand "rm -rf unused_moco"
#runonce shellcommand "rm -rf Anatomy"
#runonce shellcommand "rm -rf *_0*"

#######
# Prep anatomy
########

#runonce shellcommand "mkdir -p unused_moco"
#runonce shellcommand "mv -f *_MoCoS* unused_moco/"
runonce shellcommand "mkdir -p Anatomy"
runonce shellcommand "mkdir -p Anatomy/raw"
runonce shellcommand "mkdir -p Models"
runonce shellcommand "tes2cub $RealignScan Anatomy/Functional.cub
$RealignImage"
runonce shellcommand "vb2cub $MPRAGE1 Anatomy/Anatomical.cub"
runonce shellcommand "mv $MPRAGE1 Anatomy/raw/"
runonce shellcommand "mv $FirstLoc Anatomy/raw/"
runonce shellcommand "mv $RawEPI Anatomy/raw/"

#####
# Align origins of functional and anatomical data
#####

runonce shellcommand "setorigin -m Anatomy/Anatomical.cub
Anatomy/Functional.cub"
runonce shellcommand "setorigin -m Anatomy/Functional.cub
Anatomy/Anatomical.cub"

#####
# Make a temporary "Display" BET Anatomical image to use for FLIRT
co-registration
####

runonce shellcommand "cp Anatomy/Anatomical.cub Anatomy/OrigAnatomical.cub"
runonce shellcommand "vb2img Anatomy/Anatomical.cub
Anatomy/Anatomical.img[small]"
runonce shellcommand "/usr/local/fsl/bin/bet Anatomy/Anatomical
Anatomy/Anatomical_BET -f 0.5 -g 0 -o -m"
runonce shellcommand "cp Anatomy/Anatomical.hdr Anatomy/Anatomical_BET.hdr"
runonce shellcommand "vb2cub Anatomy/Anatomical_BET.img
Anatomy/Anatomical_BET.cub"
runonce shellcommand "vbhdr -c Anatomy/OrigAnatomical.cub
Anatomy/Anatomical_BET.cub"
runonce shellcommand "resample Anatomy/Anatomical_BET.cub
Anatomy/Display_BET.cub -ra Anatomy/Functional.cub"

#####
# Use FSL FLIRT to co-register EPI images to MPRAGE image
#  Petya gets credit for forcing Geoff to do this.
#####

runonce shellcommand "vb2img Anatomy/Display_BET.cub
Anatomy/Display_BET.img"
runonce shellcommand "mv Anatomy/Functional.cub Anatomy/OrigFunctional.cub"
runonce shellcommand "vb2img Anatomy/OrigFunctional.cub
Anatomy/Functional.img"
runonce shellcommand "/usr/local/fsl/bin/flirt -in Anatomy/Functional.hdr
-ref Anatomy/Display_BET -out Anatomy/Functional.hdr -omat
Anatomy/Functional_Coregister.mat -bins 256 -cost corratio -searchrx -90 90
-searchry -90 90 -searchrz -90 90 -dof 12 -interp trilinear"
runonce shellcommand "vb2cub Anatomy/Functional.img Anatomy/Functional.cub"
runonce shellcommand "resample Anatomy/Functional.cub Anatomy/Functional.cub
-xx 0 4 64 -yy 0 4 64"
runonce shellcommand "vbhdr -c Anatomy/OrigFunctional.cub
Anatomy/Functional.cub"

#####
# Remove some temporary files
#####

runonce shellcommand "rm Anatomy/Functional.img"
runonce shellcommand "rm Anatomy/Functional.hdr"
runonce shellcommand "rm Anatomy/Functional_Coregister.mat"
runonce shellcommand "rm Anatomy/Anatomical_BET.cub"
runonce shellcommand "rm Anatomy/Anatomical_BET.img"
runonce shellcommand "rm Anatomy/Anatomical_BET.hdr"
runonce shellcommand "rm Anatomy/Anatomical_BET_overlay.img"
runonce shellcommand "rm Anatomy/Anatomical_BET_overlay.hdr"
runonce shellcommand "rm Anatomy/Anatomical_BET_mask.img"
runonce shellcommand "rm Anatomy/Anatomical_BET_mask.hdr"
runonce shellcommand "rm Anatomy/Display_BET.cub"
runonce shellcommand "rm Anatomy/Display_BET.img"
runonce shellcommand "rm Anatomy/Display_BET.hdr"

####
# Clean up the anatomical image with FSL tools
###

runonce shellcommand "cp Anatomy/Anatomical.cub Anatomy/OrigAnatomical.cub"
runonce shellcommand "vb2img Anatomy/Anatomical.cub
Anatomy/Anatomical.img[small]"
runonce shellcommand "cp Anatomy/Anatomical.hdr
Anatomy/Backup_Anatomical.hdr"
runonce shellcommand "/usr/local/fsl/bin/susan_smooth Anatomy/Anatomical
37.7 Anatomy/Anatomical 2 3D 1 0"
runonce shellcommand "/usr/local/fsl/bin/bet Anatomy/Anatomical
Anatomy/Anatomical_BET -f 0.5 -g 0 -o -m"
runonce shellcommand "merge3d Anatomy/Anatomical.img
Anatomy/Anatomical_BET_mask.img -o Anatomy/Anatomical_BET.img -m"
runonce shellcommand "/usr/local/fsl/bin/fast -t1 -c 3 -or -ob -od
Anatomy/Anatomical_BET_FAST Anatomy/Anatomical_BET"
runonce shellcommand "merge3d Anatomy/Anatomical.img
Anatomy/Anatomical_BET_FAST_bias.img -o Anatomy/Anatomical.img -m"
#runonce shellcommand "rm Anatomy/Anatomical_BET_FAST_restore.hdr"
#runonce shellcommand "rm Anatomy/Anatomical_BET_FAST_restore.img"
runonce shellcommand "rm Anatomy/Anatomical_BET_overlay.hdr"
runonce shellcommand "rm Anatomy/Anatomical_BET_overlay.img"
runonce shellcommand "rm Anatomy/Anatomical_BET.hdr"
runonce shellcommand "rm Anatomy/Anatomical_BET.img"
runonce shellcommand "rm Anatomy/Anatomical_BET_mask.hdr"
runonce shellcommand "rm Anatomy/Anatomical_BET_mask.img"
#runonce shellcommand "mv Anatomy/Anatomical_BET_FAST_bias.img
Anatomy/Anatomical_bias.img"
#runonce shellcommand "mv Anatomy/Anatomical_BET_FAST_bias.hdr
Anatomy/Anatomical_bias.hdr"
#runonce shellcommand "mv Anatomy/Anatomical_BET_FAST_seg.hdr
Anatomy/Anatomical_seg.hdr"
#runonce shellcommand "mv Anatomy/Anatomical_BET_FAST_seg.img
Anatomy/Anatomical_seg.img"
runonce shellcommand "/usr/local/fsl/bin/bet Anatomy/Anatomical
Anatomy/Anatomical_BET -f 0.5 -g 0"
runonce shellcommand "cp Anatomy/Backup_Anatomical.hdr
Anatomy/Anatomical_BET.hdr"
runonce shellcommand "cp Anatomy/Backup_Anatomical.hdr
Anatomy/Anatomical.hdr"
runonce shellcommand "vb2cub Anatomy/Anatomical.img Anatomy/Anatomical.cub"
runonce shellcommand "vbhdr -c Anatomy/OrigAnatomical.cub
Anatomy/Anatomical.cub"
runonce shellcommand "vb2cub Anatomy/Anatomical_BET.img
Anatomy/Anatomical_BET.cub
runonce shellcommand "vbhdr -c Anatomy/OrigAnatomical.cub
Anatomy/Anatomical_BET.cub
runonce shellcommand "rm Anatomy/Anatomical.img"
runonce shellcommand "rm Anatomy/Anatomical.hdr"
runonce shellcommand "rm Anatomy/Anatomical_BET.img"
runonce shellcommand "rm Anatomy/Anatomical_BET.hdr"

#####
# Create the "Display" volumes
#####

runonce shellcommand "resample Anatomy/Anatomical.cub Anatomy/Display.cub
-ra Anatomy/Functional.cub"
runonce shellcommand "resample Anatomy/Anatomical_BET.cub
Anatomy/Display_BET.cub -ra Anatomy/Functional.cub"

####
# Insert an intentionally bad job to stop the process
####

#runonce shellcommand "bad job"

####
#
# At the command line, need to copy the Origin settings from the
OrigFunctional.cub to Functional.cub:
#
# Then re-start the process using vq -u
#
####

#####
# Perform normalization of anatomicals
#####

runonce spm2_norm_calc $DIR/Anatomy/ $paramfile Anatomical.cub $refvol $xa
$ya $za $bb_anat
runonce spm2_norm_apply3d $DIR/Anatomy $DIR/Anatomy/$paramfile $anat
nAnatomical.cub $xa $ya $za $bb_anat
runonce spm2_norm_apply3d $DIR/Anatomy $DIR/Anatomy/$paramfile $func
nFunctional.cub $xf $yf $zf $bb_func
runonce spm2_norm_apply3d $DIR/Anatomy $DIR/Anatomy/$paramfile $anat
nDisplay.cub $xa $ya $zf $bb_disp


#####
# Create a BrainVoyager compatible version of the anatomical image
#####

#runonce shellcommand "vb2img Anatomy/nAnatomical.cub
Anatomy/nAnatomical.img[small]"
#runonce shellcommand "resample Anatomy/nAnatomical.img
Anatomy/Anat_ISO_SAG_TAL.img[small] -xx -49 1 256 -yy -16 1 256 -zz -77 1
256"
#runonce shellcommand "vborient Anatomy/Anat_ISO_SAG_TAL.img
Anatomy/Anat_ISO_SAG_TAL.img[small] ASR -from RPI"


######################
# make the data directory and raw subdirectory
# make the tes file from the raw
# mv the raw Siemens data to the raw subdirectory
######################

shellcommand "mkdir $scan"
shellcommand "mkdir $scan/raw"
shellcommand "vb2tes $raw $scan/$scan.tes"
shellcommand "mv $raw $scan/raw/"

######################
# process the tes file
######################

shellcommand "sliceacq -i $scan/$scan.tes -o $scan/$scan.tes -n"
realign $scan/$scan.tes $scan/$scan.tes 0.5 Anatomy/Functional.cub
shellcommand "setorigin -c Anatomy/Functional.cub $scan/$scan.tes
spm2_norm_apply4d $DIR/$scan $DIR/Anatomy/$paramfile $scan.tes $scan.tes $xf
$yf $zf $bb_func
shellcommand "vbsmooth -vox 3 3 3 -o $scan/$scan.tes $scan/$scan.tes
threshold $scan/$scan.tes $scan/$scan.tes $thresh
calcgs $scan/$scan.tes
calcps $scan/$scan.tes

runonce shellcommand "vbfit 3000 180 *01/*01_PS.ref *02/*02_PS.ref
*03/*03_PS.ref -o Models/OneOverFParams.ref"
runonce shellcommand "vbfit 3000 212 *04/*04_PS.ref *05/*05_PS.ref
*06/*06_PS.ref -o Models/OneOverFParams.ref"



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Evangelia G. Chrysikou, Ph.D.
Post Doctoral Research Fellow
Thompson-Schill Lab

Center for Cognitive Neuroscience
University of Pennsylvania
Office address: 3810 Walnut St.,Room 307, Philadelphia, PA 19104
215. 573.6726  (phone)
215. 898.1982  (fax)
E-mail: evangelg at psych.upenn.edu
http://www.psych.upenn.edu/~evangelg/Home.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.voxbo.org/pipermail/voxbo-general/attachments/20090909/cc7428f5/attachment.html 


More information about the voxbo-general mailing list