Skip to content

Commit f22bfec

Browse files
authored
Merge pull request #10 from BIOP/qp0.6.0
Migration to QuPath-0.6.0
2 parents 9b1d46e + 290ad5c commit f22bfec

63 files changed

Lines changed: 2985 additions & 1372 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Run gradle build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
prepare:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Grant execute permission for gradlew
18+
run: chmod +x gradlew
19+
- name: Upload workspace
20+
uses: actions/upload-artifact@v4
21+
with:
22+
name: workspace
23+
path: .
24+
build:
25+
needs: prepare
26+
uses: qupath/actions/.github/workflows/gradle.yml@main
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Make draft release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
permissions:
9+
contents: write
10+
uses: qupath/actions/.github/workflows/github-release.yml@main

.github/workflows/gradle.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/maven.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Publish to SciJava Maven (Root)
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
inputs:
7+
release:
8+
required: false
9+
type: boolean
10+
default: false
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-java@v4
19+
with:
20+
java-version: '21'
21+
distribution: 'temurin'
22+
23+
- name: Setup Gradle
24+
uses: gradle/actions/setup-gradle@v4
25+
26+
- name: Add release flag if input variable is set
27+
if: ${{ inputs.release }}
28+
shell: bash
29+
run: |
30+
echo "RELEASE_FLAG='-Prelease'" >> $GITHUB_ENV
31+
32+
- name: Publish release
33+
if: ${{ inputs.release }}
34+
shell: bash
35+
run: |
36+
./gradlew publish -Ptoolchain=21 -Prelease ${{ inputs.gradle-args }}
37+
env:
38+
MAVEN_USER: ${{ secrets.MAVEN_USER }}
39+
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
40+
41+
- name: Publish snapshot
42+
if: ${{ inputs.release == false }}
43+
shell: bash
44+
run: |
45+
./gradlew publish -Ptoolchain=21 ${{ inputs.gradle-args }}
46+
env:
47+
MAVEN_USER: ${{ secrets.MAVEN_USER }}
48+
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
49+
50+
- uses: actions/upload-artifact@v4
51+
if: ${{ inputs.release }}
52+
with:
53+
name: ${{ github.event.repository.name }}-release-jar
54+
path: build/libs
55+
retention-days: 7

.github/workflows/publish-release.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,9 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
publish:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-java@v2
12-
with:
13-
java-version: '17'
14-
distribution: 'adopt-hotspot'
15-
- name: Grant execute permission for gradlew
16-
run: chmod +x gradlew
17-
- name: Publish package
18-
run: ./gradlew publish -P toolchain=17 -P release=true
19-
env:
20-
MAVEN_USER: ${{ secrets.MAVEN_USER }}
21-
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
7+
build:
8+
name: Publish release
9+
uses: ./.github/workflows/maven.yml
10+
secrets: inherit
11+
with:
12+
release: true

.github/workflows/publish-snapshot.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,7 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
publish:
8-
9-
runs-on: ubuntu-latest
10-
11-
steps:
12-
- uses: actions/checkout@v3
13-
- name: Set up JDK 17
14-
uses: actions/setup-java@v3
15-
with:
16-
java-version: '17'
17-
distribution: 'temurin'
18-
- name: Make gradlew executable
19-
run: chmod +x ./gradlew
20-
- name: Validate Gradle wrapper
21-
uses: gradle/wrapper-validation-action@v1
22-
- name: Publish snapshot
23-
uses: gradle/gradle-build-action@v2.4.2
24-
with:
25-
arguments: publish
26-
env:
27-
MAVEN_USER: ${{ secrets.MAVEN_USER }}
28-
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
7+
build:
8+
name: Publish snapshot
9+
uses: ./.github/workflows/maven.yml
10+
secrets: inherit
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Update gradle version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
gradle-version:
7+
description: Gradle version
8+
default: latest
9+
type: string
10+
required: false
11+
12+
jobs:
13+
update:
14+
env:
15+
GH_TOKEN: ${{ github.token }}
16+
runs-on: ubuntu-latest
17+
defaults:
18+
run:
19+
shell: bash
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Update gradlew
23+
run: |
24+
./gradlew wrapper --gradle-version ${{ inputs.gradle-version }}
25+
- name: Commit and push
26+
run: |
27+
git config user.name "github-actions[bot]"
28+
git config user.email "github-actions[bot]@users.noreply.github.com"
29+
git checkout -b gradle-update
30+
git add .
31+
git commit --allow-empty -m "Update gradle via qupath/actions/.github/workflows/update-gradle.yml"
32+
git push -u origin gradle-update
33+
gh pr create --title "Update gradle via actions" --body "$(./gradlew --version)"

README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Zenodo DOI: [![DOI](https://zenodo.org/badge/417468733.svg)](https://doi.org/10.
88
This repo adds some support to use [Spotiflow](https://github.com/weigertlab/spotiflow) within QuPath through a Python virtual environment.
99

1010
> [!WARNING]
11-
> This extension is developed for QuPath 0.5.x
11+
> This extension is developed for QuPath 0.6.x
1212
1313

1414
# Citing
@@ -24,13 +24,14 @@ As this code is neither novel nor entirely original, there is no linked publicat
2424
## Code authorship
2525
**Author**: Rémy Dornier (1)
2626

27-
**Contributors**: Olivier Burri (1), Nicolas Chiaruttini (1), Romain Guiet (1)
27+
**Contributors**: Albert Dominguez Mantes (2), Olivier Burri (1), Nicolas Chiaruttini (1), Romain Guiet (1)
2828

2929
This code heavily mirrors functions and design implemented in [QuPath Cellpose](https://github.com/BIOP/qupath-extension-cellpose).
3030

3131
**Affiliations**
3232

3333
(1) EPFL BioImaging and Optics Platform (BIOP)
34+
(2) EPFL Weigert Lab
3435

3536
### If you use this extension, you should cite the following publications
3637

@@ -92,11 +93,27 @@ On macOS or Linux:
9293
where `{HOME}` will be the location of your home directory, typically `/Users/user-name/` on macOS or `/home/user-name/` on Linux.
9394

9495
## Step 2: Install the QuPath Spotiflow extension
96+
### On QuPath 0.6.x
9597

96-
Download the latest `qupath-extension-spotiflow-[version].jar` file from [releases](https://github.com/biop/qupath-extension-spotiflow/releases) and unzip it into your `extensions` directory.
98+
- Open QuPath
99+
- Go under `Extensions -> Manage extensions`
100+
- Expand the `QuPath-BIOP catalog`
97101

98-
If your extensions directory is unset, drag & drop `qupath-extension-spotiflow-[version].jar` onto the main QuPath window. You'll be prompted to select a QuPath user directory.
99-
The extension will then be copied to a location inside that directory.
102+
> Note: if you don't have the **QuPath-BIOP-catalog** installed, please follow the [catalog installation steps](https://github.com/BIOP/qupath-biop-catalog?tab=readme-ov-file#installation)
103+
104+
- Search for `QuPath Spotiflow extension` and click on the green button
105+
- Select the latest version
106+
- Click on `Install`
107+
108+
> Note: If you need to update the extension, click on the ⚙️ button and select the latest version to install.
109+
110+
### On QuPath 0.5.x
111+
112+
Download the latest `qupath-extension-spotiflow-[version].jar` file from [releases](https://github.com/biop/qupath-extension-spotiflow/releases) and copy it into your extensions directory.
113+
114+
If your extensions directory is unset, drag & drop `qupath-extension-spotiflow-[version].jar` onto the main QuPath window.
115+
You'll be prompted to select a QuPath user directory. The extension will then be copied to a location inside that directory.
116+
You finally need to restart QuPath.
100117

101118
<!--
102119
To copy `run-cellpose-qc.py`, go to Extensions > Installed Extensions and click on "Open Extensions Directory". You can place the `run-cellpose-qc.py` in the same folder.
@@ -147,7 +164,7 @@ Running Spotiflow is done via a script and is very similar to the excellent [QuP
147164

148165
You can find a template in QuPath in
149166

150-
`Extensions > Spotiflow > Spotiflow detection script template`
167+
`Extensions > Spotiflow > Spotiflow detection template`
151168

152169
Or you can download the [Spotiflow_detection_template.groovy](src/main/resources/scripts/Spotiflow_detection_template.groovy) script from this repo and open it in the QuPath script editor.
153170

@@ -156,7 +173,7 @@ Or you can download the [Spotiflow_detection_template.groovy](src/main/resources
156173
157174
### Getting all available arguments
158175

159-
All builder options that are implemented are documented [in the Javadoc](https://biop.github.io/qupath-extension-spotiflow/).
176+
All builder options that are implemented are documented [in the Javadoc](https://biop.github.io/qupath-extension-spotiflow/qupath/ext/biop/spotiflow/SpotiflowBuilder.html).
160177
You can pass additional options to `spotiflow` by adding `.addParameter()` before the `.build()` line.
161178

162179
To get the available additional arguments, call the help from the `spotiflow` object using `spotiflow.helpPredict()`

0 commit comments

Comments
 (0)