"r" to capture images doesn't work

Hi,

Somehow the shortcut for capturing single image, “r”, doesn’t work in SUMA. Other keys such as shift+r for recording works fine, but when I press “r”, it just changes “oversampling” to 2 → 3 → 4 → 1 → 2… and so on (see the attached screenshot). Any idea why it’s happening? I’m running AFNI & SUMA on Linux.

Thanks,
Soo Hyun

Screen Shot 2020-07-10 at 2.30.16 PM.png

Hi, Soo Hyun-

You should use “shift+r” to record videos, and “ctrl+r” to record images (JPGs, for example). Does that work for you?

–pt

“ctrl+r” also changes the oversampling in the same way as “r”.

Is the “numlock” key on, by any chance?

–pt

I don’t think so- I’m using Linux workstation via virtual machine from Mac OS using Mac keyboard, but the number keys in “number pad” in my keyboards presses as “numbers”, so I don’t think the numlock is on.

Hmmm, I wonder if this is an issue of Mac doing things differently than LInux and effectively passing along the wrong information (sometimes on Macs, keypresses work differently, oddly enough).

From a previous post having this issue:
https://afni.nimh.nih.gov/afni/community/board/read.php?1,151797,151797
…updating the binaries helped (that person didn’t report the original AFNI version, unfortunately). What version of AFNI do you have?

This person resolved a similar issue:
https://afni.nimh.nih.gov/afni/community/board/read.php?1,163932,163936#msg-163936
… by using “shift+r” to start recording a video, but just making the video be 1 frame, and saving it as an image… I hope there is a better solution, but I am not sure.

–pt

The AFNI version I have is AFNI_20.1.10 ‘Otho’ (linux_openmp_64: May 26 2020). I also found we don’t have Netpbm installed, but I don’t think it should matter…

Screen Shot 2020-07-10 at 2.08.45 PM.png

I was wondering if we could test this further to see where the issue comes up by trying to drive SUMA with command line input, rather than by keypresses filtered through the Mac interface.

This script will:

  • find an open port
  • open suma with that port referenced (with a random image)
  • have @DriveSuma pass a command to that suma run, and have it snap an image.
    So, copy+paste this into a text file called “do_test_suma.tcsh”:

#!/bin/tcsh

set portnum = `afni -available_npb_quiet`

suma                       \
    -npb ${portnum}     &

DriveSuma                                              \
    -npb ${portnum}                                    \
    -com viewer_cont -key 'Ctrl+left'                  \
    -com viewer_cont -key 'Ctrl+r'

… and then on the command line type “tcsh do_test_suma.tcsh”, and see if a directory called SUMA_Recordings/ gets made, and populated with an image.

–pt

Well, I just sent another command to try driving SUMA to see if that works.

But you should definitely run


afni_system_check.py -check_all

on that system and make sure it is set up properly!

–pt

It worked: “SUMA_Recordings” directory was created with one image inside.

OK, so I think the initial issue is that Mac is doing something funny to your keypress before passing it along.

How to fix that… I am not quite sure. I don’t think the issue is Mac having a keyboard shortcut for “ctrl+r”, because then I would think something totally different would happen. Might be worth checking, though.

Using driver scripts can be great. This tutorial case provides some nice examples of features to control with scripts:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/tutorials/rois_corr_vis/cat_netcorr.html#drive-suma-to-save-snapshots-of-the-surface-view-along-some-major-planes

If you really want to use keypresses in vivo, but Mac is causing problems (typical…), you could try to open up the image and just use your computer’s screengrab capabilities. On Mac, it is something like shift+command+{1,2,3,4}, I think? In truth, that is a bit close to what SUMA does anyways-- it captures at screen resolution, so making the image “big” effectively makes it higher resolution in the end (because whenever you publish/use it, it will be shrunk+condensed, becoming higher DPI).

–pt

Okay, thank you for your prompt help. I’ll try driver scripts. It’s kind of interesting that both “r” and “Ctrl+r” behave as if “Alt+r”, i.e. increasing image oversampling factor. I’ll check whether anything I should change from the Linux machine side too. Anyway, thanks for your help again!

Best,
Soo Hyun

Hmm, that is true.

What does “apple+ctrl+r” do, just by chance? (where “apple” is the command key on macs?)

–pt

“apple+ctrl+r” also increases the oversampling factor. I also tried “ctrl+shift+r”, which actually turned on/off the disk recording of image, as if it’s normal “ctrl+r”. So in my terminal:

“r” = “alt+r” = “ctrl+r” = “apple+ctrl+r”: changes the oversampling factor, like normal “alt+r”
“ctrl+shift+r”: record the current image directly to the disk (./SUMA_Recordings), like normal “ctrl+r”
“shift+r” (=“R”): toggle continuous recording, like normal “shift+r”

Strange. At least it doesn’t look like AFNI/SUMA problem, but more like setting in my terminal or virtual machine… Anyway, thanks a lot for your help with troubleshooting this issue!

The ‘r’ not working is very strange. Check keyboard shortcuts under preferences and the keyboard language layout.