├── .github
└── workflows
│ ├── gradle.yml
│ ├── publish-release.yml
│ └── publish-snapshot.yml
├── .gitignore
├── LICENSE
├── QC
├── Quality Control-Cellpose.ipynb
└── run-cellpose-qc.py
├── README.md
├── build.gradle
├── docs
├── allclasses-index.html
├── allpackages-index.html
├── deprecated-list.html
├── element-list
├── help-doc.html
├── index-all.html
├── index.html
├── jquery-ui.overrides.css
├── legal
│ ├── ADDITIONAL_LICENSE_INFO
│ ├── ASSEMBLY_EXCEPTION
│ ├── LICENSE
│ ├── jquery.md
│ └── jqueryUI.md
├── member-search-index.js
├── module-search-index.js
├── overview-summary.html
├── overview-tree.html
├── package-search-index.js
├── qupath
│ └── ext
│ │ └── biop
│ │ ├── cellpose
│ │ ├── Cellpose2D.LogParser.html
│ │ ├── Cellpose2D.html
│ │ ├── CellposeBuilder.html
│ │ ├── CellposeExtension.html
│ │ ├── CellposeSetup.html
│ │ ├── OpCreators.ImageNormalizationBuilder.html
│ │ ├── OpCreators.PercentileTileOpCreator.html
│ │ ├── OpCreators.TileOpCreator.html
│ │ ├── OpCreators.ZeroMeanVarianceTileOpCreator.html
│ │ ├── OpCreators.html
│ │ ├── package-summary.html
│ │ └── package-tree.html
│ │ └── cmd
│ │ ├── VirtualEnvironmentRunner.EnvType.html
│ │ ├── VirtualEnvironmentRunner.html
│ │ ├── package-summary.html
│ │ └── package-tree.html
├── resources
│ ├── glass.png
│ └── x.png
├── script-dir
│ ├── images
│ │ ├── ui-bg_glass_55_fbf9ee_1x400.png
│ │ ├── ui-bg_glass_65_dadada_1x400.png
│ │ ├── ui-bg_glass_75_dadada_1x400.png
│ │ ├── ui-bg_glass_75_e6e6e6_1x400.png
│ │ ├── ui-bg_glass_95_fef1ec_1x400.png
│ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png
│ │ ├── ui-icons_222222_256x240.png
│ │ ├── ui-icons_2e83ff_256x240.png
│ │ ├── ui-icons_454545_256x240.png
│ │ ├── ui-icons_888888_256x240.png
│ │ └── ui-icons_cd0a0a_256x240.png
│ ├── jquery-3.5.1.min.js
│ ├── jquery-ui.min.css
│ ├── jquery-ui.min.js
│ └── jquery-ui.structure.min.css
├── script.js
├── search.js
├── stylesheet.css
├── tag-search-index.js
└── type-search-index.js
├── files
├── cellpose-omnipose-biop-gpu.yml
├── cellpose-qupath-setup-example.png
└── cellpose-qupath-training-example.png
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── src
├── main
├── java
│ ├── .gitkeep
│ └── qupath
│ │ └── ext
│ │ └── biop
│ │ ├── cellpose
│ │ ├── Cellpose2D.java
│ │ ├── CellposeBuilder.java
│ │ ├── CellposeExtension.java
│ │ ├── CellposeSetup.java
│ │ └── OpCreators.java
│ │ └── cmd
│ │ └── VirtualEnvironmentRunner.java
└── resources
│ ├── .gitkeep
│ ├── META-INF
│ └── services
│ │ └── qupath.lib.gui.extensions.QuPathExtension
│ └── scripts
│ ├── Cellpose_detection_template.groovy
│ ├── Cellpose_training_template.groovy
│ ├── Create_Cellpose_training_and_validation_images.groovy
│ └── Detect_nuclei_and_cells_using_Cellpose.groovy
└── test
└── java
└── .gitkeep
/.github/workflows/gradle.yml:
--------------------------------------------------------------------------------
1 | # This workflow uses actions that are not certified by GitHub.
2 | # They are provided by a third-party and are governed by
3 | # separate terms of service, privacy policy, and support
4 | # documentation.
5 | # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7 |
8 | name: Java CI with Gradle
9 |
10 | on:
11 | pull_request:
12 | branches: [ "main" ]
13 |
14 | permissions:
15 | contents: read
16 |
17 | jobs:
18 | build:
19 |
20 | runs-on: ubuntu-latest
21 |
22 | steps:
23 | - uses: actions/checkout@v2
24 | - name: Set up JDK 17
25 | uses: actions/setup-java@v2
26 | with:
27 | java-version: '17'
28 | distribution: 'temurin'
29 | - name: Grant execute permission for gradlew
30 | run: chmod +x gradlew
31 | - name: Build with Gradle
32 | run: ./gradlew build -P toolchain=17
--------------------------------------------------------------------------------
/.github/workflows/publish-release.yml:
--------------------------------------------------------------------------------
1 | name: Publish release to SciJava Maven
2 |
3 | on:
4 | workflow_dispatch:
5 |
6 | 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 }}
--------------------------------------------------------------------------------
/.github/workflows/publish-snapshot.yml:
--------------------------------------------------------------------------------
1 | name: Publish snapshot to SciJava Maven
2 |
3 | on:
4 | workflow_dispatch:
5 |
6 | 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 }}
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Maven
2 | deploy/
3 | target/
4 | log/
5 |
6 | # IntelliJ
7 | .idea/
8 | *.iml
9 | out/
10 |
11 | # Gradle
12 | # Use local properties (e.g. to set a specific JDK)
13 | gradle.properties
14 | build/
15 | .gradle/
16 |
17 | # Eclipse
18 | .settings/
19 | .project
20 | .classpath
21 |
22 | # Mac
23 | .DS_Store
24 |
25 | # Java
26 | hs_err*.log
27 |
28 | # Other
29 | *.tmp
30 | *.bak
31 | *.swp
32 | *~.nib
33 | *thumbs.db
34 | bin/
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'java-library'
3 | id 'maven-publish'
4 | alias(libs.plugins.javafx)
5 | }
6 |
7 | repositories {
8 | // Use this only for local development!
9 | // mavenLocal()
10 |
11 | maven{
12 | url "https://maven.scijava.org/content/repositories/releases"
13 | }
14 |
15 | mavenCentral()
16 |
17 | maven {
18 | url "https://maven.scijava.org/content/repositories/snapshots"
19 | }
20 | }
21 |
22 |
23 | ext.moduleName = 'qupath.extension.cellpose'
24 | ext.qupathVersion = gradle.ext.qupathVersion
25 |
26 | description = 'QuPath extension to use Cellpose'
27 |
28 | version = "0.10.2-SNAPSHOT"
29 |
30 | dependencies {
31 | implementation "io.github.qupath:qupath-gui-fx:${qupathVersion}"
32 | implementation libs.qupath.fxtras
33 | implementation "commons-io:commons-io:2.15.0"
34 | implementation libs.bundles.logging
35 | }
36 |
37 | processResources {
38 | from ("${projectDir}/LICENSE") {
39 | into 'META-INF/licenses/'
40 | }
41 | }
42 |
43 | tasks.register("copyDependencies", Copy) {
44 | description "Copy dependencies into the build directory for use elsewhere"
45 | group "QuPath"
46 |
47 | from configurations.default
48 | into 'build/libs'
49 | }
50 |
51 | /*
52 | * Ensure Java 17 compatibility
53 | */
54 | java {
55 | toolchain {
56 | languageVersion = JavaLanguageVersion.of(17)
57 | }
58 | if (project.properties['sources'])
59 | withSourcesJar()
60 | if (project.properties['javadocs'])
61 | withJavadocJar()
62 | }
63 |
64 | /*
65 | * Manifest info
66 | */
67 | jar {
68 | manifest {
69 | attributes("Implementation-Title": project.name,
70 | "Implementation-Version": archiveVersion,
71 | "Automatic-Module-Name": "io.github." + moduleName)
72 | }
73 | }
74 |
75 | /*
76 | * Create javadocs for all modules/packages in one place.
77 | * Use -PstrictJavadoc=true to fail on error with doclint (which is rather strict).
78 | */
79 | def strictJavadoc = findProperty('strictJavadoc')
80 | if (!strictJavadoc) {
81 | tasks.withType(Javadoc) {
82 | options.addStringOption('Xdoclint:none', '-quiet')
83 | }
84 | }
85 |
86 | javadoc {
87 | options.addBooleanOption('html5', true)
88 | destinationDir = new File(project.rootDir,"docs")
89 | }
90 |
91 | /*
92 | * Avoid 'Entry .gitkeep is a duplicate but no duplicate handling strategy has been set.'
93 | * when using withSourcesJar()
94 | */
95 | tasks.withType(org.gradle.jvm.tasks.Jar) {
96 | duplicatesStrategy = DuplicatesStrategy.INCLUDE
97 | }
98 |
99 | tasks.named('test') {
100 | useJUnitPlatform()
101 | }
102 |
103 | publishing {
104 | repositories {
105 | maven {
106 | name = "SciJava"
107 | def releasesRepoUrl = uri("https://maven.scijava.org/content/repositories/releases")
108 | def snapshotsRepoUrl = uri("https://maven.scijava.org/content/repositories/snapshots")
109 | // Use gradle -Prelease publish
110 | url = project.hasProperty('release') ? releasesRepoUrl : snapshotsRepoUrl
111 | credentials {
112 | username = System.getenv("MAVEN_USER")
113 | password = System.getenv("MAVEN_PASS")
114 | }
115 | }
116 | }
117 |
118 | publications {
119 | mavenJava(MavenPublication) {
120 | groupId = 'io.github.qupath'
121 | from components.java
122 |
123 | pom {
124 | licenses {
125 | license {
126 | name = 'Apache License v2.0'
127 | url = 'http://www.apache.org/licenses/LICENSE-2.0'
128 | }
129 | }
130 | }
131 | }
132 | }
133 | }
--------------------------------------------------------------------------------
/docs/allclasses-index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Builder for a OpCreators.TileOpCreator that can be used for image preprocessing
86 | using min/max percentiles or zero-mean-unit-variance normalization.
81 | Starting from the Overview page, you can browse the documentation using the links in each page, and in the navigation bar at the top of each page. The Index and Search box allow you to navigate to specific declarations and summary pages, including: All Packages, All Classes and Interfaces
82 |
83 |
Search
84 |
You can search for definitions of modules, packages, types, fields, methods, system properties and other terms defined in the API, using some or all of the name, optionally using "camelCase" abbreviations. For example:
85 |
86 |
j.l.obj will match "java.lang.Object"
87 |
InpStr will match "java.io.InputStream"
88 |
HM.cK will match "java.util.HashMap.containsKey(Object)"
96 | The following sections describe the different kinds of pages in this collection.
97 |
98 |
Overview
99 |
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
100 |
101 |
102 |
Package
103 |
Each package has a page that contains a list of its classes and interfaces, with a summary for each. These pages may contain the following categories:
104 |
105 |
Interfaces
106 |
Classes
107 |
Enum Classes
108 |
Exceptions
109 |
Errors
110 |
Annotation Interfaces
111 |
112 |
113 |
114 |
Class or Interface
115 |
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a declaration and description, member summary tables, and detailed member descriptions. Entries in each of these sections are omitted if they are empty or not applicable.
116 |
117 |
Class Inheritance Diagram
118 |
Direct Subclasses
119 |
All Known Subinterfaces
120 |
All Known Implementing Classes
121 |
Class or Interface Declaration
122 |
Class or Interface Description
123 |
124 |
125 |
126 |
Nested Class Summary
127 |
Enum Constant Summary
128 |
Field Summary
129 |
Property Summary
130 |
Constructor Summary
131 |
Method Summary
132 |
Required Element Summary
133 |
Optional Element Summary
134 |
135 |
136 |
137 |
Enum Constant Details
138 |
Field Details
139 |
Property Details
140 |
Constructor Details
141 |
Method Details
142 |
Element Details
143 |
144 |
Note: Annotation interfaces have required and optional elements, but not methods. Only enum classes have enum constants. The components of a record class are displayed as part of the declaration of the record class. Properties are a feature of JavaFX.
145 |
The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
146 |
147 |
148 |
Other Files
149 |
Packages and modules may contain pages with additional information related to the declarations nearby.
150 |
151 |
152 |
Tree (Class Hierarchy)
153 |
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. Classes are organized by inheritance structure starting with java.lang.Object. Interfaces do not inherit from java.lang.Object.
154 |
155 |
When viewing the Overview page, clicking on TREE displays the hierarchy for all packages.
156 |
When viewing a particular package, class or interface page, clicking on TREE displays the hierarchy for only that package.
157 |
158 |
159 |
160 |
Deprecated API
161 |
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to shortcomings, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
162 |
163 |
164 |
All Packages
165 |
The All Packages page contains an alphabetic index of all packages contained in the documentation.
166 |
167 |
168 |
All Classes and Interfaces
169 |
The All Classes and Interfaces page contains an alphabetic index of all classes and interfaces contained in the documentation, including annotation interfaces, enum classes, and record classes.
170 |
171 |
172 |
Index
173 |
The Index contains an alphabetic index of all classes, interfaces, constructors, methods, and fields in the documentation, as well as summary pages such as All Packages, All Classes and Interfaces.
174 |
175 |
176 |
177 | This help file applies to API documentation generated by the standard doclet.
178 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/docs/jquery-ui.overrides.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 | *
5 | * This code is free software; you can redistribute it and/or modify it
6 | * under the terms of the GNU General Public License version 2 only, as
7 | * published by the Free Software Foundation. Oracle designates this
8 | * particular file as subject to the "Classpath" exception as provided
9 | * by Oracle in the LICENSE file that accompanied this code.
10 | *
11 | * This code is distributed in the hope that it will be useful, but WITHOUT
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | * version 2 for more details (a copy is included in the LICENSE file that
15 | * accompanied this code).
16 | *
17 | * You should have received a copy of the GNU General Public License version
18 | * 2 along with this work; if not, write to the Free Software Foundation,
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 | *
21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 | * or visit www.oracle.com if you need additional information or have any
23 | * questions.
24 | */
25 |
26 | .ui-state-active,
27 | .ui-widget-content .ui-state-active,
28 | .ui-widget-header .ui-state-active,
29 | a.ui-button:active,
30 | .ui-button:active,
31 | .ui-button.ui-state-active:hover {
32 | /* Overrides the color of selection used in jQuery UI */
33 | background: #F8981D;
34 | }
35 |
--------------------------------------------------------------------------------
/docs/legal/ADDITIONAL_LICENSE_INFO:
--------------------------------------------------------------------------------
1 | Please see ..\java.base\ADDITIONAL_LICENSE_INFO
2 |
--------------------------------------------------------------------------------
/docs/legal/ASSEMBLY_EXCEPTION:
--------------------------------------------------------------------------------
1 | Please see ..\java.base\ASSEMBLY_EXCEPTION
2 |
--------------------------------------------------------------------------------
/docs/legal/LICENSE:
--------------------------------------------------------------------------------
1 | Please see ..\java.base\LICENSE
2 |
--------------------------------------------------------------------------------
/docs/legal/jquery.md:
--------------------------------------------------------------------------------
1 | ## jQuery v3.5.1
2 |
3 | ### jQuery License
4 | ```
5 | jQuery v 3.5.1
6 | Copyright JS Foundation and other contributors, https://js.foundation/
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining
9 | a copy of this software and associated documentation files (the
10 | "Software"), to deal in the Software without restriction, including
11 | without limitation the rights to use, copy, modify, merge, publish,
12 | distribute, sublicense, and/or sell copies of the Software, and to
13 | permit persons to whom the Software is furnished to do so, subject to
14 | the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be
17 | included in all copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 |
27 | ******************************************
28 |
29 | The jQuery JavaScript Library v3.5.1 also includes Sizzle.js
30 |
31 | Sizzle.js includes the following license:
32 |
33 | Copyright JS Foundation and other contributors, https://js.foundation/
34 |
35 | This software consists of voluntary contributions made by many
36 | individuals. For exact contribution history, see the revision history
37 | available at https://github.com/jquery/sizzle
38 |
39 | The following license applies to all parts of this software except as
40 | documented below:
41 |
42 | ====
43 |
44 | Permission is hereby granted, free of charge, to any person obtaining
45 | a copy of this software and associated documentation files (the
46 | "Software"), to deal in the Software without restriction, including
47 | without limitation the rights to use, copy, modify, merge, publish,
48 | distribute, sublicense, and/or sell copies of the Software, and to
49 | permit persons to whom the Software is furnished to do so, subject to
50 | the following conditions:
51 |
52 | The above copyright notice and this permission notice shall be
53 | included in all copies or substantial portions of the Software.
54 |
55 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
56 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
57 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
58 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
59 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
60 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
61 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
62 |
63 | ====
64 |
65 | All files located in the node_modules and external directories are
66 | externally maintained libraries used by this software which have their
67 | own licenses; we recommend you read them, as their terms may differ from
68 | the terms above.
69 |
70 | *********************
71 |
72 | ```
73 |
--------------------------------------------------------------------------------
/docs/legal/jqueryUI.md:
--------------------------------------------------------------------------------
1 | ## jQuery UI v1.12.1
2 |
3 | ### jQuery UI License
4 | ```
5 | Copyright jQuery Foundation and other contributors, https://jquery.org/
6 |
7 | This software consists of voluntary contributions made by many
8 | individuals. For exact contribution history, see the revision history
9 | available at https://github.com/jquery/jquery-ui
10 |
11 | The following license applies to all parts of this software except as
12 | documented below:
13 |
14 | ====
15 |
16 | Permission is hereby granted, free of charge, to any person obtaining
17 | a copy of this software and associated documentation files (the
18 | "Software"), to deal in the Software without restriction, including
19 | without limitation the rights to use, copy, modify, merge, publish,
20 | distribute, sublicense, and/or sell copies of the Software, and to
21 | permit persons to whom the Software is furnished to do so, subject to
22 | the following conditions:
23 |
24 | The above copyright notice and this permission notice shall be
25 | included in all copies or substantial portions of the Software.
26 |
27 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
31 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
32 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
33 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 |
35 | ====
36 |
37 | Copyright and related rights for sample code are waived via CC0. Sample
38 | code is defined as all source code contained within the demos directory.
39 |
40 | CC0: http://creativecommons.org/publicdomain/zero/1.0/
41 |
42 | ====
43 |
44 | All files located in the node_modules and external directories are
45 | externally maintained libraries used by this software which have their
46 | own licenses; we recommend you read them, as their terms may differ from
47 | the terms above.
48 |
49 | ```
50 |
--------------------------------------------------------------------------------
/docs/member-search-index.js:
--------------------------------------------------------------------------------
1 | memberSearchIndex = [{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"addParameter(String)","u":"addParameter(java.lang.String)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"addParameter(String, String)","u":"addParameter(java.lang.String,java.lang.String)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"batchSize(Integer)","u":"batchSize(java.lang.Integer)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"build()"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.ImageNormalizationBuilder","l":"build()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"builder(File)","u":"builder(java.io.File)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"builder(String)","u":"builder(java.lang.String)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"cellConstrainScale"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"cellConstrainScale(double)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"cellExpansion"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"cellExpansion(double)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"Cellpose2D()","u":"%3Cinit%3E()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"CellposeBuilder(File)","u":"%3Cinit%3E(java.io.File)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"CellposeBuilder(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"cellposeChannels(Integer, Integer)","u":"cellposeChannels(java.lang.Integer,java.lang.Integer)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeExtension","l":"CellposeExtension()","u":"%3Cinit%3E()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"cellposeSetup"},{"p":"qupath.ext.biop.cellpose","c":"CellposeSetup","l":"CellposeSetup()","u":"%3Cinit%3E()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"cellprobThreshold(Double)","u":"cellprobThreshold(java.lang.Double)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"channels(ColorTransforms.ColorTransform...)","u":"channels(qupath.lib.images.servers.ColorTransforms.ColorTransform...)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"channels(int...)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"channels(String...)","u":"channels(java.lang.String...)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"classify(PathClass)","u":"classify(qupath.lib.objects.classes.PathClass)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"classify(String)","u":"classify(java.lang.String)"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner","l":"closeWatchService()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"compartments"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"compartments(ObjectMeasurements.Compartments...)","u":"compartments(qupath.lib.analysis.features.ObjectMeasurements.Compartments...)"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.PercentileTileOpCreator","l":"compute(Mat)","u":"compute(org.bytedeco.opencv.opencv_core.Mat)"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.ZeroMeanVarianceTileOpCreator","l":"compute(Mat)","u":"compute(org.bytedeco.opencv.opencv_core.Mat)"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner.EnvType","l":"CONDA"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"constrainToParent"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"constrainToParent(boolean)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D.LogParser","l":"CP2"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D.LogParser","l":"CP3"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"createAnnotations()"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.ZeroMeanVarianceTileOpCreator","l":"createOps(ImageDataOp, ImageData, ROI, ImagePlane)","u":"createOps(qupath.opencv.ops.ImageDataOp,qupath.lib.images.ImageData,qupath.lib.roi.interfaces.ROI,qupath.lib.regions.ImagePlane)"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.TileOpCreator","l":"createOps(ImageDataOp, ImageData, ROI, ImagePlane)","u":"createOps(qupath.opencv.ops.ImageDataOp,qupath.lib.images.ImageData,qupath.lib.roi.interfaces.ROI,qupath.lib.regions.ImagePlane)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"creatorFun"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"detectObjects(ImageData, Collection extends PathObject>)","u":"detectObjects(qupath.lib.images.ImageData,java.util.Collection)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"detectObjectsImpl(ImageData, Collection extends PathObject>)","u":"detectObjectsImpl(qupath.lib.images.ImageData,java.util.Collection)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"diameter(Double)","u":"diameter(java.lang.Double)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"doReadResultsAsynchronously"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.ImageNormalizationBuilder","l":"downsample(double)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"epochs(Integer)","u":"epochs(java.lang.Integer)"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.ImageNormalizationBuilder","l":"eps(double)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"excludeEdges()"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner.EnvType","l":"EXE"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"extendChannelOp"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"extendChannelOp(ImageOp)","u":"extendChannelOp(qupath.opencv.ops.ImageOp)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"flowThreshold(Double)","u":"flowThreshold(java.lang.Double)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeSetup","l":"getCellposePythonPath()"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner","l":"getChangedFiles()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeSetup","l":"getCondaPath()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeExtension","l":"getDescription()"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner.EnvType","l":"getDescription()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeSetup","l":"getInstance()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D.LogParser","l":"getName()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeExtension","l":"getName()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeSetup","l":"getOmniposePythonPath()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"getOutputLog()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D.LogParser","l":"getPattern()"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner","l":"getProcess()"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner","l":"getProcessLog()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"getQCResults()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeExtension","l":"getQuPathVersion()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeExtension","l":"getRepository()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"getTrainingDirectory()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"getTrainingResults()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"getValidationDirectory()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"globalPathClass"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"globalPreprocess"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"groundTruthDirectory"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"groundTruthDirectory(File)","u":"groundTruthDirectory(java.io.File)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"ignoreCellOverlaps"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"ignoreCellOverlaps(boolean)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"imageNormalizationBuilder()"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators","l":"imageNormalizationBuilder()"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.ImageNormalizationBuilder","l":"ImageNormalizationBuilder()","u":"%3Cinit%3E()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"inputAdd(double...)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"inputScale(double...)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"inputSubtract(double...)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeExtension","l":"installExtension(QuPathGUI)","u":"installExtension(qupath.lib.gui.QuPathGUI)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"learningRate(Double)","u":"learningRate(java.lang.Double)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"maskThreshold(Double)","u":"maskThreshold(java.lang.Double)"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.ImageNormalizationBuilder","l":"maxDimension(int)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"measureIntensity()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"measureIntensity(Collection)","u":"measureIntensity(java.util.Collection)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"measurements"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"measureShape"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"measureShape()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"minTrainMasks(Integer)","u":"minTrainMasks(java.lang.Integer)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"model"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"modelDirectory"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"modelDirectory(File)","u":"modelDirectory(java.io.File)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"noCellposeNormalization()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"normalizePercentiles(double, double)","u":"normalizePercentiles(double,double)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"normalizePercentiles(double, double, boolean, double)","u":"normalizePercentiles(double,double,boolean,double)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"normalizePercentilesGlobal(double, double, double)","u":"normalizePercentilesGlobal(double,double,double)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"nThreads"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"nThreads(int)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D.LogParser","l":"OMNI"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"op"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators","l":"OpCreators()","u":"%3Cinit%3E()"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner.EnvType","l":"OTHER"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"outputModelName"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"overlap"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"parameters"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.ImageNormalizationBuilder","l":"percentiles(double, double)","u":"percentiles(double,double)"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.ImageNormalizationBuilder","l":"perChannel(boolean)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"pixelSize"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"pixelSize(double)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"preprocess"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"preprocess(ImageOp...)","u":"preprocess(qupath.opencv.ops.ImageOp...)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"preprocessGlobal(OpCreators.TileOpCreator)","u":"preprocessGlobal(qupath.ext.biop.cellpose.OpCreators.TileOpCreator)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"readResultsAsynchronously()"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner","l":"runCommand(boolean)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"saveBuilder(String)","u":"saveBuilder(java.lang.String)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"saveTrainingImages"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"saveTrainingImages()"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"saveTrainingImages(boolean)"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner","l":"setArguments(List)","u":"setArguments(java.util.List)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeSetup","l":"setCellposePythonPath(String)","u":"setCellposePythonPath(java.lang.String)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeSetup","l":"setCondaPath(String)","u":"setCondaPath(java.lang.String)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeSetup","l":"setOmniposePythonPath(String)","u":"setOmniposePythonPath(java.lang.String)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"setOutputModelName(String)","u":"setOutputModelName(java.lang.String)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"setOverlap(int)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"showTrainingGraph()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"showTrainingGraph(boolean, boolean)","u":"showTrainingGraph(boolean,boolean)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"simplify(double)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"simplifyDistance"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner","l":"startWatchService(Path)","u":"startWatchService(java.nio.file.Path)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"tempDirectory(File)","u":"tempDirectory(java.io.File)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"tileHeight"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"tileSize(int)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"tileSize(int, int)","u":"tileSize(int,int)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"tileWidth"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner.EnvType","l":"toString()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"train()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"useGPU"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"useGPU(boolean)"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.ImageNormalizationBuilder","l":"useMask(boolean)"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"useOmnipose()"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"useTestDir"},{"p":"qupath.ext.biop.cellpose","c":"CellposeBuilder","l":"useTestDir(boolean)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D.LogParser","l":"valueOf(String)","u":"valueOf(java.lang.String)"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner.EnvType","l":"valueOf(String)","u":"valueOf(java.lang.String)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D.LogParser","l":"values()"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner.EnvType","l":"values()"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner.EnvType","l":"VENV"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner","l":"VirtualEnvironmentRunner(String, VirtualEnvironmentRunner.EnvType, String)","u":"%3Cinit%3E(java.lang.String,qupath.ext.biop.cmd.VirtualEnvironmentRunner.EnvType,java.lang.String)"},{"p":"qupath.ext.biop.cmd","c":"VirtualEnvironmentRunner","l":"VirtualEnvironmentRunner(String, VirtualEnvironmentRunner.EnvType, String, String)","u":"%3Cinit%3E(java.lang.String,qupath.ext.biop.cmd.VirtualEnvironmentRunner.EnvType,java.lang.String,java.lang.String)"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.ImageNormalizationBuilder","l":"zeroMeanUnitVariance()"},{"p":"qupath.ext.biop.cellpose","c":"OpCreators.ImageNormalizationBuilder","l":"zeroMeanUnitVariance(boolean)"}];updateSearchResults();
--------------------------------------------------------------------------------
/docs/module-search-index.js:
--------------------------------------------------------------------------------
1 | moduleSearchIndex = [];updateSearchResults();
--------------------------------------------------------------------------------
/docs/overview-summary.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | qupath-extension-cellpose 0.10.1-SNAPSHOT API
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
22 |
Helper class for creating (tile-based) ImageOps with parameters that are derived from an entire image or ROI.
86 |
87 | This is most useful for normalization, where statistics may need to be calculated across the image
88 | even if they are then applied locally (e.g. an offset and scaling factor).
Helper class for creating new ImageOps based upon other image properties.
82 |
83 | This addresses that problem that every ImageOp only knows about the image tile that it
84 | 'sees' at runtime.
85 | This means that all processing needs to be local.
86 |
87 | Often, we want ops to use information from across the entire image - particularly for
88 | normalization as a step in preprocessing, such as when normalizing to zero mean and unit variance
89 | across the entire image.
90 |
91 | Before this class, this was problematic because either the parameters needed to be calculated
92 | elsewhere (which was awkward), or else normalization would always treat each image tile independent -
93 | which could result in tiles within the same image being normalized in very different ways.
Builder for a OpCreators.TileOpCreator that can be used for image preprocessing
114 | using min/max percentiles or zero-mean-unit-variance normalization.
Builder for a OpCreators.TileOpCreator that can be used for image preprocessing
99 | using min/max percentiles or zero-mean-unit-variance normalization.
23 | * Ibnstalls Cellpose into QuPath, adding some metadata and adds the necessary global variables to QuPath's Preferences
24 | *
25 | * @author Olivier Burri
26 | */
27 | public class CellposeExtension implements QuPathExtension, GitHubProject {
28 |
29 | private static final Logger logger = LoggerFactory.getLogger(CellposeExtension.class);
30 | private boolean isInstalled = false;
31 |
32 | private static final LinkedHashMap SCRIPTS = new LinkedHashMap<>() {{
33 | put("Cellpose training script template", "scripts/Cellpose_training_template.groovy");
34 | put("Cellpose detection script template", "scripts/Cellpose_detection_template.groovy");
35 | put("Detect nuclei and cells using Cellpose.groovy", "scripts/Detect_nuclei_and_cells_using_Cellpose.groovy");
36 | put("Create Cellpose training and validation images", "scripts/Create_Cellpose_training_and_validation_images.groovy");
37 | }};
38 |
39 | @Override
40 | public GitHubRepo getRepository() {
41 | return GitHubRepo.create("Cellpose 2D QuPath Extension", "biop", "qupath-extension-cellpose");
42 | }
43 |
44 | @Override
45 | public void installExtension(QuPathGUI qupath) {
46 | if (isInstalled)
47 | return;
48 |
49 | SCRIPTS.entrySet().forEach(entry -> {
50 | String name = entry.getValue();
51 | String command = entry.getKey();
52 | try (InputStream stream = CellposeExtension.class.getClassLoader().getResourceAsStream(name)) {
53 | String script = new String(stream.readAllBytes(), "UTF-8");
54 | if (script != null) {
55 | MenuTools.addMenuItems(
56 | qupath.getMenu("Extensions>Cellpose", true),
57 | new Action(command, e -> openScript(qupath, script)));
58 | }
59 | } catch (Exception e) {
60 | logger.error(e.getLocalizedMessage(), e);
61 | }
62 | });
63 | // Get a copy of the cellpose options
64 | CellposeSetup options = CellposeSetup.getInstance();
65 |
66 |
67 | // Create the options we need
68 | StringProperty cellposePath = PathPrefs.createPersistentPreference("cellposePythonPath", "");
69 | StringProperty omniposePath = PathPrefs.createPersistentPreference("omniposePythonPath", "");
70 | StringProperty condaPath = PathPrefs.createPersistentPreference("condaPath", "");
71 |
72 | //Set options to current values
73 | options.setCellposePythonPath(cellposePath.get());
74 | options.setOmniposePythonPath(omniposePath.get());
75 | options.setCondaPath(condaPath.get());
76 |
77 | // Listen for property changes
78 | cellposePath.addListener((v, o, n) -> options.setCellposePythonPath(n));
79 | omniposePath.addListener((v, o, n) -> options.setOmniposePythonPath(n));
80 | condaPath.addListener((v, o, n) -> options.setCondaPath(n));
81 |
82 | PropertySheet.Item cellposePathItem = new PropertyItemBuilder<>(cellposePath, String.class)
83 | .propertyType(PropertyItemBuilder.PropertyType.GENERAL)
84 | .name("Cellpose 'python.exe' location")
85 | .category("Cellpose/Omnipose")
86 | .description("Enter the full path to your cellpose environment, including 'python.exe'\nDo not include quotes (\') or double quotes (\") around the path.")
87 | .build();
88 |
89 | PropertySheet.Item omniposePathItem = new PropertyItemBuilder<>(omniposePath, String.class)
90 | .propertyType(PropertyItemBuilder.PropertyType.GENERAL)
91 | .name("Omnipose 'python.exe' location")
92 | .category("Cellpose/Omnipose")
93 | .description("Enter the full path to your omnipose environment, including 'python.exe'\nDo not include quotes (\') or double quotes (\") around the path.")
94 | .build();
95 |
96 | PropertySheet.Item condaPathItem = new PropertyItemBuilder<>(condaPath, String.class)
97 | .propertyType(PropertyItemBuilder.PropertyType.GENERAL)
98 | .name("'Conda/Mamba' script location (optional)")
99 | .category("Cellpose/Omnipose")
100 | .description("The full path to you conda/mamba command, in case you want the extension to use the 'conda activate' command.\ne.g 'C:\\ProgramData\\Miniconda3\\condabin\\mamba.bat'\nDo not include quotes (\') or double quotes (\") around the path.")
101 | .build();
102 |
103 | // Add Permanent Preferences and Populate Preferences
104 | QuPathGUI.getInstance().getPreferencePane().getPropertySheet().getItems().addAll(cellposePathItem, omniposePathItem, condaPathItem);
105 |
106 | }
107 |
108 | @Override
109 | public String getName() {
110 | return "BIOP Cellpose extension";
111 | }
112 |
113 | @Override
114 | public String getDescription() {
115 | return "An extension that allows running a Cellpose/Omnipose Virtual Environment within QuPath";
116 | }
117 |
118 | @Override
119 | public Version getQuPathVersion() {
120 | return QuPathExtension.super.getQuPathVersion();
121 | }
122 |
123 | private static void openScript(QuPathGUI qupath, String script) {
124 | var editor = qupath.getScriptEditor();
125 | if (editor == null) {
126 | logger.error("No script editor is available!");
127 | return;
128 | }
129 | qupath.getScriptEditor().showScript("Cellpose detection", script);
130 | }
131 | }
--------------------------------------------------------------------------------
/src/main/java/qupath/ext/biop/cellpose/CellposeSetup.java:
--------------------------------------------------------------------------------
1 | package qupath.ext.biop.cellpose;
2 |
3 | import qupath.fx.dialogs.Dialogs;
4 |
5 | import java.io.File;
6 |
7 | public class CellposeSetup {
8 | private static final CellposeSetup instance = new CellposeSetup();
9 | private String cellposePythonPath = null;
10 | private String omniposePythonPath = null;
11 | private String condaPath = null;
12 |
13 | public static CellposeSetup getInstance() {
14 | return instance;
15 | }
16 |
17 | public String getCellposePythonPath() {
18 | return cellposePythonPath;
19 | }
20 |
21 | public void setCellposePythonPath(String path) {
22 | checkPath( path );
23 | this.cellposePythonPath = path;
24 | }
25 |
26 | public String getOmniposePythonPath() {
27 | return omniposePythonPath;
28 | }
29 |
30 | public void setOmniposePythonPath(String path) {
31 | checkPath( path );
32 | this.omniposePythonPath = path;
33 | }
34 |
35 | public void setCondaPath(String condaPath) {
36 | checkPath( condaPath );
37 | this.condaPath = condaPath; }
38 |
39 | public String getCondaPath() { return condaPath; }
40 |
41 | private void checkPath(String path) {
42 | // It should be a file and it should exist
43 | if(!path.trim().isEmpty()) {
44 | File toCheck = new File(path);
45 | if (!toCheck.exists())
46 | Dialogs.showWarningNotification("Cellpose/Omnipose extension: Path not found", "The path to \"" + path + "\" does not exist or does not point to a valid file.");
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/qupath/ext/biop/cmd/VirtualEnvironmentRunner.java:
--------------------------------------------------------------------------------
1 | package qupath.ext.biop.cmd;
2 |
3 | import org.controlsfx.tools.Platform;
4 | import org.slf4j.Logger;
5 | import org.slf4j.LoggerFactory;
6 |
7 | import java.io.BufferedReader;
8 | import java.io.File;
9 | import java.io.IOException;
10 | import java.io.InputStreamReader;
11 | import java.nio.file.*;
12 | import java.util.ArrayList;
13 | import java.util.Arrays;
14 | import java.util.Collections;
15 | import java.util.List;
16 | import java.util.concurrent.TimeUnit;
17 | import java.util.stream.Collectors;
18 |
19 | /**
20 | * A wrapper to run python virtualenvs, that tries to figure out the commands to run based on the environment type
21 | *
22 | * @author Olivier Burri
23 | * @author Romain Guiet
24 | * @author Nicolas Chiaruttini
25 | */
26 | public class VirtualEnvironmentRunner {
27 | private final static Logger logger = LoggerFactory.getLogger(VirtualEnvironmentRunner.class);
28 | private final EnvType envType;
29 |
30 | private final String condaPath;
31 |
32 | private WatchService watchService;
33 | private String name;
34 | private String pythonPath;
35 |
36 | private List arguments;
37 |
38 | private List logResults;
39 | private Process process;
40 |
41 | /**
42 | * This enum helps us figure out the type of virtualenv. We need to change {@link #getActivationCommand()} as well.
43 | */
44 | public enum EnvType {
45 | CONDA("Anaconda or Miniconda", "If you need to start your virtual environment with 'conda activate' then this is the type for you"),
46 | VENV( "Python venv", "If you use 'myenv/Scripts/activate' to call your virtual environment, then use this environment type"),
47 | EXE("Python Executable", "Use this if you'd like to call the python executable directly. Can be useful in case you have issues with conda."),
48 | OTHER("Other (Unsupported)", "Currently only conda and venv are supported.");
49 |
50 | private final String description;
51 | private final String help;
52 |
53 | EnvType(String description, String help) {
54 | this.description = description;
55 | this.help = help;
56 | }
57 |
58 | public String getDescription() {return this.description;}
59 |
60 | @Override
61 | public String toString() {
62 | return this.description;
63 | }
64 | }
65 |
66 | public VirtualEnvironmentRunner(String environmentNameOrPath, EnvType type, String name) {
67 | this(environmentNameOrPath, type, null, name );
68 | }
69 |
70 | public VirtualEnvironmentRunner(String environmentNameOrPath, EnvType type, String condaPath, String name) {
71 | this.pythonPath = environmentNameOrPath;
72 | this.envType = type;
73 | this.name = name;
74 | this.condaPath = condaPath;
75 | if (envType.equals(EnvType.OTHER))
76 | logger.error("Environment is unknown, please set the environment type to something different than 'Other'");
77 | }
78 |
79 | /**
80 | * This methods returns the command that will be needed by the {@link ProcessBuilder}, to start Python in the
81 | * desired virtual environment type.
82 | * Issue is that under windows you can just pile a bunch of Strings together, and it runs
83 | * In Mac or UNIX, the bash -c command must be followed by the full command enclosed in quotes
84 | * @return a list of Strings up to the start of the 'python' command. Use {@link #setArguments(List)} to set the actual command to run.
85 | */
86 | private List getActivationCommand() {
87 |
88 | Platform platform = Platform.getCurrent();
89 | List cmd = new ArrayList<>();
90 | String condaCommand = this.condaPath;
91 |
92 | switch (envType) {
93 | case CONDA:
94 | switch (platform) {
95 | case WINDOWS:
96 | if( condaCommand == null ) {
97 | condaCommand = "conda.bat";
98 | }
99 | // Adjust path to the folder with the env name based on the python location. On Windows it's at the root of the environment
100 | cmd.addAll(Arrays.asList("CALL", condaCommand, "activate", new File(pythonPath).getParent(), "&", "python"));
101 | break;
102 | case UNIX:
103 | case OSX:
104 | if( condaCommand == null ) {
105 | condaCommand = "conda";
106 | }
107 | // Adjust path to the folder with the env name based on the python location. In Linux/MacOS it's in the 'bin' sub folder
108 | cmd.addAll(Arrays.asList(condaCommand, "activate", new File(pythonPath).getParentFile().getParent(), ";", "python"));
109 | break;
110 | }
111 | break;
112 | case VENV:
113 | switch (platform) {
114 | case WINDOWS:
115 | cmd.add(new File(pythonPath, "Scripts/python").getAbsolutePath());
116 | break;
117 | case UNIX:
118 | case OSX:
119 | cmd.add(new File(pythonPath, "bin/python").getAbsolutePath());
120 | break;
121 | }
122 | break;
123 | case EXE:
124 | cmd.add(pythonPath);
125 | break;
126 | case OTHER:
127 | return null;
128 | }
129 | return cmd;
130 | }
131 |
132 | /**
133 | * This is the code you actually want to run after 'python'. For example adding {@code Arrays.asList("--version")}
134 | * should return the version of python that is being run.
135 | * @param arguments any cellpose or omnipose command line argument
136 | */
137 | public void setArguments(List arguments) {
138 | this.arguments = arguments;
139 | }
140 |
141 | /**
142 | * This builds, runs the command and outputs it to the logger as it is being run
143 | * @param waitUntilDone whether to wait for the process to end or not before exiting this method
144 | * @throws IOException in case there is an issue with the process
145 | */
146 | public void runCommand(boolean waitUntilDone) throws IOException {
147 |
148 | // Get how to start the command, based on the VENV Type
149 | List command = getActivationCommand();
150 |
151 | // Get the arguments specific to the command we want to run
152 | command.addAll(arguments);
153 |
154 | // OK so here we need to either just continue appending the commands in the case of windows
155 | // or making a big string for NIX systems
156 | List shell = new ArrayList<>();
157 |
158 | switch (Platform.getCurrent()) {
159 |
160 | case UNIX:
161 | case OSX:
162 | shell.addAll(Arrays.asList("bash", "-c"));
163 |
164 | // If there are spaces, then we should encapsulate the command with quotes
165 | command = command.stream().map(s -> {
166 | if (s.trim().contains(" "))
167 | return "\"" + s.trim() + "\"";
168 | return s;
169 | }).collect(Collectors.toList());
170 |
171 | // The last part needs to be sent as a single string, otherwise it does not run
172 | String cmdString = command.toString().replace(",","");
173 |
174 | shell.add(cmdString.substring(1, cmdString.length()-1));
175 | break;
176 |
177 | case WINDOWS:
178 | default:
179 | shell.addAll(Arrays.asList("cmd.exe", "/C"));
180 | shell.addAll(command);
181 | break;
182 | }
183 |
184 |
185 | // Try to make a command that is fully readable and that can be copy pasted
186 | List printable = shell.stream().map(s -> {
187 | // add quotes if there are spaces in the paths
188 | if (s.contains(" "))
189 | return "\"" + s + "\"";
190 | else
191 | return s;
192 | }).collect(Collectors.toList());
193 | String executionString = printable.toString().replace(",", "");
194 |
195 | logger.info("Executing command:\n{}", executionString.substring(1, executionString.length()-1));
196 | logger.info("This command should run directly if copy-pasted into your shell");
197 |
198 | // Now the cmd line is ready
199 | ProcessBuilder pb = new ProcessBuilder(shell).redirectErrorStream(true);
200 |
201 | // Start the process and follow it throughout
202 | this.process = pb.start();
203 |
204 | // Keep the log of the process
205 | logResults = new ArrayList<>();
206 |
207 | Thread t = new Thread(Thread.currentThread().getName() + "-" + this.process.hashCode()) {
208 | @Override
209 | public void run() {
210 | BufferedReader stdIn = new BufferedReader(new InputStreamReader(process.getInputStream()));
211 | try {
212 | for (String line = stdIn.readLine(); line != null; ) {
213 | logger.info("{}: {}", name, line);
214 | logResults.add(line);
215 | line = stdIn.readLine();
216 | }
217 | } catch (IOException e) {
218 | logger.warn(e.getMessage());
219 | }
220 | }
221 | };
222 | t.setDaemon(true);
223 | t.start();
224 |
225 |
226 | logger.info("Virtual Environment Runner Started");
227 |
228 | // If we ask to wait, let's wait directly here rather than handle it outside
229 | if(waitUntilDone) {
230 | try {
231 | this.process.waitFor();
232 | } catch (InterruptedException e) {
233 | logger.error(e.getMessage());
234 | }
235 | }
236 | }
237 |
238 | public Process getProcess() {
239 | return this.process;
240 | }
241 | public List getProcessLog() {
242 | return this.logResults;
243 | }
244 | public void startWatchService(Path folderToListen) throws IOException {
245 | this.watchService = FileSystems.getDefault().newWatchService();
246 |
247 | folderToListen.register(watchService, StandardWatchEventKinds.ENTRY_MODIFY);
248 | }
249 |
250 | public List getChangedFiles() throws InterruptedException {
251 | WatchKey key = watchService.poll(100, TimeUnit.MICROSECONDS);
252 | if (key == null)
253 | return Collections.emptyList();
254 | List> events = key.pollEvents();
255 | Listfiles = events.stream()
256 | .map(e -> ((Path) e.context()).toString())
257 | .collect(Collectors.toList());
258 | key.reset();
259 | return files;
260 | }
261 |
262 | public void closeWatchService() throws IOException {
263 | if (watchService != null ) watchService.close();
264 | }
265 | }
--------------------------------------------------------------------------------
/src/main/resources/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/src/main/resources/.gitkeep
--------------------------------------------------------------------------------
/src/main/resources/META-INF/services/qupath.lib.gui.extensions.QuPathExtension:
--------------------------------------------------------------------------------
1 | qupath.ext.biop.cellpose.CellposeExtension
--------------------------------------------------------------------------------
/src/main/resources/scripts/Cellpose_detection_template.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Cellpose Detection Template script
3 | * @author Olivier Burri
4 | *
5 | * This script is a template to detect objects using a Cellpose model from within QuPath.
6 | * After defining the builder, it will:
7 | * 1. Find all selected annotations in the current open ImageEntry
8 | * 2. Export the selected annotations to a temp folder that can be specified with tempDirectory()
9 | * 3. Run the cellpose detction using the defined model name or path
10 | * 4. Reimport the mask images into QuPath and create the desired objects with the selected statistics
11 | *
12 | * NOTE: that this template does not contain all options, but should help get you started
13 | * See all options in https://biop.github.io/qupath-extension-cellpose/qupath/ext/biop/cellpose/CellposeBuilder.html
14 | * and in https://cellpose.readthedocs.io/en/latest/command.html
15 | *
16 | * NOTE 2: You should change pathObjects get all annotations if you want to run for the project. By default this script
17 | * will only run on the selected annotations.
18 | */
19 |
20 | // Specify the model name (cyto, nuclei, cyto2, ... or a path to your custom model as a string)
21 | // Other models for Cellpose https://cellpose.readthedocs.io/en/latest/models.html
22 | // And for Omnipose: https://omnipose.readthedocs.io/models.html
23 | def pathModel = 'cyto3'
24 | def cellpose = Cellpose2D.builder( pathModel )
25 | .pixelSize( 0.5 ) // Resolution for detection in um
26 | .channels( 'DAPI' ) // Select detection channel(s)
27 | // .tempDirectory( new File( '/tmp' ) ) // Temporary directory to export images to. defaults to 'cellpose-temp' inside the QuPath Project
28 | // .preprocess( ImageOps.Filters.median( 1 ) ) // List of preprocessing ImageOps to run on the images before exporting them
29 | // .normalizePercentilesGlobal( 0.1, 99.8, 10 ) // Convenience global percentile normalization. arguments are percentileMin, percentileMax, dowsample.
30 | // .tileSize( 1024 ) // If your GPU can take it, make larger tiles to process fewer of them. Useful for Omnipose
31 | // .cellposeChannels( 1,2 ) // Overwrites the logic of this plugin with these two values. These will be sent directly to --chan and --chan2
32 | // .cellprobThreshold( 0.0 ) // Threshold for the mask detection, defaults to 0.0
33 | // .flowThreshold( 0.4 ) // Threshold for the flows, defaults to 0.4
34 | // .diameter( 15 ) // Median object diameter. Set to 0.0 for the `bact_omni` model or for automatic computation
35 | // .useOmnipose() // Use omnipose instead
36 | // .addParameter( "cluster" ) // Any parameter from cellpose or omnipose not available in the builder.
37 | // .addParameter( "save_flows" ) // Any parameter from cellpose or omnipose not available in the builder.
38 | // .addParameter( "anisotropy", "3" ) // Any parameter from cellpose or omnipose not available in the builder.
39 | // .cellExpansion( 5.0 ) // Approximate cells based upon nucleus expansion
40 | // .cellConstrainScale( 1.5 ) // Constrain cell expansion using nucleus size
41 | // .classify( "My Detections" ) // PathClass to give newly created objects
42 | // .measureShape() // Add shape measurements
43 | // .measureIntensity() // Add cell measurements (in all compartments)
44 | // .createAnnotations() // Make annotations instead of detections. This ignores cellExpansion
45 | // .simplify( 0 ) // Simplification 1.6 by default, set to 0 to get the cellpose masks as precisely as possible
46 | .build()
47 |
48 | // Run detection for the selected objects
49 | def imageData = getCurrentImageData()
50 | def pathObjects = getSelectedObjects() // To process only selected annotations, useful while testing
51 | // def pathObjects = getAnnotationObjects() // To process all annotations. For working in batch mode
52 | if (pathObjects.isEmpty()) {
53 | Dialogs.showErrorMessage( "Cellpose", "Please select a parent object!" )
54 | return
55 | }
56 |
57 | cellpose.detectObjects( imageData, pathObjects )
58 |
59 | // You could do some post-processing here, e.g. to remove objects that are too small, but it is usually better to
60 | // do this in a separate script so you can see the results before deleting anything.
61 |
62 | println 'Cellpose detection script done'
63 |
64 | import qupath.ext.biop.cellpose.Cellpose2D
--------------------------------------------------------------------------------
/src/main/resources/scripts/Cellpose_training_template.groovy:
--------------------------------------------------------------------------------
1 | /**
2 | * Cellpose Training Template script
3 | * @author Olivier Burri
4 | *
5 | * This script is a template to train a Cellpose model from QuPath.
6 | * It will:
7 | * 1. Go through the current project and save all "Training" and "Validation" regions into a temp folder (inside the current project)
8 | * 2. Run the cellpose training via command line with the parameters that you specify. See https://biop.github.io/qupath-extension-cellpose/qupath/ext/biop/cellpose/CellposeBuilder.html
9 | * for the parameters that you can specify through the extension and https://cellpose.readthedocs.io/en/latest/command.html for the Specific cellpose parameters
10 | * 3. Recover the model file after training, and copy it to where you defined in the builder, returning the location of the model file
11 | * 4. If it detects the run-cellpose-qc.py file in your QuPath Extensions Folder, it will run validation for this model
12 | * 5. It will return a ResultsTable with the training results and a graph of the training losses
13 | *
14 | * You can then use the model file to run Cellpose detection on your images
15 | *
16 | * NOTE that this template does not contain all options for training, But should help get you started
17 | */
18 |
19 | // First we need to create a Cellpose2D builder and add all parameters that we want to use for training
20 | def cellpose = Cellpose2D.builder( "cyto3" ) // Can choose "None" if you want to train from scratch
21 | .channels( "DAPI", "CY3" ) // or work with .cellposeChannels( channel1, channel2 ) and follow the cellpose way
22 | // .preprocess( ImageOps.Filters.gaussianBlur( 1 ) ) // Optional preprocessing QuPath Ops
23 | // .epochs(500) // Optional: will default to 500
24 | // .groundTruthDirectory( new File( "/my/ground/truth/folder" ) ) // Optional: If you wish to save your GT elsewhere than the QuPath Project
25 | // .learningRate(0.2) // Optional: Will default to 0.2
26 | // .batchSize(8) // Optional: Will default to 8
27 | // .minTrainMasks(5) // Optional: Will default to 5
28 | // .addParameter("save_flows") // Any parameter from cellpose not available in the builder. See https://cellpose.readthedocs.io/en/latest/command.html
29 | // .addParameter("anisotropy", "3") // Any parameter from cellpose not available in the builder. See https://cellpose.readthedocs.io/en/latest/command.html
30 | // .modelDirectory( new File("D:/models/" ) ) // Optional place to store resulting model. Will default to QuPath project root, and make a 'models' folder
31 | // .saveBuilder("My Builder") // Optional: Will save a builder json file that can be reloaded with Cellpose2D.builder(File builderFile)
32 | // .saveTrainingImages(false) // Optional - default true : Will skip resaving training images. WARNING: TO USE AT YOUR OWN RISK !!!
33 | // .useTestDir(false) // Optional - default true : put false ONLY TO TRAIN OMNIPOSE MODELS
34 | .build()
35 |
36 | // Now we can train a new model
37 | def resultModel = cellpose.train()
38 |
39 | // Pick up results to see how the training was performed
40 | println "Model Saved under: "
41 | println resultModel.getAbsolutePath().toString().replace('\\', '/') // To make it easier to copy paste in windows
42 |
43 | // You can get a ResultsTable of the training.
44 | def results = cellpose.getTrainingResults()
45 | results.show("Training Results")
46 |
47 | // You can get a results table with the QC results to visualize
48 | def qcResults = cellpose.getQCResults()
49 | qcResults.show("QC Results")
50 |
51 | // Finally you have access to a very simple graph of the loss during training
52 | cellpose.showTrainingGraph()
53 |
54 | println "Training Script Finished"
55 |
56 | import qupath.ext.biop.cellpose.Cellpose2D
57 |
--------------------------------------------------------------------------------
/src/main/resources/scripts/Create_Cellpose_training_and_validation_images.groovy:
--------------------------------------------------------------------------------
1 | package scripts
2 |
3 | import qupath.ext.biop.cellpose.Cellpose2D
4 |
5 | /* Last tested on QuPath-0.3.2
6 | *
7 | * This scripts requires the qupath-extension-cellpose
8 | * https://github.com/BIOP/qupath-extension-cellpose
9 | *
10 | * To use this script:
11 | * 1. create "Training" and "Validation" rectangles in images in your project
12 | * 2. Create **annotations** inside these rectangles
13 | * 3. Save your images
14 | * 4. Run this script
15 | *
16 | * It will create a folder 'cellpose-training' at the root of your QuPath folder
17 | * which you can then use for running cellpose training.
18 | * Note that you can run cellpose training directly within QuPath as well
19 | * By using the script "Cellpose_training .groovy"
20 | */
21 |
22 | // Build a Cellpose instance for saving the image pairs
23 | def cellpose = Cellpose2D.builder( "None" ) // No effect, as this script only exports the images
24 | // .channels( "DAPI", "CY3" ) // Optional: Image channels to export
25 | // .preprocess( ImageOps.Filters.gaussianBlur( 1 ) ) // Optional: preprocessing QuPath Ops
26 | .build()
27 |
28 | // Just save the training images for cellpose, no training is made
29 | cellpose.saveTrainingImages()
30 |
31 | println "\nTraining and validation images saved under:\n\n${cellpose.getTrainingDirectory()}\n${cellpose.getValidationDirectory()}\n"
--------------------------------------------------------------------------------
/src/main/resources/scripts/Detect_nuclei_and_cells_using_Cellpose.groovy:
--------------------------------------------------------------------------------
1 | /* Last tested on QuPath-0.5.1
2 | *
3 | * This scripts requires qupath-extension-cellpose
4 | * cf https://github.com/BIOP/qupath-extension-cellpose
5 | */
6 |
7 | // some qp that we need to detect objects and measure them
8 | def imageData = getCurrentImageData()
9 | def server = getCurrentServer()
10 | def cal = server.getPixelCalibration()
11 | def downsample = 1.0
12 |
13 | // if nothing Annotation is selected , let's create a full image annotation
14 | def pathObjects = getSelectedObjects()
15 | if (pathObjects.isEmpty()) {
16 | createSelectAllObject(true)
17 | }
18 |
19 | clearDetections()
20 |
21 | // Create a Cellpose detectors for cyto and nuclei
22 | def pathModel_cyto = 'cyto3'
23 | def cellpose_cyto = Cellpose2D.builder( pathModel_cyto )
24 | .channels( "HCS","DAPI" )
25 | .pixelSize( 0.3 ) // Resolution for detection
26 | .diameter(30 ) // Median object diameter. Set to 0.0 for the `bact_omni` model or for automatic computation
27 | .measureShape() // Add shape measurements
28 | .measureIntensity() // Add cell measurements (in all compartments)
29 | .build()
30 |
31 | def pathModel_nuc = 'cyto3'
32 | def cellpose_nuc = Cellpose2D.builder( pathModel_nuc )
33 | .channels("DAPI" )
34 | .pixelSize( 0.3 ) // Resolution for detection
35 | .diameter(10) // Median object diameter. Set to 0.0 for the `bact_omni` model or for automatic computation
36 | .build()
37 |
38 | // Run detection for the selected pathObjects and store resulting detections
39 | cellpose_cyto.detectObjects(imageData, pathObjects)
40 | cytos = getDetectionObjects()
41 | cellpose_nuc.detectObjects(imageData, pathObjects)
42 | nucs = getDetectionObjects()
43 | //if one wants to check how each step is doing, uncomment the 4 lines below
44 | //cytos.each{ it.setPathClass(getPathClass("Cyto"))}
45 | //nucs.each{ it.setPathClass(getPathClass("Nuc"))}
46 | //addObjects(cytos) // needed because cellpose detectors remove existing detections
47 | //return
48 |
49 | // make sure to clear everything
50 | clearDetections()
51 |
52 | // Combine cytos and nuclei detections to create cell objects
53 | // (we simply check that the nuclei center is inside the cell center)
54 | cells = []
55 | cytos.each{ cyto ->
56 | nucs.each{ nuc ->
57 | if ( cyto.getROI().contains( nuc.getROI().getCentroidX() , nuc.getROI().getCentroidY())){
58 | cells.add(PathObjects.createCellObject(cyto.getROI(), nuc.getROI(), getPathClass("Cellpose"), null ));
59 | }
60 | }
61 | }
62 | addObjects(cells)
63 |
64 | // Intensity & Shape Measurements
65 | // adapted from : https://forum.image.sc/t/transferring-segmentation-predictions-from-custom-masks-to-qupath/43408/12
66 | def measurements = ObjectMeasurements.Measurements.values() as List
67 | def compartments = ObjectMeasurements.Compartments.values() as List // Won't mean much if they aren't cells...
68 | def shape = ObjectMeasurements.ShapeFeatures.values() as List
69 | def cells = getCellObjects()
70 | for ( cell in cells) {
71 | ObjectMeasurements.addIntensityMeasurements( server, cell, downsample, measurements, compartments )
72 | ObjectMeasurements.addCellShapeMeasurements( cell, cal, shape )
73 | }
74 | fireHierarchyUpdate()
75 | println 'Done!'
76 |
77 | /*
78 | * imports
79 | */
80 | import qupath.ext.biop.cellpose.Cellpose2D
81 | import qupath.lib.analysis.features.ObjectMeasurements
82 |
--------------------------------------------------------------------------------
/src/test/java/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/src/test/java/.gitkeep
--------------------------------------------------------------------------------
CellposeBuilder.cellprobThreshold(Double)