Difference between revisions of "Support:Documents:Manual:COMKAT GUI"

From COMKAT wiki
Jump to navigation Jump to search
 
(10 intermediate revisions by 2 users not shown)
Line 13: Line 13:
 
* Time: The measuring time of the sample.
 
* Time: The measuring time of the sample.
 
* Activity: Activity measured at the measuring time of the sample.
 
* Activity: Activity measured at the measuring time of the sample.
* Time and activity has to be stored as columns that are of the same length and in the correct order.* A sample activity measured at certain time must be on the same row as the measuring time.
+
* Time and activity has to be stored as columns that are of the same length and in the correct order.
* Each column containing data must be continuous. Space between lines will cause errors. Text between numeric data might cause errors as well. (See example files: Correct format, bad file example 1, bad file example 2, bad file example 3)
+
* A sample activity measured at certain time must be on the same row as the measuring time.
 +
* Each column containing data must be continuous. Space between lines will cause errors. Text between numeric data might cause errors as well.  
 
* For different types of files, some extension-specific requirements may apply. (See below for those requirements)
 
* For different types of files, some extension-specific requirements may apply. (See below for those requirements)
 
* COMKAT allows you to load the input function from several different files. See Input Function GUI for instructions to load the input function.
 
* COMKAT allows you to load the input function from several different files. See Input Function GUI for instructions to load the input function.
 +
<br>
 
* File formats supported include:
 
* File formats supported include:
  
{| border="1" cellspacing="0"
+
{| border="1" cellspacing="0" width="50%"
 
! File Type  
 
! File Type  
 
! Specific requirement
 
! Specific requirement
Line 39: Line 41:
 
|}
 
|}
  
 +
<br>
 
* Units supported include:
 
* Units supported include:
  
{| border="1" cellspacing="0"
+
{| border="1" cellspacing="0" width="50%"
 
!Type
 
!Type
 
!Unit
 
!Unit
Line 51: Line 54:
 
| milli Ci, micro Ci, nano Ci, Bq, MBq, counts (if counter sensitivity is provided)
 
| milli Ci, micro Ci, nano Ci, Bq, MBq, counts (if counter sensitivity is provided)
 
|}
 
|}
 +
<br>Please note that the COMKAT GUI and Input Function GUI will automatically convert the time as minutes and activity as microCi. COMKAT Image Tool provides a function to scale your data before importing data to the COMKAT GUI.
  
 
=== Output Function ===
 
=== Output Function ===
Line 60: Line 64:
 
You can use the COMKAT Image Tool to draw ROIs or VOIs and extract time-activity curves from PET images. It also supports image fusion between PET and CT images. Image formats supported include:
 
You can use the COMKAT Image Tool to draw ROIs or VOIs and extract time-activity curves from PET images. It also supports image fusion between PET and CT images. Image formats supported include:
  
{|  border="1" cellspacing="0"
+
{|  border="1" cellspacing="0" width="50%"
 
|-
 
|-
| Vendor
+
| Vendor or format
 
| Specific requirement
 
| Specific requirement
 
| Models we have tested
 
| Models we have tested
 +
|-
 +
| DICOM
 +
| We currently support DICOM PET and DICOM CT images. You can load both dynamic (recommended) and static PET images.
 +
| -
 +
|-
 +
| Analyze
 +
|
 +
| -
 +
|-
 +
| NIFTI
 +
 +
| -
 
|-  
 
|-  
 
| Siemens
 
| Siemens
| -
+
| Both PET and MRI
 
| ECAT Exact®
 
| ECAT Exact®
 
|-
 
|-
Line 77: Line 93:
 
| You must have both the .img and .hdr files for the emission scan.
 
| You must have both the .img and .hdr files for the emission scan.
 
| MicroPET P4®
 
| MicroPET P4®
|-
 
| DICOM
 
| We currently support DICOM PET and DICOM CT images. You can load both dynamic (recommended) and static PET images.
 
| -
 
 
|}
 
|}
 
(Can't find your format in this list? We are happy to provide assistence for you to write functions to load your images in COMKAT. Contact Dean Fang or Raymond Muzic for instructions to make your image reading function compatible to COMKAT.)
 
(Can't find your format in this list? We are happy to provide assistence for you to write functions to load your images in COMKAT. Contact Dean Fang or Raymond Muzic for instructions to make your image reading function compatible to COMKAT.)
Line 91: Line 103:
 
* Time and activity has to be stored as columns that are of the same length and in the correct order.
 
* Time and activity has to be stored as columns that are of the same length and in the correct order.
 
* The activity concentration measured or imaged at certain time must be on the same row as the measuring time.
 
* The activity concentration measured or imaged at certain time must be on the same row as the measuring time.
* Each column containing data must be continuous. Space between lines will cause errors. Text between numeric data might cause errors as well. (See example files: Correct format, bad file example 1, bad file example 2, bad file example 3)
+
* Each column containing data must be continuous. Space between lines will cause errors. Text between numeric data might cause errors as well.  
 
* For different types of files, some extension-specific requirements may apply. (See below for those requirements)
 
* For different types of files, some extension-specific requirements may apply. (See below for those requirements)
 
* If you want to load multiple ROIs at the same time, all TACs have to stored in the same file.
 
* If you want to load multiple ROIs at the same time, all TACs have to stored in the same file.
 
* File formats supported are exactly the same as the input function files
 
* File formats supported are exactly the same as the input function files
 +
* NOTE: If you use 'mid-time points' as the time column, the first mid-time point cannot be zero or there will be an error.
  
 
== Overview of COMKAT GUI ==
 
== Overview of COMKAT GUI ==
  
Here is how COMKAT GUI looks when you open it:[[Image:docu_comkat_GUI_1.JPG|right|thumb|300px|Overview of the GUI]]
+
Here is how COMKAT GUI looks when you open it:
<br>It is divided into four panels:
+
<br><br>[[Image:docu_comkat_GUI_1.JPG|800px|]]
 +
<br><br>It is divided into four panels:
 
# The "Input Function" panel: it shows the curve of the input function.
 
# The "Input Function" panel: it shows the curve of the input function.
 
# The "Output Function" panel: it shows the curve of the output function, including the experimental, simulated and fitted curves if existing.
 
# The "Output Function" panel: it shows the curve of the output function, including the experimental, simulated and fitted curves if existing.
Line 118: Line 132:
 
== Loading input data ==
 
== Loading input data ==
 
To load the input data into COMKAT GUI, press the "Get data" button on "Input Function" panel.
 
To load the input data into COMKAT GUI, press the "Get data" button on "Input Function" panel.
<br>[[Image:docu_comkat_GUI_2.JPG|400px]]
+
<br><br>[[Image:docu_comkat_GUI_2.JPG|400px]]
<br>A window for loading the input function will show up as below:
+
<br><br>A window for loading the input function will show up as below:
<br>[[Image:docu_comkat_GUI_3.JPG||300px|COMKAT input function GUI]]
+
<br><br>[[Image:docu_comkat_GUI_3.JPG||300px|COMKAT input function GUI]]
<br>Refer to [[Document: COMKAT Input Function]] for using the Input Function GUI.
+
<br><br>Refer to [[Document: COMKAT Input Function]] for using the Input Function GUI.
  
 
== Loading output data ==
 
== Loading output data ==
Line 130: Line 144:
 
<br>
 
<br>
 
=== Load the output data from files ===
 
=== Load the output data from files ===
Click on the "From File" button. A window will be poped up to ask you to select the file. COMKAT GUI supports following file types of data: [[Image:docu_comkat_GUI_5.JPG|right|thumbnail|300px|Data importing window]]
+
Click on the "From File" button. A window will be poped up to ask you to select the file. COMKAT GUI supports following file types of data: <br><br>[[Image:docu_comkat_GUI_5.JPG]]
* Excel files (*.xls)
+
<br><br>* Excel files (*.xls)
 
* Text files (*.txt)
 
* Text files (*.txt)
 
* Comma separated files (*.csv)
 
* Comma separated files (*.csv)
Line 226: Line 240:
 
</table>
 
</table>
  
<br>Following default information can be set in the preference of COMKAT: [[Image:docu_comkat_GUI_6.JPG|300px|right|thumbnail|Window after data being read successfully]]
+
<br><br>Following default information can be set in the preference of COMKAT: <br><br>[[Image:docu_comkat_GUI_6.JPG|800px]]
 
+
<br><br>* Default time and concentration unit
* Default time and concentration unit
 
 
* Default file format
 
* Default file format
 
* Default time stored format
 
* Default time stored format
Line 253: Line 266:
 
<br>Click "Load"->"Compartment model". You may load the compartment model there within templates, .m files or .mat files.  
 
<br>Click "Load"->"Compartment model". You may load the compartment model there within templates, .m files or .mat files.  
  
[[Image:docu_comkat_GUI_7.JPG]]
+
<br><br>[[Image:docu_comkat_GUI_7.JPG]]
  
 
== Simulate model output ==
 
== Simulate model output ==
[[Image:docu_comkat_GUI_8.JPG|thumbnail|300px|right]] Once you load the model, COMKAT GUI automatically simulates the model output as long as you have your input function defined (either default or user-defined.) It is shown as a blue dotted line.
+
Once you load the model, COMKAT GUI automatically simulates the model output as long as you have your input function defined (either default or user-defined.) It is shown as a blue dotted line.
 
<br>If you have multiple ROIs, you can set different initial guesses for different ROIs. For each ROI the model output will be simulated individually based on the intial guess of this ROI.
 
<br>If you have multiple ROIs, you can set different initial guesses for different ROIs. For each ROI the model output will be simulated individually based on the intial guess of this ROI.
 
<br>Every time you change an initial guess for a parameter, COMKAT GUI automatically computes the model output and refresh the plot.
 
<br>Every time you change an initial guess for a parameter, COMKAT GUI automatically computes the model output and refresh the plot.
 
+
<br><br>[[Image:docu_comkat_GUI_8.JPG|800px]]
  
  
Line 266: Line 279:
  
 
<br>To estimate the current ROI, press "Estimate" button; to estimate all ROIs, press "Estimate all ROIs".  
 
<br>To estimate the current ROI, press "Estimate" button; to estimate all ROIs, press "Estimate all ROIs".  
 
+
<br><br>[[Image:docu_comkat_GUI_9.JPG]]
[[Image:docu_comkat_GUI_9.JPG]]
+
<br><br>Settings for parameter estimation include:
 
 
Settings for parameter estimation include:
 
  
 
* Parameter initial guess
 
* Parameter initial guess
Line 284: Line 295:
 
* Estimated output will be plotted
 
* Estimated output will be plotted
 
* Estimation summary (square error and time consumed) will be listed.
 
* Estimation summary (square error and time consumed) will be listed.
 
+
<br><br>[[Image:docu_comkat_GUI_10.JPG|800px]]
[[Image:docu_comkat_GUI_10.JPG|300px|border|100px|left]]
 
  
 
= Customizing COMKAT GUI =
 
= Customizing COMKAT GUI =
Line 302: Line 312:
 
<br>Two windows will pop up, one being the genie and one being the model drawer GUI:
 
<br>Two windows will pop up, one being the genie and one being the model drawer GUI:
  
Follow the steps as in the genie and create the model template. After all those steps, click "Return to GUI". Now in the model selection popupmenu your new model should be present.
+
Follow the steps as in the genie and create the model template. After all those steps, click "Return to GUI". Now in the model selection popupmenu your new model should be present when you reload/reopen the main COMKAT GUI again if the model function is saved under the folder, ~\comkat_GUI\model\ .
 
<br>If you do not know what to enter, here are some common values and functions used to create a model:
 
<br>If you do not know what to enter, here are some common values and functions used to create a model:
<table width="890" border="1">
+
<table width="600" border="1">
 
   <tr>
 
   <tr>
     <td width="404"><div align="center"><strong>Model drawing GUI </strong></div></td>
+
     <td><div align="center"><strong>Model drawing GUI </strong></div></td>
     <td width="766"><div align="center"><strong>Model creation genie </strong></div></td>
+
     <td><div align="center"><strong>Model creation genie </strong></div></td>
  
 
   </tr>
 
   </tr>
Line 339: Line 349:
 
   <tr bgcolor="#FFFFFF">
 
   <tr bgcolor="#FFFFFF">
 
     <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">ScanTime</font></td>
 
     <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">ScanTime</font></td>
     <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><strong>[[0:5:15 20 30 50]'' [5:5:20 30 50 90]'']</strong></font></td>
+
     <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><strong>[[0:5:15 20 30 50]' [5:5:20 30 50 90]']</strong></font></td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
Line 349: Line 359:
 
# Place the .m file into the "model" folder of the COMKAT GUI folder.
 
# Place the .m file into the "model" folder of the COMKAT GUI folder.
 
# Note: the second line of the .m file should be commented and contain the model name you wish to appear on the popup menu of model selection.
 
# Note: the second line of the .m file should be commented and contain the model name you wish to appear on the popup menu of model selection.
[[Image:docu_comkat_GUI_13.JPG]]
+
<br><br>[[Image:docu_comkat_GUI_13.JPG]]
[[Image:docu_comkat_GUI_14.JPG]]
+
<br><br>[[Image:docu_comkat_GUI_14.JPG]]
 
<br>Please note the following requirements for the model template file:
 
<br>Please note the following requirements for the model template file:
 
* Default input functions must be defined.
 
* Default input functions must be defined.
Line 366: Line 376:
  
 
== Setting preference ==
 
== Setting preference ==
To set up the preference of COMKAT GUI, click on "File->Preferences". A GUI will pop up to guide you through the setting.
+
To set up the preference of COMKAT GUI, click on "File->Preferences".  
<br>[[Image:docu_comkat_GUI_15.JPG]]
+
<br>A GUI will pop up to guide you through the setting.
<br>
+
<br><br>[[Image:docu_comkat_GUI_15.JPG]]
List of functions and what they mean:
+
 
 +
<br>List of functions and what they mean:
 
<table width="922" border="0" cellpadding="4" cellspacing="1" bgcolor="#111111">
 
<table width="922" border="0" cellpadding="4" cellspacing="1" bgcolor="#111111">
 
   <tr bgcolor="#CCCCCC">
 
   <tr bgcolor="#CCCCCC">
Line 488: Line 499:
 
* Share data and estimation with others
 
* Share data and estimation with others
 
* Store data for future reference
 
* Store data for future reference
 
= Tools of COMKAT GUI =
 
 
== Figure tool ==
 
To open the COMKAT GUI figure tool, right click on either the input or output function plot and select "Toggle the Property Tool".
 
 
A GUI will pop up as below:
 
[[Image:docu_comkat_GUI_16.JPG]]
 
 
List of functions and what they mean:
 
<table width="922" border="0" cellpadding="4" cellspacing="1" bgcolor="#111111">
 
  <tr bgcolor="#CCCCCC">
 
    <td width="99"><div align="center"><strong><font color="#000000" size="-1" face="Verdana, Arial, Helvetica, sans-serif">Type</font></strong></div></td>
 
    <td colspan="2"><div align="center"><strong><font color="#000000" size="-1" face="Verdana, Arial, Helvetica, sans-serif">Function</font></strong></div></td>
 
    <td width="614"><div align="center"><strong><font color="#000000" size="-1" face="Verdana, Arial, Helvetica, sans-serif">Detail</font></strong></div></td>
 
  </tr>
 
 
  <tr bgcolor="#FFFFFF">
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Slider</font></td>
 
    <td colspan="2"><strong><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Minimum</font></strong></td>
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Minimum value on the X-axis or Y-axis </font></td>
 
  </tr>
 
  <tr bgcolor="#FFFFFF">
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Slider</font></td>
 
 
    <td colspan="2"><strong><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Range</font></strong></td>
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Range to display on the X-axis or Y-axis </font></td>
 
  </tr>
 
  <tr bgcolor="#FFFFFF">
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Edit</font></td>
 
    <td colspan="2"><strong><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Label</font></strong></td>
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Label to display on the X-axis or Y-axis </font></td>
 
 
  </tr>
 
  <tr bgcolor="#FFFFFF">
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Edit</font></td>
 
    <td colspan="2"><strong><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Min</font></strong></td>
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Minimum value on the X-axis or Y-axis </font></td>
 
  </tr>
 
  <tr bgcolor="#FFFFFF">
 
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Edit</font></td>
 
    <td colspan="2"><strong><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Max</font></strong></td>
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Maximum value on the X-axis or Y-axis </font></td>
 
  </tr>
 
  <tr bgcolor="#FFFFFF">
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Checkbox</font></td>
 
    <td colspan="2"><strong><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Grid</font></strong></td>
 
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Display grid or not </font></td>
 
  </tr>
 
  <tr bgcolor="#FFFFFF">
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Checkbox</font></td>
 
    <td colspan="2"><strong><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Tick</font></strong></td>
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Display ticks or not </font></td>
 
  </tr>
 
 
  <tr bgcolor="#FFFFFF">
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Button</font></td>
 
    <td width="136"><strong><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Enlarge </font></strong></td>
 
    <td width="36"><strong><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="image/2.JPG" width="27" height="24"></font></strong></td>
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Enlarge an area on the plot </font></td>
 
  </tr>
 
  <tr bgcolor="#FFFFFF">
 
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Button</font></td>
 
    <td><strong><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Shift </font></strong></td>
 
    <td><strong><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="image/3.JPG" width="28" height="23"></font></strong></td>
 
    <td><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Shift the current area of viewing </font></td>
 
  </tr>
 
</table>
 
 
== Sensitivity analysis ==
 
To open the COMKAT GUI Sensitivity Analysis Tool, click Tools->Sensitivity Analysis.
 
<br>A GUI will pop up as below:
 
[[Image:docu_comkat_GUI_17.JPG]]
 
<br>The sensitivity functions are calculated with the input function and a set of parameters. In this GUI, you may adjust parameters to see how the outputs and sensitivity functions would be affected. To view a combination of functions, press "ctrl" and right click on the items on the same time. After selecting all the desired files, press "Apply".
 
 
== Analysis of runs ==
 
The analysis of runs can be used to examine the "randomness" of fitting residues. After you fit the data, click "Tools"=>"Analysis of runs" if you want to perform this analysis. The tool window looks like this:
 
<br>[[Image:docu_comkat_GUI_18.JPG]]
 
<br>And some analysis results are printed in the command window:
 
 
'''mu =
 
 
25
 
 
runs =
 
 
16
 
 
sigma =
 
 
3.4210
 
 
z =
 
 
-2.4847
 
 
pvalue =
 
 
0.0065'''
 
 
<br>You may also use the function "runsTest.m" under comkatroot\utilities.
 
 
== Simulation ==
 
The tools for model simulation
 
 
To perform the model simulation, click "Tools"=>"Simulation tool".
 
 
The simulation can be done in two ways:
 
 
# Generate the model output with specific noise level or noise function
 
# Generate noisy model output and fit it to get parameter estimates.
 
 
GUI look:
 
[[Image:docu_comkat_GUI_19.JPG]]
 

Latest revision as of 19:49, 26 June 2017


General use of COMKAT

Data Requirements to COMKAT GUI

To use COMKAT GUI, there are some minimum requirements to the file formats and content of the data. Please read the following carefully before you use the GUI.

Input Function

Input functions have to be read from files that meet these requirements:

  • Each file MUST contain both the time and activity information.
  • Time: The measuring time of the sample.
  • Activity: Activity measured at the measuring time of the sample.
  • Time and activity has to be stored as columns that are of the same length and in the correct order.
  • A sample activity measured at certain time must be on the same row as the measuring time.
  • Each column containing data must be continuous. Space between lines will cause errors. Text between numeric data might cause errors as well.
  • For different types of files, some extension-specific requirements may apply. (See below for those requirements)
  • COMKAT allows you to load the input function from several different files. See Input Function GUI for instructions to load the input function.


  • File formats supported include:
File Type Specific requirement
Text files (txt) x
Comma separated files (csv) x
MATLAB files (mat) The time and activity must be stored in the same variable. One .mat file may contain more than one variable, even nested.
Excel files (xls) The time and activity must be stored in the same worksheet. But the file can contain multiple worksheets.
Blood activity monitor (BAM) files (bam) The unit of activity in the BAM file has to be in counts and the counter sensitivity must be stored in the header


  • Units supported include:
Type Unit
Time Second, minute, hour
Activity milli Ci, micro Ci, nano Ci, Bq, MBq, counts (if counter sensitivity is provided)


Please note that the COMKAT GUI and Input Function GUI will automatically convert the time as minutes and activity as microCi. COMKAT Image Tool provides a function to scale your data before importing data to the COMKAT GUI.

Output Function

Output functions can be either loaded from files or images.

Image requirements

You can use the COMKAT Image Tool to draw ROIs or VOIs and extract time-activity curves from PET images. It also supports image fusion between PET and CT images. Image formats supported include:

Vendor or format Specific requirement Models we have tested
DICOM We currently support DICOM PET and DICOM CT images. You can load both dynamic (recommended) and static PET images. -
Analyze -
NIFTI -
Siemens Both PET and MRI ECAT Exact®
Philips - Allegro®
Siemens Concorde MicroPET You must have both the .img and .hdr files for the emission scan. MicroPET P4®

(Can't find your format in this list? We are happy to provide assistence for you to write functions to load your images in COMKAT. Contact Dean Fang or Raymond Muzic for instructions to make your image reading function compatible to COMKAT.)

File requirements

  • Each file MUST contain both the time and activity concentration information.
  • Time: The output time can be saved as frame beginning time, frame endding time, frame duration or mid-time points as one column. (Either format is compatible) It can also be saved as two-column frame beginning and ending time.
  • Activity concentration: The data must be in the format of activity/volume. See below for supported units.
  • Time and activity has to be stored as columns that are of the same length and in the correct order.
  • The activity concentration measured or imaged at certain time must be on the same row as the measuring time.
  • Each column containing data must be continuous. Space between lines will cause errors. Text between numeric data might cause errors as well.
  • For different types of files, some extension-specific requirements may apply. (See below for those requirements)
  • If you want to load multiple ROIs at the same time, all TACs have to stored in the same file.
  • File formats supported are exactly the same as the input function files
  • NOTE: If you use 'mid-time points' as the time column, the first mid-time point cannot be zero or there will be an error.

Overview of COMKAT GUI

Here is how COMKAT GUI looks when you open it:

Docu comkat GUI 1.JPG

It is divided into four panels:

  1. The "Input Function" panel: it shows the curve of the input function.
  2. The "Output Function" panel: it shows the curve of the output function, including the experimental, simulated and fitted curves if existing.
  3. The "Compartment Model" panel: it shows the diagram of the model.
  4. The "Model Parameters" panel: it shows the details of parameters used in the current model.


COMKAT GUI has been developed that it can fit all kinds of screen resolutions without being distorted.

Starting COMKAT GUI

There are several ways to start the COMKAT GUI:

  • Go to Matlab command window. Type "comkat" or "main_GUI" and COMKAT GUI should be started. OR
  • Open the Matlab editor and open the file "main_GUI.m". Press F5 or select "Debug"->"Run". OR
  • Open the Matlab editor and open the file "main_GUI.m". Press F5 or select "Debug"->"Run". OR
  • Select "Run COMKAT GUI" from the COMKAT welcome window. OR
  • If you are using a windows systems, you may start comkat by running "comkat_GUI.bat", which is located under folder "comkat_GUI", by double clicking it. (You may create a shortcut for it, too.)

Loading input data

To load the input data into COMKAT GUI, press the "Get data" button on "Input Function" panel.

Docu comkat GUI 2.JPG

A window for loading the input function will show up as below:

COMKAT input function GUI

Refer to Document: COMKAT Input Function for using the Input Function GUI.

Loading output data

There are two ways to load the output data:

  1. From files.
  2. From ROIs (on the images.)


Docu comkat GUI 4.JPG

Load the output data from files

Click on the "From File" button. A window will be poped up to ask you to select the file. COMKAT GUI supports following file types of data:

Docu comkat GUI 5.JPG

* Excel files (*.xls)

  • Text files (*.txt)
  • Comma separated files (*.csv)
  • Matlab data file (*.mat)

After selecting the file, a GUI will pop up to guide you through the output loading.



With this GUI, you can:

  • View data and select the columns
  • Different worksheets (excel files) or variables (mat files) can be viewed
  • Assign units to time and concentration data
  • Preview the output data in the plot
  • Load multiple ROIs and assign name to each ROI


Before you proceed, please note the following requirements:

  • For the output data, COMKAT GUI requires the file to contain information of both time and concentration.
  • Each set of data must be stored as columns, not rows.
  • Time can be stored as:
    • Frame beginning time
    • Frame endding time
    • Frame mid-time point
    • Frame duration (COMKAT is going to assume that the study begins at time=0 and there is no gap before frames.)
  • The starting and ending row of data must be the same for each column.

How to execute the function:

File type Function How
General Decide how the time is stored Click on the popup menu of "Time stored as"
  Name ROIs Click on the "Data" column to enter ROI name
  Adjust units Click on the popup menu of "Unit"
  Select data column Click on the popup menu of "Column"
  Change rows of starting and ending Click on the "First row of data" and "Last row of data" to enter row number.
  Load multiple ROI data Click "Add ROI" button, select the column
  Finish loading data and return to main GUI Click "OK" to exit and return main GUI
  Return to main GUI without loading the data Click "Cancel" to exit and return main GUI
Excel files Switch to a different excel worksheet Click on the worksheet in the list box of "Excel worksheet"
.mat Swtich to a different variable Click on the worksheet in the list box of "Matlab variable "



Following default information can be set in the preference of COMKAT:

Docu comkat GUI 6.JPG

* Default time and concentration unit

  • Default file format
  • Default time stored format
  • Default time column

Please refer to the "Preference setting" section for those settings.

Future version of COMKAT GUI will support the function to let the user write their own code to load the output data.

Load the output data from ROIs

Click on the "Draw ROI " button. The COMKAT image tool will be started to let you draw the ROI. Please refer to the "COMKAT image tool" section for the use of it.

After finishing drawing ROIs, click "Return to main GUI". Successful data loading

If you loaded your data successfully, the GUI should look like the image below. If you have more than one ROI, you can use the popupmenu "Current ROI:" to switch between ROIs. If there is only one ROI, this popupmenu will disappear.

Loading a COMKAT project

File-> Load project and select the COMKAT project file you saved before.

Selecting a model

To select the model, click the popup menu "Select a model from templates". OR
Click "Load"->"Compartment model". You may load the compartment model there within templates, .m files or .mat files.



Docu comkat GUI 7.JPG

Simulate model output

Once you load the model, COMKAT GUI automatically simulates the model output as long as you have your input function defined (either default or user-defined.) It is shown as a blue dotted line.
If you have multiple ROIs, you can set different initial guesses for different ROIs. For each ROI the model output will be simulated individually based on the intial guess of this ROI.
Every time you change an initial guess for a parameter, COMKAT GUI automatically computes the model output and refresh the plot.

Docu comkat GUI 8.JPG


Parameter estimation

Before you estimate the model parameters, you must make sure you have loaded the output function (experiment data) and the model. If you have an default input function in the model template, you can estimate the parameters without loading your own input function.


To estimate the current ROI, press "Estimate" button; to estimate all ROIs, press "Estimate all ROIs".

Docu comkat GUI 9.JPG

Settings for parameter estimation include:

  • Parameter initial guess
  • Parameter upper and lower bounds
  • Parameter sensitivity (whether you want to estimate or fix the parameter value)

To adjust these values, click in the edit box of them and modify the values. You may also click on the arrows points upward and downward next to the value to increase or decrease the value by 10%. You can try to generate a model output that is close to the experimental output. This combination of initial guess may be more appropriate for parameter estimation.

The checkbox of "Default" lets you reset the parameter values back to the ones defined in the model template.

Here is the look of the GUI after you estimate the parameters successfully:

  • Estimated values will be listed
  • Estimated output will be plotted
  • Estimation summary (square error and time consumed) will be listed.



Docu comkat GUI 10.JPG

Customizing COMKAT GUI

Create your own model with a script

Compartment model creation genie

Using the model creation genie to create a model template

The model creation genie does the following things that enables a user to create a model template for the comkat GUI:

  1. Opens the model drawer GUI of comkat that is used to create compartment models
  2. The genie guides the user step-by-step to create a model template that is compatible to the comkat GUI.
  3. The genie checks the compatibility. If the model is compatible, it add this model into the model selection popupmenu.


To open the model creation genie, open comkat GUI and select "Model drawer"=>"Model drawer genie"
Two windows will pop up, one being the genie and one being the model drawer GUI:

Follow the steps as in the genie and create the model template. After all those steps, click "Return to GUI". Now in the model selection popupmenu your new model should be present when you reload/reopen the main COMKAT GUI again if the model function is saved under the folder, ~\comkat_GUI\model\ .
If you do not know what to enter, here are some common values and functions used to create a model:

Model drawing GUI
Model creation genie
Docu comkat GUI 11.JPG Docu comkat GUI 12.JPG

Follow the steps as in the genie and create the model template. After all those steps, click "Return to GUI". Now in the model selection popupmenu your new model should be present.

If you do not know what to enter, here are some common values and functions used to create a model:

Data
Suggested value
dk If you are using non-radioactive data, use 0. Otherwise use log(2)/halflife. (eg. log(2)/109 for F-18)
Matlab Fcn for input function fengInput
Fcn. Param. for input function [2 0 851.1 21.88 20.81 -4.134 -0.1191 -0.01043] (for fengInput)
ScanTime [[0:5:15 20 30 50]' [5:5:20 30 50 90]']

Compartment model with a script

Define your own compartment model
Steps:

  1. Create the compartment model script (*.m file) that describes a complete compartment model.
  2. Place the .m file into the "model" folder of the COMKAT GUI folder.
  3. Note: the second line of the .m file should be commented and contain the model name you wish to appear on the popup menu of model selection.



Docu comkat GUI 13.JPG

Docu comkat GUI 14.JPG
Please note the following requirements for the model template file:

  • Default input functions must be defined.
  • Default input functions must include a "P" type (plasma) and a"M" (whole-blood) type input function.
  • Default scan time must be defined.


You can refer to the file "modelFDG.m" as an example for creating a model template file.

Defining weighting functions

Steps:

  1. Go to the folder "weighting" under "comkat_GUI"
  2. Copy the weighting function template file "weight_test.m" into a new .m file.
  3. Change line 2 into the name you wish to appear on weighting function popupmenu.
  4. Modify lines 10-13. Let the variable "final_weighting" to be the weighting variable. Please note that the weighting must have the same length as the experimental data.
  5. Restart COMKAT GUI and your own weighting function will appear on weighting function popupmenu.

Setting preference

To set up the preference of COMKAT GUI, click on "File->Preferences".
A GUI will pop up to guide you through the setting.

Docu comkat GUI 15.JPG


List of functions and what they mean:

Type
Function
Detail
Popup menu Default time unit Default unit for time in input and output functions
Popup menu Default conc unit Default unit for concentration in input and output functions
Popup menu Default weighting Default weighting function for parameter estimation
Popup menu Default estimation algorithm Default algorithm for parameter estimation
Checkbox Load this model when initializing GUI Whether to load the default model when the GUI is started
Popup menu Default model Default model to load when GUI opens. Only effective if the "Load this model when initializing GUI" is checked.
Checkbox Adjust font size when resizing GUI

Whether to resize the font size or not when the GUI is resized NOTE: You may set the maximum width and height of the GUI here.

Popup menu Default input function file format Default input function file format (file extension)
Popup menu Default output function file format Default output function file format (file extension)
Edit Default input time column The default column that stores the time in input function files
Popup menu Default style of output time column How the time information is stored in the output function file
Edit Default output time column The default column that stores the time in output function files
Popup menu Default background color Default background color of the GUI
Edit Default file location Default directories to save reports and projects. Click the "..." button to browse and select the directory.

Export options

Report for parameter estimation

To export the report for estimation, click "File->Export estimation report". Select file name and directory to save the report file.

This report will be saved as an excel file that contains the follow data for each ROI:

  • Parameter sensitivity, initial guess, lower and upper bound, estimated value
  • Residual for each data point of output function
  • Square error
  • Estimation weighting and algorithm

Save current work status as a project

To create a COMKAT project, click "File->Export project". Select a filename and directory to save the project with the file saving dialog. COMKAT GUI saves the project file including:

  • Your current input function
  • Your current model
  • Your simulated output and experimental data
  • Estimation results (each ROI will be saved individually.)

With this project file, you can exit COMKAT GUI or Matlab and come back later to continue your work.

To load a COMKAT project, click "File->Import Project". Select the file and the project will be loaded just as the status when you saved this project.

Using a project can be very convenient if you need to:

  • Exit a current working status and close COMKAT GUI
  • Share data and estimation with others
  • Store data for future reference