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  

|
May 17, 2019 05:26AM
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)
Subject Author Posted

wrong behavior of DriveSuma Attachments

Liu Mengxing May 17, 2019 05:26AM

Re: wrong behavior of DriveSuma

Daniel Glen May 17, 2019 12:24PM

Re: wrong behavior of DriveSuma

Liu Mengxing May 18, 2019 04:31PM

Re: wrong behavior of DriveSuma

Daniel Glen May 19, 2019 10:50PM

Re: wrong behavior of DriveSuma

Liu Mengxing May 20, 2019 04:06AM

Re: wrong behavior of DriveSuma

Daniel Glen May 20, 2019 11:51AM

Re: wrong behavior of DriveSuma

Liu Mengxing May 20, 2019 04:54PM

Re: wrong behavior of DriveSuma

Daniel Glen May 21, 2019 04:49PM

Re: wrong behavior of DriveSuma

Liu Mengxing May 23, 2019 05:34AM