Hi afni group:
I have a DriveSuma script that runs afni and suma, has them talking and save images. It works perfectly on one machine. While when I moved it to another machine, everything went well except the recording behavior. Basically I use
for pose in 'Ctrl+left' 'Ctrl+right'
do
# get view and snap
DriveSuma -com viewer_cont -key "$pose" -com viewer_cont -key 'Ctrl+r'
sleep 3 # give it a break to change the view and save the fig
done
to change the angle and record the image, but sometimes the recorded image was like the images that I attached (and sometimes It worked perfectly with nothing changed). What's weird is that this wrong behavior was not stable, some times it recorded at this weird angle, or another angle, or even black. I have assumed that maybe the record command is coming too soon after the changing angle command, I even split the two commands(changing angle and recording image) into two line and have a sleep between them, but still not working.
Here is the full commands.
Thanks!
Mengxing
#!/bin/bash
# set some environment variables
export AFNI_NOSPLASH=YES
export AFNI_SPLASH_MELT=NO
export AFNI_ENVIRON_WARNINGS=NO
export AFNI_PBAR_FULLRANGE=NO
export SUMA_DriveSumaMaxCloseWait=20
export SUMA_DriveSumaMaxWait=10
portnum=`afni -available_npb_quiet`
epi=Cj_Ch_IPL_005_PS.nii
suma=./suma_MNI152_2009
anat=MNI152_2009_SurfVol.nii
epi=Cj_Ch_IPL_005_PS.nii
suma=./suma_MNI152_2009
anat=MNI152_2009_SurfVol.nii
# name for output image file
jnam=CH_IPL
# drive AFNI to get the images we want
afni -yesplugouts -niml $suma/$anat ./cj/* &
plugout_drive \
-com "OPEN_WINDOW sagittalimage opacity=6" \
-com "OPEN_WINDOW axialimage opacity=6" \
-com "OPEN_WINDOW coronalimage opacity=6" \
-com "SEE_OVERLAY +" \
-com "SWITCH_UNDERLAY $anat" \
-com "SWITCH_OVERLAY $epi" \
-com "SET_PBAR_ALL +4 \
3.5=violet 2.5=green 1.5=cyan 0.5=none" \
-com "SET_FUNC_AUTORANGE -" \
-quit
suma -spec $suma/std.141.MNI152_2009_both.spec \
-sv $suma/$anat \
-niml &
# talk with afni
DriveSuma -com viewer_cont -key 't' -key:r2:d period
sleep 5 # talk needs some time, give it a break
# Remove crosshair and axes
# Change viewer size to 1200*1200 pixels
DriveSuma -com viewer_cont -key 'F3' -key 'F4' \
-key 'F5' -key 'F9' -viewer_size 1200 1200 \
-key:r2:d 'z' -key 'a'
sleep 5
for pose in 'Ctrl+left' 'Ctrl+right'
do
# get view and snap
DriveSuma -com viewer_cont -key "$pose" -com viewer_cont -key 'Ctrl+r'
sleep 3 # give it a break to change the view and save the fig
done
Edited 1 time(s). Last edit at 05/17/2019 05:27AM by Liu Mengxing.
Attachments:
open |
download -
autorecord.A.190517_111627.746.jpg
(23.2 KB)
open |
download -
autorecord.A.190517_112435.211.jpg
(150.1 KB)