# QuPath Script

1. Under *<mark style="color:green;">Automate</mark>* open the script editor, copy the script present [here](https://github.com/anuesch/Disc4All_QuPath), and make changes in the marked sections accordingly. Depending on which tissue detection was performed choose the according script provided.&#x20;

<figure><img src="/files/SQmIrsN2aw6WZcrgWeR7" alt=""><figcaption><p>GitHub files, showing the different scripts and the README file</p></figcaption></figure>

2. The .groovy file is the script and can be downloaded and opened in Qupath under *<mark style="color:green;">Automate > Script Editor > File > Open.</mark>*  Alternatively, the raw script can be copied (![](/files/Lzcy7plcoxL7nGKQD9nx)) from the github and pasted into a new script file in QuPath.

<figure><img src="/files/8jH6cY9NVTVNxm787uLq" alt=""><figcaption><p>Explanation of the manual tissue detection script</p></figcaption></figure>

3. Within the .groovy script for QuPath, it is visible in  `//comment` where you need to add the lines saved in your personal scripts.  It is also indicated from which Script you need to copy the lines over.&#x20;
4. If you have only one Region you want to analyse, the components 2-4 can be deleted from the script as indicated.&#x20;

{% hint style="info" %}
Open the downloaded script in QuPath. Then under file>open, open up the scripts you have created for your project (EstimateStainVectors, CellDetection). Then replace the lines marked in the BatchAnalysis\_Scipt script with your lines of script by copying them across.&#x20;
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://disc4all-qupath.gitbook.io/qupath-project/qupath-h-dab-docs/qupath-script.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
