Skip to content

Analysis

vbennington edited this page Apr 8, 2022 · 56 revisions

1. Data Pickling (MATLAB R2017b)

Data 'Pickling' is a process of combining various images within a folder (e.g., a DICOM folder) into a collated .mat file, representing a single study. This process compiles and compresses the files for subsequent processing stages.

  1. Run pft_CreateDataPickles.m in R2017b.
  2. Select the folder (case) you wish to ‘pickle.’
  3. Click ‘open.’ 'Pickling' will begin automatically and the .mat file will be written to the Results folder in results>Perfusion>Mapping.

2. Last-Usable Frame Selection (MATLAB R2015a)

A Last-Usable Frame (LUF) - the final frame that a patient has successfully held his/her breath - must be selected for each case as a data preparation and optimization step. This step is to ensure that data acquired after the breath-hold has failed is excluded from analysis. The following describes how to determine the Last Usable Frame setting.

  1. Run pft_DceMriPerfusionGui.m within Perfusion-GUIDE-Project-Hybrid to visualize the case in R2015a.
  2. Select the desired .mat file by clicking 'Open Cine-Stack'. Scroll to the .mat file of the desired patient.
  3. Determining the Last Usable Frame: Go to ~Slice 96 to visualize the whole lung. Start at Epoch 1 and scroll through the epochs until the lung bases clearly and suddenly drop. That epoch is therefore the first epoch that should be excluded. Thus, the previous epoch is the “Last Usable Frame.” Note this epoch down for the co-registration step. (See Figure 1.)
  4. N.B. Other than noting down the LUF, nothing is created in this step. This stage is merely determining an LUF for subsequent file production.

image

Figure 1. While sliding through four consecutive epochs, note how the breathing fails on the epoch of the right-most image. The previous epoch (centre right) would therefore be selected as the LUF.

3. Co-Registration (MATLAB R2017b)

There are two Co-Registration GUIs, the Co-Registration GUI and the Co-Registration Review GUI. The Co-Registration GUI is an operation that both excludes the frames following the LUF and co-registers the remaining frames to one another, thereby mitigating cardiac and respiratory motion artefacts. The Review GUI visualizes the operations performed by the Operational GUI.

Co-registration (Operation) GUI

  1. Run pft_MultiModalCoregisterOnePickleFileInteractively.m in R2017b.
  2. Choose the desired 'HH0XX_TWIST.mat' file
  3. Click 'Open'
  4. Designate the LUF determined from Stage 2.
  5. Once the program has completed, a .mat file entitled 'HH0XX_TWIST-MM-Spline-Coregistered' will appear in the Perfusion DICOM folder

Co-Registration Review GUI

  1. Run pft_PerfusionCoregistrationReview.m in R2017b.
  2. Select the desired .mat file
  3. Click ‘Open’

image

Figure 2. Overlaid original slice at two different epochs displays inter-epoch motion (left), co-registered slice at two different epochs displays reduced inter-epoch motion (centre), and original versus co-registered slice at the same epoch demonstrate the difference (right).

4. Mapping (MATLAB R2015a)

Quantitaive parametric map creation is the primary output of the project. This workflow entails placing a Region Of Interest (ROI) within the Main Pulmonary Artery (MPA), choosing a pixel from which the ROI is deconvolved for the Signal-Time Course, and lastly selecting the ideal deconvolution method to carry-out the task.

ROI placement

  1. Run pft_DceMriPerfusionGui.m in R2015a.
  2. Load the desired study by clicking 'Open Cine-Stack.' Scroll to the .mat file of the desired patient.
  3. Select the MPA ROI:
  • Navigate towards ~Epoch 2 and ~Slice 7. This should visualize the heart in full, with contrast.
  • Navigate forwards through the slices until a circle of contrast appears that has split off to the right of the heart. Scroll back and forth one or two epochs to confirm accuracy; the 'whiter' the circle the better.
  • After locating the slice with the most 'ideal' circle (see Figure 3) -- typically between slices 25 - 45 and epochs 4 - 6 -- click Create MPA ROI.
  • Place the blue circle produced inside the white circle. Change the blue circle’s size by dragging the arrows if necessary.
  • Double click inside the blue circle to select and save the MPA ROI.

image

Figure 3. Selecting the MPA ROI. Note that the MPA is typically capable of being visualized as a circle (left and centre), however, this is not always possible (right). The ROI should be placed at the slice in which the contrast-enhanced MPA is the most circular, demonstrating horizontal symmetry.

Choosing a deconvolution pixel for the Signal-Time Course

  1. Move the cursor around the white ROI circle until the graphs of the AIF Peak and Truncated AIF Peak are as identical as possible to the Signal Time-Course and Truncated/Filtered Signal Time-Course. Click Unfreeze Display if the Signal-Time Course graph does not update when the cursor moves. The AIF Peak curve should correspond to the Signal Time-Course curve and the Truncated AIF Peak curve should correspond to the Truncated/Filtered Signal Time-Course curve, respectively. Click again when this is the case. You can unfreeze and try repeatedly if necessary.

Choosing the Deconvolution Method

  1. Each successive change should bring the Residue Function curve closer to one half of a Dirac Delta Function (See Figure 4). Ways of achieving this are as follows (See Figure 5):
  • Adjust the Retain SV slider in-between groups of the red dots.
  • Choose Regularize rather than Truncate for the SVD options.
  • Alter the Filtering slider. Ideally, do not surpass 1.0.
  • Failing this, return to Step 4 and select a different pixel within the MPA ROI.

image

Figure 4. 1/2 Dirac Delta Function. The blue line here exemplifies a one-half Dirac Delta Function. [Adapted from 'https://oer.physics.manchester.ac.uk/AM/Notes/jsmath/Notesse5.html'.]

image

Figure 5. Signal Time courses for Residue functions. In this instance, the deconvolution via Regularization (Left) produces a delta function closer to 'ideal' than that of Truncated Singular Value Decomposition (Right) for this specific Residue Function.

  1. Down-sampling is an optional step, which merges either 2, 4, or 8 pixels and reduces processing time (x2 Down-sampling processes 5.6x faster than no down-sampling, on average). Ideally, do not surpass the x4 Down-sampling option.

Map Creation

  1. Keep AIF mean normalisation; do not switch to AIF peak.
  2. Click CREATE MAPS when ready.
  3. When prompted to set the threshold, type in 5.0.
  4. Decline interpolation.

5. Segmentation and Quantitation (MATLAB R2015a and R2020a)

Segmentation delineates the left and right lung boundaries from the surrounding image, enabling subsequent quantitation. There are multiple GUIs that facilitate map segmentation, which delineates the left and right lungs from the surrounding image: the Segmentation and Quantitation GUI, Grey Scale Segmentation GUI, Flood-Fill Segmentation GUI and Freehand-Assisted Segmentation GUI. There are also MacOS versions of each GUI available. N.B. Each case has a single segmentation ROI folder created, meaning it will be read-in and can be therefore overwritten by each GUI.

image

Figure 6. ROIs are placed delineating the right and left lung boundaries on each slice via manual segmentation (left), producing binary inclusion masks. Compromises were made such that the segmentation was appropriate across the time-series (left-centre, right-centre, and right).

Segmentation and Quantitation GUI (R2015a) - Create the ROI Folder

  1. Run pft_DceMriPerfusionSegmentationQuantitation.m in R2015a.
  2. Click ‘Import Maps.’
  3. Import desired .mat file.
  4. Click ‘Segment’ to create a folder of ROIs for the patient.
  5. This GUI will be used later on to quantify the parametric maps.

Grey Scale Segmentation GUI (R2015a)

The Grey Scale Segmentation GUI facilitates segmentation by creating multiple waypoints or vertices to produce a complete lung boundary.

  1. Run pft_DceMriPerfusionSegmentGrayscale.m in R2015a.
  2. Click ‘Import/Review.’
  3. Click ‘Open Cine-Stack.’
  4. Import the desired .mat file. N.B. This is a selection of the original DICOMs, not a perfusion map.
  5. Click ‘Select ROI Folder.’
  6. Choose the folder created in Step 4 of the ‘Segmentation and Quantitation GUI’ explanation.
  7. Click ‘Segment’ to go into segmentation mode.
  8. Click ‘Create Right Lung ROI’ then begin to segment by clicking around desired lung.
  9. When complete, double click inside the segmentation that you have created to temporarily save this selection as an ROI.
  10. To add a new vertex: Ctrl + ‘a’, hover, left click to add a new vertex. To remove a vertex: right click the vertex then select ‘delete.’
  11. Click ‘Delete Right Lung ROI’ to delete said ROI or 'Modify Right Lung ROI' to amend or recreate the existing ROI. If you wish to amend the ROI just created, ensure the ‘Propagate ROI from previous slice’ box is checked. If you wish to completely recreate it, un-check this box before deleting the ROI.
  12. Repeat the above steps using the Left Lung ROI buttons (‘Create Left Lung ROI’ and ‘Delete Left Lung ROI’).
  13. When complete, navigate to the next slice and repeat. Close the GUI when complete. All slices created will be saved into the chosen file in step 5.

Flood-Fill GUI (R2020a)

The Flood-Fill GUI can be used to efficiently segment a lung without drawing individual way-points. This GUI is optimal for posterior slices in which the enhancing arteries do not require manual exclusion (i.e., 70-112).

  1. Run pft_DceMriPerfusionSegmentGrayscaleFloodFill.m in R2020a.
  2. Click ‘Import/Review.’
  3. Click ‘Open Cine-Stack.’
  4. Import the desired .mat file. N.B. This is a selection of the original DICOMs, not a perfusion map.
  5. Click ‘Select ROI Folder.’
  6. Choose the folder created in Step 4 of the ‘Segmentation and Quantitation GUI’ explanation.
  7. Click ‘Segment’ to go into segmentation mode.
  8. Navigate the mouse (appears as a cross) to either the left or right lung cavity and click. A binary mask should appear, covering the lung (blue and red denoting right and left lung ROIs, respectively).
  9. Sub-optimal ROIs can be amended in the following ways:
  • If the lung categorisation (i.e., left vs. right) is incorrect, the anatomical lung choice can be designated before clicking in the 'Selection' tab, auto-detect is simply the default setting.
  • If the ROI created causes blooming, adjust the ceiling and floor toggles to boost the contrast and retry.
  • If the ROI is too conservative, adjust the ceiling and floor toggles to reduce the contrast and retry.

Freehand-Assisted GUI (R2020a)

The Freehand and Assisted GUIs enable either a freehand click or an edge-detected tracing of the lung boundary.

  1. Run pft_DceMriPerfusionSegmentGrayscaleFreehand.m in R2020a.
  2. Click ‘Import/Review.’
  3. Click ‘Open Cine-Stack.’
  4. Import the desired .mat file. N.B. This is a selection of the original DICOMs, not a perfusion map.
  5. Click ‘Select ROI Folder.’
  6. Choose the folder created in Step 4 of the ‘Segmentation and Quantitation GUI’ explanation.
  7. Click ‘Segment’ to go into segmentation mode.

Freehand Mode

  1. Click 'Create Left Lung ROI.'
  2. Either click and drag to trace the boundary of the lung or click along the edge at multiple steps.
  3. After the penultimate vertex has been made, to complete the ROI by double clicking.
  4. Vertexes can be added or deleted by hovering at the desired location and right-clicking. Each vertex can be amended by clicking and dragging.

Assisted Mode

The methodology is identical to Freehand Mode, but few boundary clicks are recommended over dragging to create the ROI.

Segmentation and Quantitation GUI (R2015a) - Quantitate

Once all desired slices have both left and right lung ROIs:

  1. Run pft_DceMriPerfusionSegmentationQuantitation.m in R2015a again.
  2. Click ‘Import Maps.’
  3. Import desired .mat file.
  4. Click ‘Segment’ to create a folder of ROIs for the patient.
  5. Click ‘Quantify.’
  6. The output parameter values are stored into an excel spreadsheet in the following location: Results>Perfusion>Segmentation>Quantitation.

6. Create Overlays (MATLAB R2017b)

Overlay movies are qualitative outputs, enabling the visualisation of the segmented parametric maps overlaid onto the original grey-scale images to orient the viewer.

  1. Run pft_CreatePerfusionOverlays.m in R2017b.
  2. Click 'Import Data.'
  3. The first selection prompt will be for the .mat file of the desired perfusion map created.
  4. The next selection is the orignal greyscale .mat of the same case.
  5. The right/left lung ROI folder will be read-in automatically.
  6. Choose the desired perfusion parameter (PBV, PBF, MTT, TPP) for the overlap to display.
  7. Click 'Create Movie.'
  8. Manual naming of _PBV, _PBF, MTT, or _TTP at the end of each file for each respective video created is required when saving, as this is not added automatically.

7. Histograms (MATLAB R2017b)

Histograms enable visualisation of the distribution of voxel frequency of perfusion parameters for each lung.

Histograms-Montage-Transposed-HH030_TWIST-MM-Spline-Coregistered_HYBRID_001

Figure 7. Example of a transposed histogram montage, demonstrating voxel frequency for each perfusion parameter across the right, left, and both lungs for a specific case.

Mapping Histograms

This step creates the histograms, saving them in a folder.

  1. Run pft_CreateHistograms.m in R2017b.
  2. Select the desired map.
  3. Select the desired right/left lung segmentation ROI folder.
  4. Histograms will start emerging on the screen and will be saved to a pre-designated folder.

Histogram Montage

This step collates the histograms from a specific case, saving them in a single image.

  1. Run pft_CreateHistogramMontage.m in R2017b.
  2. Choose the desired Histogram folder created in the 'Mapping Histograms' stage.
  3. A .png will appear in the MATLAB 'Current Folder' section, above the program. The format will be columns of Right Lung, Left Lung and Both Lungs; with rows of MTT, PBV, PBF, and TTP.
  4. If a transposed format is preferred (columns of perfusion parameters and rows of anatomical designation), run pft_CreateHistogramMontageTransposed.m in R2017 and follow the same steps as above.