Showing posts with label MRI. Show all posts
Showing posts with label MRI. Show all posts

Using SSH with X11 Forwarding for Remote Image Display

I personally really enjoy working with the command line and using SSH. It's fast, powerful, and great for development. However, since our research involves medical images, being able to display images remotely is an important (and frequent) task.

When i first tried setting this up on my Windows PC, it didn't work out of the box. After some troubleshooting under the help of ChatGPT, i figured it out — so here are a few tips that might help you too!

1. SSH with X11 Forwarding

When connecting to your remote server, use the -X (or -Y) flag to enable X11 forwarding:

ssh -X user@remote-host

check that the DISPLAY variable is set after login:

echo $DISPLAY 

You should see something like localhost:10.0

2. Install X11 libraries on the remote machine

On the remote host, make sure the necessary X11 packages are installed:

sudo apt uodate

sudo apt install x11-apps python3-tk

To test if it's working, run:

xeyes

if the eyeballs show up, X11 is working! 

3. Local machine must have X11 server (macOS or Windows)

macOS

Install XQuartz 

After install, run XQuartz and reconnect using:

ssh -Y/-X user@remote-host

Windows 

If you're on a Windows system, you'll need to install an X11 server like:

Here's how you set up VcXsrv:

  • Download and install VcXsrv
  • Run "XLaunch" 
  • Select:
    • Multiple windows
    • Start with "Start no client"
    • Enable "Disable access control" (or configure access if needed)
    • Finish and leave it running in the background

Now, to connect:

  • Use MobaXterm or PuTTY with X11 forwarding enabled
  • Important: Windows CMD and PowerShell donot support X11 forwarding directly. You'll need to use WSL or an SSH client that supports X11.

How T1 changes with magnetic field stength?

[Reference source]

Conclusion: T1 increases and T2  doesn't change very much as B0 increases.

Benefits of long T1 

  • ASL: 

 

 

What is CPMG condition?


The CPMG (Carr-Purcell-Meiboom-Gill) condition is frequently mentioned in spin-echo-related research papers, yet it's rarely explained in detail.

First off,  Carr, Purcell, Meiboom, and Gill are the researchers who contributed to this technique. According to MRI Questions:

In the early SE (spin echo) experiments by Hahn (1850) and Carr and Purcell (1954) , RF pulses were all applied along the same axis (usually x-direction). In practice, this method resulted in measured T2 values that were too short because of (1) cumulative phase errors from repetitive imperfect 180 pulses, and (2) B1 inhomogeneity effects that spread the magnetization out in a plane containing B1 and B0. In 1958 Meiboom and Gill proposed that such pulse-related errors could be reduced if the 180 pulses in a SE train were phase shifted 90 with respect to the initial 90 pulse. In other words, if the 90 pulse were applied along the x-axis, the 180 pulses would be applied alternately along the +-y-axes. This technique, subsequently known by the acronym CPMG...

 

This raises an important question: why does applying both the 90 and 180 RF pulses along the same axis lead to underestimated T2 values?

 


 

The above figure which came from the original paper by Meiboom and Gill, described the behavior of the nuclear polarization without 90 shift of the first 90 pulse. Therefore, we can conclude that:

  • the polarization vector at the time of the echos is alternatively in the +y and -y directions.
  • If the 180 pulses deviate from the true 180 amplitude, the corresponding error is cumulative, and successive pulses will rotate the polarization vectors more and more out of the xy plane.  

The modification: