The common input parameters of this function are:
- studies_path: Path to a directory containing one image folder for each study. The image file formats allowed are NIfTI or Analyze.
- reference_path: Path to a directory which contains the reference masks or the TACs (with the same name as the study folder)
- interest_path: Path to a directory where the masks or the TACs of the region of interest (with the same name as the study folder).
IMPORTANT: The number of folders at the studies_path, the number of files at the reference_path and the number of files at the interest_path must be the same. The allowed formats for the masks are NIfTI and Analyze.
- save_path: Path to a directory where the results will be saved. If the paths is d, the current directory will be used.
- model: A string indicating the name of the selected model. Throughout this manual, the new model to be included will be called _newModel_Name.
- parameters: A vector containing the minimum information required to preprocess the selected model. Its length and values will depende on the model.
- timesfile_path (optional): Path to a .txt file containing the start and end times for each frame. Default times will be loaded if this optional file is not added and the studies do not include times series.
We have written a few code lines and suggestions on the way to implement the new model step by step:
STEP 1: Include your model
Change the newModel_Name text by the name you will give to your model. Also, you have to change the else condition.
STEP 2: Check input parameters
As an option, you could include a check for the number of input parameters, to make sure that it coincides with the number of parameters your model needs. It would also be useful to verify that the values are correct (non-negative values, correct numbers, between the allowed maximum and minimum,...). In that case, the program should save all the errors detected to the log-file.
STEP 3: Call your own model function
- the target and reference TACs: Ct and Cr. Both of them are column vectors.
- times: it contains the start and end times of each frame of the studies, in a n by 2 matrix (n being the number of frames of the PET studies). It is loaded from the header of the input studies; from the timesfile_path input parameter if it is included or from a default times table if none of the previous options are succeeded.
- the input parameters the model needs from the user
- Cpet: it contains the current study loaded. Each frame at one row and each voxel value at one column.
- The time of execution will be controlled by the tic-toc commands of Matlab.
STEP 4: Apply a "cut" to the generated images matrices (optional)
It is possible to ask the user for a threshold input parameter to "cut" the parametric images. All the values of the parametric images under a certain value obtain from the threshold will be set to zero.