Inline processing of magnetic resonance images allows fast feedback of analysis and immediate access to quantitative information. It further allows the development of adaptive MRI protocols. Here, we present GRAPE, a development platform for graphical programming to facilitate the development of adaptive magnetic resonance imaging (MRI) protocols. This platform provides tools to enable graphical creation, execution, and debugging of image analysis algorithms integrated with the MRI scanner, all within a graphical environment. GRAPE is demonstrated with the implementation of patient-specific optimization of the scan parameters of 3D fluid-attenuated inversion recovery (FLAIR) protocol to enhance the contrast of brain lesions in multiple sclerosis, performed on a 3.0 Tesla MRI scanner.
The GRAPE Framework: GRAPE is implemented using the Qt C++ application development framework. GRAPE (Fig. 1) provides an interactive interface that allows the user to create and edit various modules in the analysis pipeline, and to control the data flow. Basic libraries are included in GRAPE for reading, processing of images, and saving output data. Image display modules can display 2D, 3D, or 4D images that allow the user to review intermediate results, particularly useful during initial development. Logical operations, list selection, branching, and looping tools are provided as ready-to-use modules. The image processing library includes various modules for image arithmetic, slicing, statistics, and comparison. GRAPE incorporates widely-used tools such as brain extraction, bias correction, image registration and segmentation. These modules can be used directly by users without any need for programming. External user programs and image analysis functionalities in third party applications can be accessed through command line interface module, providing flexibility and eliminating need for re-programming, allowing quick prototyping of new pipelines. Commonly used image formats such as DICOM, Analyze, and NIFTI are supported. Users can implement new modules by coding the functional components of the module: input assignment, output assignment, validation, and execution. Once a pipeline is created, the user can initiate and stop the execution of the pipeline through the graphical interface or from command line. During execution, color cues indicating the current progress of the pipeline are shown for each module. GRAPE was successfully built under Windows, Linux, and Mac environments, and was run on both standalone computers as well as on the Stampede Linux cluster (Texas Advanced Computing Center, https://www.tacc.utexas.edu/stampede).
Scanner Integration: GRAPE was integrated with a 3.0 T Philips Ingenia MRI scanner (Philips, Best, The Netherlands). A special tool provides interface to the scanner database for automated image extraction immediately after data acquisition. and for data transfer to the GRAPE analysis environment. Input files are handled by a Source module. Encountering an End signal in GRAPE triggers automatic transfer of the pipeline outputs back to the scanner, including image data or scan parameter files. The images are then automatically imported back into the scanner database, and become available for review on the scanner or via transfer to PACS. The whole process of data export, transfer, GRAPE processing, and importing results is fully automated and performed in real time.
1. Cox RW. AFNI: software for analysis and visualization of functional magnetic resonance neuroimages. Comput Biomed Res. 1996;29:162–173.
2. Friston KJ, Holmes a. P, Worsley KJ, Poline J-P, Frith CD, Frackowiak RSJ. Statistical parametric maps in functional imaging: A general linear approach. Hum Brain Mapp. 1995;2:189–210.
3. Ibanez L, Schroeder W, Ng L, Cates J. The ITK Software Guide [Internet]. http://www.itk.org/ItkSoftwareGuide.pdf; 2005. Available from: http://www.itk.org/ItkSoftwareGuide.pdf
4. Rex DE, Ma JQ, Toga AW. The LONI Pipeline Processing Environment. Neuroimage. 2003;19:1033–1048.
5. Zwart NR, Pipe JG. Graphical programming interface: A development environment for MRI methods. Magn Reson Med. 2014;74:1449–1460.