This page contains information on how to setup QuPath 0.3 and how to migrate 0.2 to 0.3 scripts and protocols
= Installing QuPath =
Install the latest version of QuPath from https://qupath.github.io/
= BIOP Installation =
You can copy the "QuPath Common Data" folder from
```
WIN: \\svraw1\ptbiop\public\0-Software\QuPath
MAC: smb://svraw1/ptbiop/public\0-Software\QuPath
```
or download the[[ https://drive.google.com/file/d/1fz7P41CTqkcHKT91lVdjRtNDCqJLft4D/view?usp=sharing | ZIP from the BIOP GDrive ]] (~14Mb)
Place the `QuPath Common Data` folder somewher permanent on your computer
2. From QuPath, go to {nav Edit > Preferences...}
3. Under {nav Extensions > QuPath user directory} point to the previously copied `QuPath Common Data`
{F14241650, layout=center, size=full}
4. Restart QuPath
5. Go to {nav Extensions> Installed Extensions} and locate `BIOP QuPath Extension`
{F22627804, layout=center, size=full}
== Common Scripts ==
To have BIOP scripts (and your own) available for any open QuPath Project, you need to set the `Script directory`
1. Go to {nav Edit > Preferences > Automation}
2. Set the `Script directory` to`QuPath Common Data\biop-scripts`
{F15226503, layout=center, size=full}
== Extra Plugins and ImageJ Plugins ==
If you need a plugin from Fiji-ImageJ that will be run either manually within QuPath's ImageJ or with a script using a `run(...)` command, you need to **copy the jar file to the `ImageJ plugins directory` **.
1. Go go {nav Edit > Preferences > ImageJ} and set the `ImageJ plugins directory` (we set is a subfolder of `QuPath Common Data`)
{F14241693, layout=center, size=full}
2. Restart QuPath
NOTE: If you are going to run this code within a script **using the API directly**, you need to copy it to `QuPath Common Data\extensions`
= Installing StarDist for QuPath =
[[ https://github.com/qupath/qupath-extension-stardist | StarDist now exists as a QuPath Extension ]], and on a fresh QuPath install, all you need to do is drag and drop the release JAR into QuPath. This will copy it into the `extensions` directory.
Otherwise it is included in `QuPath Common Data` which can be downloaded here: `\\svraw1\ptbiop\public\0-Software\QuPath`
= Migrating StarDist Models =
StarDist models now need to be in `*.pb` format as per [[ https://github.com/qupath/qupath-extension-stardist#converting-a-tensorflow-model-for-use-with-opencv | this note by Pete Bankhead on the StarDist Extension Repo ]]
== Install a Virtual Environment for the conversion ==
Pip Dependencies: {F21324420}
**If you use `venv` with `py` and want to install in `D:\env-tf2onnx`**
```
py -3.7 -m venv d:\env-tf2onnx
d:\env-tf2onnx\Scripts\activate\
pip install -r tf2onnx.txt
```
**If you use `conda`**
```
conda create -n env-tf2onnx python=3.7
conda activate env-tf2onnx
pip install -r tf2onnx.txt
```
== Converting a Model from a StarDist Training ==
1. Locate the resulting **model folder **from StarDist training (not the ZIP file). The example here assumes it is called `demo-model`
2. Run the following command
```
python -m tf2onnx.convert --opset 10 --saved-model "L:\public\0-BIOP_Data\StarDist Models\demo-model" --output_frozen_graph "L:\public\0-BIOP_Data\StarDist Models\demo-model.pb"
```
3. This creates a single file `demo-model.pb`
4. Point to this file in the new StarDist Extension from within QuPath