How send raw k-space data to any given server with Twix or with a modified ICE-chain

In this blog-post I want to describe a setup, how you can include an additional ICE functor in your reconstruction pipeline that sends raw Twix files from the Reconstruction computer to any given custom server. 

Introduction

In multiple previous blog posts, I described how multiple reconstruction parameters can substantially affect the resulting image quality. Examples were, changes in the coil-combination algorithms, various GRAPPA kernel fit algorithms, different partial Fourier algorithms, etc. With so much flexibility of the reconstruction pipeline, it would be nice to store the acquired raw data on a long term basis, just in case you want to reconstruct the data later in a different way. Since the raw data on the reconstruction computer (MRIR) are usually overwritten within a few days, it would be nice to have a way to export the raw data to a custom server for long term storage and load them back to the MRIR, if needed later.

Here I want to describe two ways of getting the raw data off the scanner and store them at any other computer in the network. 1.) A slow export/import via Twix interface (path a) and 2.) Fast export with custom ICE program (path b).

Scanner_connection-01.png
Schematic of the different ways how to transfer raw data from and to the MRIR. The host controls the scanner, the host has the Twix interface, and the host contains all the reconstruction programs and ICE configurations. The MRIR contains all the recently acquired (1-2 days old) Twix files and executes the reconstruction. The server can act as a long-term data dump.

Path a) Slow and easy import/export of raw data via Twix interface.

The slow and easy way (path a) is controlled from the scanner host. You can export raw data as follows.

First start Twix: control+ESC -> run

Screenshot 2018-01-08 17.20.40

In the Twix interface, select the run that you want to export in the right window with the right mouse click and save it an any location of interest (preferably on a mounted drive and not the host itself).

twix_send.png

Old data can be loaded back in again for retrospective reconstruction in the File menu.

twix_send_2.png

Path b) Fast export of raw data with modified ICE-functor chain

Exporting raw data with path b) can be orders of magnitudes faster, however, it it quite involved and comes a long with many a few disadvantages. E.g. you need to go through few rather steps that require some expertise:

1) sequence compilation,
2) manipulation of the ICE-chain,
3) mounting hard drive on server in a specific way,
4) starting the data catcher at the server,
5) manually changing back the IceProgram in the Twix files.

Thus, I believe this this way of sending data might be more suited for studies where the time is more limited for sending of large data than for the setup and testing that everything works.

Setup on host

In order to tell the MRIR to send raw data directly to server in the network, you can use the ICE-Functor IceNIH_RawSend from Jacco deZwart. The binaries of this IceProgram can be downloaded from the IDEA Discussion board. You can incorporate this functor into your ICE chain by including the following changes in your IceProgram.

In case you want to make the Sequence flexible enough that you can choose whether or not to send raw data from the special card, you can have multiple IcePrograms and choose which one to use by executing the following line in the sequence code:

Screenshot 2018-08-16 11.59.03.png
Command to change the IceProgram in the sequence code. (Not to be confused with the IceConfigurator)

Also make sure that the compiled Ice program IceNIH_RawSend is properly installed. The binaries should be stored in MedCom/bin and the libraries should be stored in MedCom/MCIR/Med/lib.

It is to note that when you load that twix file back to the MRIR via twix (path a), it will not reconstruct and it will not sent another copy to the server. Hence, for the retrospective reconstruction, the used IceProgram needs to be changed. E.g. giving the path and filename of the original IceProgram without the data sender.

twix.png
The ice program can be changed in YAPS/tICEProgramName

Setup on custom server

On the server, you can mount the hard drive. E.g. using Vinai’s mounter script that does not require root privileges.

userMount 1 ssd1 /data0/raw/yourfolder

-> “1” for mount and “-1” for unmount
-> name of the device (It only works for Exfat drives)
-> path to folder to be mounted it (it must be mounted in an empty folder)

Then you can start the listener with the Python program that can also be downloaded from the IDEA discussion board.

dataCatcher.py

Note that the Sequence on the host will only run, when the listener (custom server) is online and ready to receive data.

When you are done, you can top the listener with control + c and unmount the drive with

userMount -1 ssd1 /data0/raw/yourfolder

Acknowledgements

I want to thank Vinai for spending the last weeks in figuring out how this works and in  streamlining the pipeline. I want to thank Jacco for writing the ICE-functor in the first place.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s