Viewing images stored on a remote server from my local machine


#1

Hello,
I have some NIftI images stored on the lab’s processing server and I’d like to be able to view them on my local machine (I’m aware of the issues with X11 forwarding). https://mrtrix.readthedocs.io/en/latest/troubleshooting/display_issues.html#remote-display proposes to “access the remote data using a network filesystem, such as SSHFS, SMB or NFS, and run mrview locally, loading the data from the network share.” However, I’m not sure what this means in terms of what exactly I need to type in the terminal to make this happen. Could someone tell me?
Thanks,
Philip


#2

This will depends on what your local system is running, and how you can access the data on the remote system. If the data can be accessed on your local system via a Windows share (SMB), then you can just run a local version of mrview and load the data from that network drive.

If you’re on a Linux system and you can access the data via SSH, then you can use SSHFS with a command like this:

# create a folder locally that will be used as the mount point for your remote folder:
mkdir remote 
# mount the remote folder and make it accessible locally (edit as appropriate):
sshfs user@server:. remote/

# you can now access the data as if they were local, e.g.:
mrview remote/data/image.mif

# if you need to un-mount the remote folder:
fusermount -u remote/

See e.g. this link for more details on SSHFS. You may need to install the sshfs package first – but that will depend on exactly what flavour of Linux you’re running.

You can use SSHFS on macOS too, but you’ll need to install a few packages first (no experience with that myself though).

If you can access the data via the Unix Network FileSystem (NFS), then you can already view the data anyway. Setting up NFS is a bit more fiddly and requires admin privileges, so unless that’s already set up for you, I recommend you don’t even try – use SSHFS instead.


#3

Worked perfectly, thanks so much!


#4

A word of caution: sshfs uses caching so updates on the server might take same time to propagate to the client. Relevant options are

       -o cache=BOOL
              enable caching {yes,no} (default: yes)

       -o cache_timeout=N
              sets timeout for caches in seconds (default: 20)

       -o cache_X_timeout=N
              sets timeout for {stat,dir,link} cache

Setting timeout to very small values can result in dropped connections depending on your network.