Print

Print


Hi Kaori,

In your code, you are referring to overlaylist[1] - as python indices start from 0, does it work if you change this to overlayList[0] ?

There is no direct command to save a screenshot from the python shell, although it is a good idea, so I will look at adding it in.

In the meantime, if you can get a reference to the SliceCanvas object(s), you can call its getBitmap method to get an in-memory bitmap that you can then save out to file. However, if you want to save an image of multiple canvases (e.g. the ortho view), you would need to generate the bitmap for each canvas, and manually arrange them.

Cheers,

Paul

On 29 July 2017 at 03:35, Kaori Ito <[log in to unmask]> wrote:
My apologies! Looks like the first part of my message didn't get posted. Here it is:

Hi all,

I would ideally like to use fsleyes to render the same type of images for a large number of subjects. I am able to recursively call fsleyes -render , but I would prefer to run a python script in the python shell within the program, rather than call the program again and again. I am using the standalone fsleyes version on a mac.

First, is there a command I can call on the python shell to render images? (equivalent of fsleyes -render)

Additionally, when I load an image and attempt to access overlayList within my script, I get the error: "list index out of range" - as if it hasn't been set (see below for full output). But, when I load the image from the script and then open up the python shell from fsleyes and type in overlayList, my image is loaded and overlayList is accessible. Can someone explain why this might be happening?

Thank you in advance- any pointers would be helpful!