Perelman School of Medicine at the University of Pennsylvania

Section for Biomedical Image Analysis (SBIA)

Peritumoral Heterogeneity Index (PHI) Estimator

The Peritumoral Heterogeneity Index (PHI) Estimator is a lightweight tool built towards the following goals:

  1. Perform quantitative pattern analysis of the spatial heterogeneity of peritumoral perfusion imaging dynamics, retrieved from Dynamic Susceptibility Contrast Magnetic Resonance Imaging (DSC-MRI) data.
  2. Evaluate the imaging biomarker of the Epidermal Growth Factor Receptor variant III (EGFRvIII) mutation status, in individual patients diagnosed with Glioblastoma.

NOTE: The PHI Estimator software incorporates 3rd party libraries and toolkits, potentially including but not limited to:
- Qt
All rights to these components are subject to the terms and licenses of their respective owners. All trademarks are the property of their respective owners.


System Requirements

Operating System: Linux, Windows
Memory Requirement (RAM): 4GB or more.

You can download the complete documentation (including the User's Manual) of PHI Estimator in PDF from here.

A software release will be made available soon, for research (non-commercial) purposes only, via a registration form.



The following steps describe the whole procedure to build and install the PHI Estimator (PHI-E).

1. Dependencies

Before building PHI-E, the following software libraries are required to be installed. Please note that to build in Windows, CMake needs to be used an appropriate compiler (Win32 or Win64 version of Visual Studio is recommended). The selected solution platform is needed to match with dependent libraries.

Package Version Description
C++ compiler   (MSVC/11.x, MSVC/12.x, GCC/4.8.1, GCC/4.9.2)
CMake 2.8.4 or higher To compile and build PHI-E and its dependencies
Qt 4.8.x The main GUI interface for PHI Estimaotr. Download and install the precompiled library. For Windows, consider visiting this page to download the precompiled library.
VTK 5.6.1 - 5.10.1 Install Qt before setting VTK up. Enable the VTK_USE_QT option
ITK 4.7 or higher Build VTK before proceeding to ITK. During CMake configuration, enable Module_ITKVtkGlue
Doxygen   For documentation only
2. Build & Installation

Please follow commands below in a shell/terminal (e.g., Bash). They will configure and build PHI-E using GNU Make. The main CMake configuration file (CMakeLists.txt) is located in the root directory of the package.

2.1 Extract source files and create the build directory
tar xzf PHIEstimator-${version}-source.tar.gz 
mkdir PHIEstimator-${version}-build 
cd PHIEstimator-${version}-build

[Note: In Windows, an appropriate compression program (e.g., 7-zip) might be used to extract the files.]

2.2 Run CMake to configure the build tree
cmake ../PHIEstimator-${version}-source

Use the CMake variable CMAKE_INSTALL_PREFIX to specify the installation directory, as in:

cmake -DCMAKE_INSTALL_PREFIX=/opt/software/geodesic ../PHIEstimator-${version}-source

For Windows, open CMake-GUI and select PHIEstimator-${version}-source as the "source" directory and select PHIEstimator-${version}-build as the "build" directory. Click on "Configure" and select the appropriate C++ compiler. If there weren't any configuration errors, click "Generate".

CMake should be able to find ITK, VTK and Qt libraries if they are specified in the $PATH variable in your environment. If you have custom installation directories, then ensure that they have been added to the $PATH variable or point the variables ITK_DIR, VTK_DIR and QT_QMAKE_EXECUTABLE to the appropriate paths (for ITK and VTK, point it to the directory where ITKConfig.cmake is present).

This step will generate a Make file for GCC and a Visual Studio solution file for MSVC.

2.3 Build

For Windows, you should launch the generated solution file of Visual Studio (by default, only Release version of the code will be compiled - if this needs to be changed, it can be done so by editing the variable CMAKE_CONFIGURATION_TYPE during the CMake configuration step), and then build solution.

2.4 Test (optional)

To perform tests, the BUILD_TESTING option in the CMake configuration needs to be enabled.

make test

For Windows, you should build the RUN_TESTS project.

In case of failing tests, re-run the tests, but this time by executing CTest directly with the '-V' option to enable verbose output and redirect the output to a text file, as in the example below:

ctest -V >& PHIEstimator-test.log

And send the file 'PHIEstimator-test.log' as attachment of the issue report to

2.5 Install (optional)
make install

For Windows, you should build the INSTALL project.

Upon the success of the above compilation and build process, PHIEstimator is installed into the directory specified by the CMAKE_INSTALL_PREFIX, which was set during step 2.2 above.



In order to showcase the usage of the PHI Estimator, we use an example to calculate the PHI for a given subject.

Firstly, we run the PHI Estimator and load either NIFTI or DICOM images using File -> Load -> MRI (NIFTI)/(or MRI (DICOM)) menu.

The PHI Estimator assumes that the input NIFTI images are already co-registered. In case of DICOM images, PHI Estimator co-registers all images before they are displayed.

PHI Estimator needs at least two images to start calculating the PHI index. These should be one contrast-enhanced T1-weighted (T1-CE) and one Dynamic Susceptibility Contrast (DSC) MRI images. The T1-CE image is displayed, whereas the DSC image is loaded in the background. Users can interact with the T1-CE modality to draw the required Near and Far regions of interest (ROIs). Users can also load a T2-weighted fluid-attenuated inversion recovery (T2-FLAIR) image to aid in the drawing process of the far ROI.

Figure 1: The 'Images' panel of PHI Estimator

Figure 1 (above), shows an example screenshot of the images panel (a) after loading three MRI images, i.e. T1-CE, T2-FLAIR and DSC image. T1-CE and T2-FLAIR images are displayed in the ‘visualization input images’ panel (b). The DSC image is displayed in the non-visualization input images’ panel (c), and it is stored on the backend for the calculation of the PHI index on the drawn regions. Both the panels show the list of the filenames of the loaded images and their image type, such as T1CE for T1-CE. Users can select which image is shown in the visualization windows (f), (g), and (h) by selecting an image from the panel (b). The visualization windows (f), (g), and (h) show the axial, coronal, and sagittal views of the selected image, respectively. Users can unload individual images by clicking the "X" button on the left of each image filename. Panel (e) shows a duplication of the list of the loaded filenames for overlay purposes. The "Overlay" tick-box (d) allows for observation of intensity changes from one image to another using a slider. Once this tick-box is enabled, the user must select one image from the top list (b) and another image from the bottom list (e) of images, which will correspond to the images on the left and the right side of the slider (d), respectively. The weight of overlay between the two images is controlled by the slider. The "Preset" (k) and the rest of the controls in the bottom right side of the panel, change the color mapping of the visualization windows, in order to depict different properties of the displayed images. Finally, more detailed image information is shown in (i) panel, and the (j) panel shows the coordinates of the current selected voxel of the image.

Secondly, we need to draw the Near and Far ROIs on the displayed images, i.e. T1-CE and T2-FLAIR. For drawing, the user needs to switch to the ‘Drawing panel’ depicted by (l) in Figure 2. The left most section of this panel is for switching to 'view mode' from the 'drawing mode'. The middle section is for drawing the Near and Far ROIs, whereas the right most section is for clearing the input of each ROI. The drawn Near and Far ROIs can be saved from the menu 'File -> Save -> ROI (NIFTI)'. If Near and Far ROIs already exist, they can be loaded from the menu 'File -> Load -> ROI (NIFTI)'.

Figure 2: The 'Drawing' panel of the PHI Estimator (Near and Far ROIs)

There are many buttons in this panel, which are briefly described in the following text.

Button Explanation
View Mode

Turns the system from drawing mode to the view mode.

Draw Near ROI Turns the system to drawing mode if it is in view mode, and enables the drawing of the Near ROI, shown in red (n) in Figure 2.
Draw Far ROI Turns the system to drawing mode if it is in view mode, and enables the drawing of the Far ROI, shown in green (o) in Figure 2.
Erase individual voxels Turns the system to erasing mode, allowing the user to erase individual voxels from the Near and/or the Far ROI.

Allows the user to select the size of the marker used both for Drawing or Erasing individual voxels from the Near/Far ROIs.

Clear Near Drawing Clears the Near ROI from all slices.
Clear Far Drawing Clears the Far ROI from all slices.

The user needs to launch the PHI estimation process by using the menu option: ‘EGFRvIII -> Estimate PHI'. A progress bar appears that shows the progress for the estimation of the PHI index. After the successful estimation, a pop-up window shows the results of PHI estimation.

Figure 3: PHI results window

The following Table describes various quantitative measures displayed on the pop-up in detail.

Button Explanation
PHI Index The quantitative value for PHI.
Near/Far perfusion drop ratio The ratio of the maximum drop in the temporal perfusion dynamic signals between the voxels of the Near ROI over the Far ROI.
Near ROI voxels used The number of voxels of the Near ROI that had actual perfusion data in the corresponding DSC image (and therefore involved in the estimation of the PHI index), over the number of voxels drawn by the user.
Far ROI voxels used The number of voxels of the Far ROI that had actual perfusion data in the corresponding DSC image (and therefore involved in the estimation of the PHI index), over the number of voxels drawn by the user.

Note: The system itself recognizes T1-CE, T2 FLAIR and DSC MRI files based on their filenames. For a file to be identified as T1-CE, it should contain any of these strings (T1CE, t1-ce, T1-CE, t1c, T1C, T1c) as part of any other characters in the filename. Similarly, for a file to be recognized as Flair and DSC, they should contain the (FLAIR, flair, Flair) and (Perfusion, PERFUSION, perf, perfusion) strings in their filenames, respectively.

The following table describes some of the keyboard and mouse controls.

Keyboard controls
Mode Description
Viewing Use

1-4: Change view among loaded images
h: Display/Hide Crosshair
r: Reset Geometric Adjustments
a: Reset Intensity Adjustments

Drawing Mode

e: Enable/Disable erase mode
1-9: Change brush size
Esc: Quit drawing mode

Mouse controls
Mode Description
Viewing Use

U/D: Change slice number
LB + movement: Move crosshair

Geometric Adjustments Ctrl + U/D: Zoom in/out (Adjust scaling factor)
Ctrl + LB + movement: Pan images (Adjust image's center)

U/D: Up/Down Wheel Scrolling, LB = Left Button, RB = Right Button



Advisor: Christos Davatzikos

Algorithm Developer: Spyridon Bakas

Software Engineers:



Spyridon Bakas, Hamed Akbari, Jared Pisapia, Maria Martinez-Lage, Martin Rozycki, Saima Rathore, Nadia Dahmane, Donald M. O’Rourke, Christos Davatzikos. "In vivo detection of EGFRvIII in glioblastoma via perfusion magnetic resonance imaging signature consistent with deep peritumoral infiltration: the φ index", Clin Cancer Res, April 20 2017. [Epub ahead of print] DOI: 10.1158/1078-0432.CCR-16-1871