Trying to visualize pycortex using Windows and no-graphics linux

Summary of what happened:

  1. What I am doing: I am trying to customize the output of pycortex (or other) to obtain a different flat view of the brain. I would like to distribute the different lobes (frontal - parietal - etc) into separate areas, to make the graphic more readable and recognizable for lay persons. Any advice about this would be most welcome!
  2. Where I am stuck: I finally succeeded in installing pycortex on a Linux machine. (the trick was to create a virtual environment: I was having permission issues). I then launched the suggested demo
    $ ipython
    In [1]: import cortex
    In [2]: cortex.webshow(cortex.Volume.random(“S1”, “fullhead”))
    I get a response:
    Started server on port 50029
    That looks OK…
    But I don’t have graphics on the linux machine…
    I tried accessing the port from my Windows browser via http:my.IP.address:50029 , but I get a timeout.

Questions:

  1. What is the best way to view pycortex output in such a situation?
  2. Is there a way of generating images using a line command, that I can view on Windows?

Command used (and if a helper script was used, a link to the helper script or the command generated):

ipython
In [1]: import cortex
In [2]: cortex.webshow(cortex.Volume.random("S1", "fullhead"))

Version:

Environment (Docker, Singularity / Apptainer, custom installation):

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

PASTE LOG OUTPUT HERE

Screenshots / relevant information:


Hi @francis_vila,

If possible, you can try setting up port forwarding between your local and virtual machine.

This is how I do it on my Mac / zsh to connect to my Linux cluster, in this case running jupyter lab, but should be useful for other softwares. The following line (modified slightly for generalizability) goes into my .zprofile:

jlab() {open -a "Google Chrome" http://localhost:${port_local}; ssh -Y -C -L ${port_local}:${port_virtual} smeisler@CLUSTERADDRESS}

Where port_local is the port on my machine (e.g., that you open in your web browse), and port_virtual is the port to be accessed on your virtual machine. Then when I run jlab in my shell, it SSHs into the virtual machine while forwarding the port, and opens up my web browser to that port.

I do not not know much about the Windows powershell script so I am hoping you have something like Cygwin or WSL to give you more of a Unix-based environment on Windows.

Best,
Steven