> For the complete documentation index, see [llms.txt](https://mpqc.swcmicroscopy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mpqc.swcmicroscopy.com/protocols/protocol-mpqc-installation.md). Agents can also search and read this documentation through its [MCP server](https://mpqc.swcmicroscopy.com/~gitbook/mcp).

# Protocol - MPQC Installation

## Requirements

* These tools have been well well-tested under most MATLAB releases between  R2016b and R2019b. It should also work on R2016a. It's known to fail on 2015b and earlier.
* Requires the **Curve-Fitting Toolbox**, the **Image Processing Toolbox**, and the **Stats Toolbox**. The **MATLAB Report Generator** is needed if you want to make PDF reports.
* The tools are tested with ScanImage Basic 2020 to 2022.
* To use `mpqc.record.power` you must have the Thorlabs Optical Power Monitor software installed

## Installation

Clone the github repositiory from [AMF microscopy](https://github.com/SWC-Advanced-Microscopy/multiphoton-qc) in gitbash/github desktop

Add the multiphoton-qc `code` directory to your MATLAB path. You do **not** need to "Add With Subfolders": there is no need to explicitly add sub-folders of `code` and, indeed, it is recommended not to do so.&#x20;

### Fill in the settings file

Output files contain meta-data associated with the microscope in order to make it easier to compare different microscopes and to track hardware changes. The meta-data for from a short YAML file which **you must** fill in for your rig. The toolset assumes this file has been created and filled in with your microscope details. Future changes to the software may add fields to this file automatically. If this happens, it will be reported to the CLI that a new field was added with default settings. If you don't change the defaults, probably nothing bad will happen but the information provided by that field will not be logged.

Before using the tools for the first time **you must** run:

```
>> mpqc.settings.readSettings
```

This attempts to read the multiphoton-qc settings file. If this is the first time you are trying this, it will fail and ask you where to create the file. The path to the file will be printed to the screen. You should edit this file and then re-run `mpqc.settings.readSettings` until there are no more errors. The following is an example of the sort of thing you will see when you first run `mpqc.settings.readSettings`:&#x20;

```
>> mpqc.settings.readSettings

*** No MPQC settings file found. Where do you want to store these? *** 

1. At "~/MPQC_Settings"
   Choose this option if you always use the same user account and are not updating MPQC via Git.

[1 ... 1]?  
[1 ... 1]?  1

Creating settings directories and files -- 
Making directory ~/MPQC_Settings
Making directory ~/MPQC_Settings/BackupSettings

Can not find system settings file: making empty default file at ~/MPQC_Settings/MPQC_SystemSettings.yml
-> imagingLaser_1.serialNumber should be a scalar. Setting it to 49.
-> 2345 FILL IN.
 ********************************************************************
 * YOU HAVE INVALID OR OLD SETTINGS IN ~/MPQC_Settings/MPQC_SystemSettings.yml. 
 * They have been replaced with valid defaults. 
 **********************************************************************
Making backup of settings file at ~/MPQC_Settings/BackupSettings/2025_02_17__22_36_13_MPQC_SystemSettings.yml
Replacing settings file with updated version

ans = 

  struct with fields:

       microscope: [1×1 struct]
        objective: [1×1 struct]
               QC: [1×1 struct]
             PMTs: [1×1 struct]
    imagingLasers: [1×1 struct]
```
