├── .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 | 4 | 5 | All Classes and Interfaces (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 27 |
28 | 52 |
53 |
54 |
55 |

All Classes and Interfaces

56 |
57 |
58 |
59 |
60 |
61 |
Class
62 |
Description
63 | 64 |
65 |
Dense object detection based on the cellpose and omnipose publications
66 |
67 | 68 |
 
69 | 70 |
71 |
Cell detection based on the following method:
72 |
73 | 74 |
75 |
Install Cellpose as an extension.
76 |
77 | 78 |
 
79 | 80 |
81 |
Helper class for creating new ImageOps based upon other image properties.
82 |
83 | 84 |
85 |
Builder for a OpCreators.TileOpCreator that can be used for image preprocessing 86 | using min/max percentiles or zero-mean-unit-variance normalization.
87 |
88 | 89 |
90 |
Tile op creator that computes offset and scale values across the full image 91 | to normalize using min and max percentiles.
92 |
93 | 94 |
95 |
Helper class for creating (tile-based) ImageOps with parameters that are derived from an entire image or ROI.
96 |
97 | 98 |
99 |
Tile op creator that computes offset and scale values across the full image 100 | to normalize to zero mean and unit variance.
101 |
102 | 103 |
104 |
A wrapper to run python virtualenvs, that tries to figure out the commands to run based on the environment type
105 |
106 | 107 |
108 |
This enum helps us figure out the type of virtualenv.
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 | 117 | 118 | -------------------------------------------------------------------------------- /docs/allpackages-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | All Packages (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 48 |
49 |
50 |
51 |

All Packages

52 |
53 |
Package Summary
54 |
55 |
Package
56 |
Description
57 | 58 |
 
59 | 60 |
 
61 |
62 |
63 |
64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /docs/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Deprecated List (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 48 |
49 |
50 |
51 |

Deprecated API

52 |

Contents

53 | 56 |
57 | 72 |
73 |
74 |
75 | 76 | 77 | -------------------------------------------------------------------------------- /docs/element-list: -------------------------------------------------------------------------------- 1 | qupath.ext.biop.cellpose 2 | qupath.ext.biop.cmd 3 | -------------------------------------------------------------------------------- /docs/help-doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | API Help (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 55 |
56 |
57 |

JavaDoc Help

58 | 78 |
79 |
80 |

Navigation

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 | 92 |
93 |
94 |
95 |

Kinds of Pages

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 |
179 |
180 | 181 | 182 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Overview (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 48 |
49 |
50 |
51 |

qupath-extension-cellpose 0.10.1-SNAPSHOT API

52 |
53 |
54 |
Packages
55 |
56 |
Package
57 |
Description
58 | 59 |
 
60 | 61 |
 
62 |
63 |
64 |
65 |
66 |
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)","u":"detectObjects(qupath.lib.images.ImageData,java.util.Collection)"},{"p":"qupath.ext.biop.cellpose","c":"Cellpose2D","l":"detectObjectsImpl(ImageData, Collection)","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 |

index.html

23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/overview-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Class Hierarchy (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 48 |
49 |
50 |
51 |

Hierarchy For All Packages

52 | Package Hierarchies: 53 | 57 |
58 |
59 |

Class Hierarchy

60 | 75 |
76 |
77 |

Interface Hierarchy

78 | 81 |
82 |
83 |

Enum Class Hierarchy

84 | 96 |
97 |
98 |
99 |
100 | 101 | 102 | -------------------------------------------------------------------------------- /docs/package-search-index.js: -------------------------------------------------------------------------------- 1 | packageSearchIndex = [{"l":"All Packages","u":"allpackages-index.html"},{"l":"qupath.ext.biop.cellpose"},{"l":"qupath.ext.biop.cmd"}];updateSearchResults(); -------------------------------------------------------------------------------- /docs/qupath/ext/biop/cellpose/OpCreators.PercentileTileOpCreator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OpCreators.PercentileTileOpCreator (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 27 |
28 | 67 |
68 |
69 | 70 |
71 | 72 |

Class OpCreators.PercentileTileOpCreator

73 |
74 |
java.lang.Object 75 |
qupath.ext.biop.cellpose.OpCreators.PercentileTileOpCreator
76 |
77 |
78 |
79 |
All Implemented Interfaces:
80 |
OpCreators.TileOpCreator
81 |
82 |
83 |
Enclosing class:
84 |
OpCreators
85 |
86 |
87 |
public static class OpCreators.PercentileTileOpCreator 88 | extends Object
89 |
Tile op creator that computes offset and scale values across the full image 90 | to normalize using min and max percentiles.
91 |
92 |
93 |
    94 | 95 |
  • 96 |
    97 |

    Method Summary

    98 |
    99 |
    100 |
    101 |
    102 |
    Modifier and Type
    103 |
    Method
    104 |
    Description
    105 |
    protected List<qupath.opencv.ops.ImageOp>
    106 |
    compute(org.bytedeco.opencv.opencv_core.Mat mat)
    107 |
     
    108 |
    List<qupath.opencv.ops.ImageOp>
    109 |
    createOps(qupath.opencv.ops.ImageDataOp op, 110 | qupath.lib.images.ImageData<BufferedImage> imageData, 111 | qupath.lib.roi.interfaces.ROI mask, 112 | qupath.lib.regions.ImagePlane plane)
    113 |
    114 |
    Compute the (tile-based) ops from the image.
    115 |
    116 |
    117 |
    118 |
    119 |
    120 |

    Methods inherited from class java.lang.Object

    121 | clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    122 |
    123 |
  • 124 |
125 |
126 |
127 |
    128 | 129 |
  • 130 |
    131 |

    Method Details

    132 |
      133 |
    • 134 |
      135 |

      compute

      136 |
      protected List<qupath.opencv.ops.ImageOp> compute(org.bytedeco.opencv.opencv_core.Mat mat)
      137 |
      138 |
    • 139 |
    • 140 |
      141 |

      createOps

      142 |
      public List<qupath.opencv.ops.ImageOp> createOps(qupath.opencv.ops.ImageDataOp op, 143 | qupath.lib.images.ImageData<BufferedImage> imageData, 144 | qupath.lib.roi.interfaces.ROI mask, 145 | qupath.lib.regions.ImagePlane plane) 146 | throws IOException
      147 |
      Description copied from interface: OpCreators.TileOpCreator
      148 |
      Compute the (tile-based) ops from the image.
      149 |
      150 |
      Specified by:
      151 |
      createOps in interface OpCreators.TileOpCreator
      152 |
      Parameters:
      153 |
      op - the data op, which determines how to extract channels from the image data
      154 |
      imageData - the image data to process
      155 |
      mask - ROI mask that may be used to restrict the region being considered (optional)
      156 |
      plane - the 2D image plane to use; if not provided, the plane from any ROI will be used, or otherwise the default plane
      157 |
      Returns:
      158 |
      Throws:
      159 |
      IOException
      160 |
      161 |
      162 |
    • 163 |
    164 |
    165 |
  • 166 |
167 |
168 | 169 |
170 |
171 |
172 | 173 | 174 | -------------------------------------------------------------------------------- /docs/qupath/ext/biop/cellpose/OpCreators.TileOpCreator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OpCreators.TileOpCreator (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 27 |
28 | 67 |
68 |
69 | 70 |
71 | 72 |

Interface OpCreators.TileOpCreator

73 |
74 |
75 |
76 |
All Known Implementing Classes:
77 |
OpCreators.PercentileTileOpCreator, OpCreators.ZeroMeanVarianceTileOpCreator
78 |
79 |
80 |
Enclosing class:
81 |
OpCreators
82 |
83 |
84 |
public static interface OpCreators.TileOpCreator
85 |
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).

89 |
90 |
91 |
    92 | 93 |
  • 94 |
    95 |

    Method Summary

    96 |
    97 |
    98 |
    99 |
    100 |
    Modifier and Type
    101 |
    Method
    102 |
    Description
    103 |
    List<qupath.opencv.ops.ImageOp>
    104 |
    createOps(qupath.opencv.ops.ImageDataOp op, 105 | qupath.lib.images.ImageData<BufferedImage> imageData, 106 | qupath.lib.roi.interfaces.ROI mask, 107 | qupath.lib.regions.ImagePlane plane)
    108 |
    109 |
    Compute the (tile-based) ops from the image.
    110 |
    111 |
    112 |
    113 |
    114 |
    115 |
  • 116 |
117 |
118 |
119 |
    120 | 121 |
  • 122 |
    123 |

    Method Details

    124 |
      125 |
    • 126 |
      127 |

      createOps

      128 |
      List<qupath.opencv.ops.ImageOp> createOps(qupath.opencv.ops.ImageDataOp op, 129 | qupath.lib.images.ImageData<BufferedImage> imageData, 130 | qupath.lib.roi.interfaces.ROI mask, 131 | qupath.lib.regions.ImagePlane plane) 132 | throws IOException
      133 |
      Compute the (tile-based) ops from the image.
      134 |
      135 |
      Parameters:
      136 |
      op - the data op, which determines how to extract channels from the image data
      137 |
      imageData - the image data to process
      138 |
      mask - ROI mask that may be used to restrict the region being considered (optional)
      139 |
      plane - the 2D image plane to use; if not provided, the plane from any ROI will be used, or otherwise the default plane
      140 |
      Returns:
      141 |
      Throws:
      142 |
      IOException
      143 |
      144 |
      145 |
    • 146 |
    147 |
    148 |
  • 149 |
150 |
151 | 152 |
153 |
154 |
155 | 156 | 157 | -------------------------------------------------------------------------------- /docs/qupath/ext/biop/cellpose/OpCreators.ZeroMeanVarianceTileOpCreator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OpCreators.ZeroMeanVarianceTileOpCreator (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 27 |
28 | 67 |
68 |
69 | 70 |
71 | 72 |

Class OpCreators.ZeroMeanVarianceTileOpCreator

73 |
74 |
java.lang.Object 75 |
qupath.ext.biop.cellpose.OpCreators.ZeroMeanVarianceTileOpCreator
76 |
77 |
78 |
79 |
All Implemented Interfaces:
80 |
OpCreators.TileOpCreator
81 |
82 |
83 |
Enclosing class:
84 |
OpCreators
85 |
86 |
87 |
public static class OpCreators.ZeroMeanVarianceTileOpCreator 88 | extends Object
89 |
Tile op creator that computes offset and scale values across the full image 90 | to normalize to zero mean and unit variance.
91 |
92 |
93 |
    94 | 95 |
  • 96 |
    97 |

    Method Summary

    98 |
    99 |
    100 |
    101 |
    102 |
    Modifier and Type
    103 |
    Method
    104 |
    Description
    105 |
    protected List<qupath.opencv.ops.ImageOp>
    106 |
    compute(org.bytedeco.opencv.opencv_core.Mat mat)
    107 |
     
    108 |
    List<qupath.opencv.ops.ImageOp>
    109 |
    createOps(qupath.opencv.ops.ImageDataOp op, 110 | qupath.lib.images.ImageData<BufferedImage> imageData, 111 | qupath.lib.roi.interfaces.ROI mask, 112 | qupath.lib.regions.ImagePlane plane)
    113 |
    114 |
    Compute the (tile-based) ops from the image.
    115 |
    116 |
    117 |
    118 |
    119 |
    120 |

    Methods inherited from class java.lang.Object

    121 | clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    122 |
    123 |
  • 124 |
125 |
126 |
127 |
    128 | 129 |
  • 130 |
    131 |

    Method Details

    132 |
      133 |
    • 134 |
      135 |

      compute

      136 |
      protected List<qupath.opencv.ops.ImageOp> compute(org.bytedeco.opencv.opencv_core.Mat mat)
      137 |
      138 |
    • 139 |
    • 140 |
      141 |

      createOps

      142 |
      public List<qupath.opencv.ops.ImageOp> createOps(qupath.opencv.ops.ImageDataOp op, 143 | qupath.lib.images.ImageData<BufferedImage> imageData, 144 | qupath.lib.roi.interfaces.ROI mask, 145 | qupath.lib.regions.ImagePlane plane) 146 | throws IOException
      147 |
      Description copied from interface: OpCreators.TileOpCreator
      148 |
      Compute the (tile-based) ops from the image.
      149 |
      150 |
      Specified by:
      151 |
      createOps in interface OpCreators.TileOpCreator
      152 |
      Parameters:
      153 |
      op - the data op, which determines how to extract channels from the image data
      154 |
      imageData - the image data to process
      155 |
      mask - ROI mask that may be used to restrict the region being considered (optional)
      156 |
      plane - the 2D image plane to use; if not provided, the plane from any ROI will be used, or otherwise the default plane
      157 |
      Returns:
      158 |
      Throws:
      159 |
      IOException
      160 |
      161 |
      162 |
    • 163 |
    164 |
    165 |
  • 166 |
167 |
168 | 169 |
170 |
171 |
172 | 173 | 174 | -------------------------------------------------------------------------------- /docs/qupath/ext/biop/cellpose/OpCreators.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OpCreators (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 27 |
28 | 67 |
68 |
69 | 70 |
71 | 72 |

Class OpCreators

73 |
74 |
java.lang.Object 75 |
qupath.ext.biop.cellpose.OpCreators
76 |
77 |
78 |
79 |
public class OpCreators 80 | extends Object
81 |
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.

94 |
95 |
Since:
96 |
v0.4.0
97 |
98 |
99 |
100 |
    101 | 102 |
  • 103 |
    104 |

    Nested Class Summary

    105 |
    Nested Classes
    106 |
    107 |
    Modifier and Type
    108 |
    Class
    109 |
    Description
    110 |
    static class 
    111 | 112 |
    113 |
    Builder for a OpCreators.TileOpCreator that can be used for image preprocessing 114 | using min/max percentiles or zero-mean-unit-variance normalization.
    115 |
    116 |
    static class 
    117 | 118 |
    119 |
    Tile op creator that computes offset and scale values across the full image 120 | to normalize using min and max percentiles.
    121 |
    122 |
    static interface 
    123 | 124 |
    125 |
    Helper class for creating (tile-based) ImageOps with parameters that are derived from an entire image or ROI.
    126 |
    127 |
    static class 
    128 | 129 |
    130 |
    Tile op creator that computes offset and scale values across the full image 131 | to normalize to zero mean and unit variance.
    132 |
    133 |
    134 |
    135 |
  • 136 | 137 |
  • 138 |
    139 |

    Constructor Summary

    140 |
    Constructors
    141 |
    142 |
    Constructor
    143 |
    Description
    144 | 145 |
     
    146 |
    147 |
    148 |
  • 149 | 150 |
  • 151 |
    152 |

    Method Summary

    153 |
    154 |
    155 |
    156 |
    157 |
    Modifier and Type
    158 |
    Method
    159 |
    Description
    160 | 161 | 162 |
    163 |
    Build a normalization op that can be based upon the entire (2D) image, rather than only local tiles.
    164 |
    165 |
    166 |
    167 |
    168 |
    169 |

    Methods inherited from class java.lang.Object

    170 | clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    171 |
    172 |
  • 173 |
174 |
175 |
176 |
    177 | 178 |
  • 179 |
    180 |

    Constructor Details

    181 |
      182 |
    • 183 |
      184 |

      OpCreators

      185 |
      public OpCreators()
      186 |
      187 |
    • 188 |
    189 |
    190 |
  • 191 | 192 |
  • 193 |
    194 |

    Method Details

    195 |
      196 |
    • 197 |
      198 |

      imageNormalizationBuilder

      199 |
      public static OpCreators.ImageNormalizationBuilder imageNormalizationBuilder()
      200 |
      Build a normalization op that can be based upon the entire (2D) image, rather than only local tiles. 201 |

      202 | Note that currently this requires downsampling the image to a manageable size.

      203 |
      204 |
      Returns:
      205 |
      206 |
      207 |
    • 208 |
    209 |
    210 |
  • 211 |
212 |
213 | 214 |
215 |
216 |
217 | 218 | 219 | -------------------------------------------------------------------------------- /docs/qupath/ext/biop/cellpose/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | qupath.ext.biop.cellpose (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 27 |
28 | 60 |
61 |
62 |
63 |

Package qupath.ext.biop.cellpose

64 |
65 |
66 |
package qupath.ext.biop.cellpose
67 |
68 |
    69 |
  • 70 |
    71 |
    72 |
    73 |
    74 |
    Class
    75 |
    Description
    76 | 77 |
    78 |
    Dense object detection based on the cellpose and omnipose publications
    79 |
    80 | 81 |
     
    82 | 83 |
    84 |
    Cell detection based on the following method:
    85 |
    86 | 87 |
    88 |
    Install Cellpose as an extension.
    89 |
    90 | 91 |
     
    92 | 93 |
    94 |
    Helper class for creating new ImageOps based upon other image properties.
    95 |
    96 | 97 |
    98 |
    Builder for a OpCreators.TileOpCreator that can be used for image preprocessing 99 | using min/max percentiles or zero-mean-unit-variance normalization.
    100 |
    101 | 102 |
    103 |
    Tile op creator that computes offset and scale values across the full image 104 | to normalize using min and max percentiles.
    105 |
    106 | 107 |
    108 |
    Helper class for creating (tile-based) ImageOps with parameters that are derived from an entire image or ROI.
    109 |
    110 | 111 |
    112 |
    Tile op creator that computes offset and scale values across the full image 113 | to normalize to zero mean and unit variance.
    114 |
    115 |
    116 |
    117 |
    118 |
  • 119 |
120 |
121 |
122 |
123 |
124 | 125 | 126 | -------------------------------------------------------------------------------- /docs/qupath/ext/biop/cellpose/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | qupath.ext.biop.cellpose Class Hierarchy (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 48 |
49 |
50 |
51 |

Hierarchy For Package qupath.ext.biop.cellpose

52 | Package Hierarchies: 53 | 56 |
57 |
58 |

Class Hierarchy

59 | 73 |
74 |
75 |

Interface Hierarchy

76 | 79 |
80 |
81 |

Enum Class Hierarchy

82 | 93 |
94 |
95 |
96 |
97 | 98 | 99 | -------------------------------------------------------------------------------- /docs/qupath/ext/biop/cmd/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | qupath.ext.biop.cmd (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 27 |
28 | 60 |
61 |
62 |
63 |

Package qupath.ext.biop.cmd

64 |
65 |
66 |
package qupath.ext.biop.cmd
67 |
68 |
    69 |
  • 70 |
    71 |
    72 |
    73 |
    74 |
    Class
    75 |
    Description
    76 | 77 |
    78 |
    A wrapper to run python virtualenvs, that tries to figure out the commands to run based on the environment type
    79 |
    80 | 81 |
    82 |
    This enum helps us figure out the type of virtualenv.
    83 |
    84 |
    85 |
    86 |
    87 |
  • 88 |
89 |
90 |
91 |
92 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /docs/qupath/ext/biop/cmd/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | qupath.ext.biop.cmd Class Hierarchy (qupath-extension-cellpose 0.10.1-SNAPSHOT API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 48 |
49 |
50 |
51 |

Hierarchy For Package qupath.ext.biop.cmd

52 | Package Hierarchies: 53 | 56 |
57 |
58 |

Class Hierarchy

59 | 66 |
67 |
68 |

Enum Class Hierarchy

69 | 80 |
81 |
82 |
83 |
84 | 85 | 86 | -------------------------------------------------------------------------------- /docs/resources/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/resources/glass.png -------------------------------------------------------------------------------- /docs/resources/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/resources/x.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/script-dir/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-bg_glass_65_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/script-dir/images/ui-bg_glass_65_dadada_1x400.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/script-dir/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/script-dir/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/script-dir/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/script-dir/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/script-dir/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/script-dir/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/script-dir/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/script-dir/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /docs/script-dir/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/docs/script-dir/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /docs/script-dir/jquery-ui.structure.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.12.1 - 2018-12-06 2 | * http://jqueryui.com 3 | * Copyright jQuery Foundation and other contributors; Licensed MIT */ 4 | 5 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0} -------------------------------------------------------------------------------- /docs/script.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, 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 | var moduleSearchIndex; 27 | var packageSearchIndex; 28 | var typeSearchIndex; 29 | var memberSearchIndex; 30 | var tagSearchIndex; 31 | function loadScripts(doc, tag) { 32 | createElem(doc, tag, 'search.js'); 33 | 34 | createElem(doc, tag, 'module-search-index.js'); 35 | createElem(doc, tag, 'package-search-index.js'); 36 | createElem(doc, tag, 'type-search-index.js'); 37 | createElem(doc, tag, 'member-search-index.js'); 38 | createElem(doc, tag, 'tag-search-index.js'); 39 | } 40 | 41 | function createElem(doc, tag, path) { 42 | var script = doc.createElement(tag); 43 | var scriptElement = doc.getElementsByTagName(tag)[0]; 44 | script.src = pathtoroot + path; 45 | scriptElement.parentNode.insertBefore(script, scriptElement); 46 | } 47 | 48 | function show(tableId, selected, columns) { 49 | if (tableId !== selected) { 50 | document.querySelectorAll('div.' + tableId + ':not(.' + selected + ')') 51 | .forEach(function(elem) { 52 | elem.style.display = 'none'; 53 | }); 54 | } 55 | document.querySelectorAll('div.' + selected) 56 | .forEach(function(elem, index) { 57 | elem.style.display = ''; 58 | var isEvenRow = index % (columns * 2) < columns; 59 | elem.classList.remove(isEvenRow ? oddRowColor : evenRowColor); 60 | elem.classList.add(isEvenRow ? evenRowColor : oddRowColor); 61 | }); 62 | updateTabs(tableId, selected); 63 | } 64 | 65 | function updateTabs(tableId, selected) { 66 | document.querySelector('div#' + tableId +' .summary-table') 67 | .setAttribute('aria-labelledby', selected); 68 | document.querySelectorAll('button[id^="' + tableId + '"]') 69 | .forEach(function(tab, index) { 70 | if (selected === tab.id || (tableId === selected && index === 0)) { 71 | tab.className = activeTableTab; 72 | tab.setAttribute('aria-selected', true); 73 | tab.setAttribute('tabindex',0); 74 | } else { 75 | tab.className = tableTab; 76 | tab.setAttribute('aria-selected', false); 77 | tab.setAttribute('tabindex',-1); 78 | } 79 | }); 80 | } 81 | 82 | function switchTab(e) { 83 | var selected = document.querySelector('[aria-selected=true]'); 84 | if (selected) { 85 | if ((e.keyCode === 37 || e.keyCode === 38) && selected.previousSibling) { 86 | // left or up arrow key pressed: move focus to previous tab 87 | selected.previousSibling.click(); 88 | selected.previousSibling.focus(); 89 | e.preventDefault(); 90 | } else if ((e.keyCode === 39 || e.keyCode === 40) && selected.nextSibling) { 91 | // right or down arrow key pressed: move focus to next tab 92 | selected.nextSibling.click(); 93 | selected.nextSibling.focus(); 94 | e.preventDefault(); 95 | } 96 | } 97 | } 98 | 99 | var updateSearchResults = function() {}; 100 | 101 | function indexFilesLoaded() { 102 | return moduleSearchIndex 103 | && packageSearchIndex 104 | && typeSearchIndex 105 | && memberSearchIndex 106 | && tagSearchIndex; 107 | } 108 | 109 | // Workaround for scroll position not being included in browser history (8249133) 110 | document.addEventListener("DOMContentLoaded", function(e) { 111 | var contentDiv = document.querySelector("div.flex-content"); 112 | window.addEventListener("popstate", function(e) { 113 | if (e.state !== null) { 114 | contentDiv.scrollTop = e.state; 115 | } 116 | }); 117 | window.addEventListener("hashchange", function(e) { 118 | history.replaceState(contentDiv.scrollTop, document.title); 119 | }); 120 | contentDiv.addEventListener("scroll", function(e) { 121 | var timeoutID; 122 | if (!timeoutID) { 123 | timeoutID = setTimeout(function() { 124 | history.replaceState(contentDiv.scrollTop, document.title); 125 | timeoutID = null; 126 | }, 100); 127 | } 128 | }); 129 | if (!location.hash) { 130 | history.replaceState(contentDiv.scrollTop, document.title); 131 | } 132 | }); 133 | -------------------------------------------------------------------------------- /docs/tag-search-index.js: -------------------------------------------------------------------------------- 1 | tagSearchIndex = [];updateSearchResults(); -------------------------------------------------------------------------------- /docs/type-search-index.js: -------------------------------------------------------------------------------- 1 | typeSearchIndex = [{"l":"All Classes and Interfaces","u":"allclasses-index.html"},{"p":"qupath.ext.biop.cellpose","l":"Cellpose2D"},{"p":"qupath.ext.biop.cellpose","l":"CellposeBuilder"},{"p":"qupath.ext.biop.cellpose","l":"CellposeExtension"},{"p":"qupath.ext.biop.cellpose","l":"CellposeSetup"},{"p":"qupath.ext.biop.cmd","l":"VirtualEnvironmentRunner.EnvType"},{"p":"qupath.ext.biop.cellpose","l":"OpCreators.ImageNormalizationBuilder"},{"p":"qupath.ext.biop.cellpose","l":"Cellpose2D.LogParser"},{"p":"qupath.ext.biop.cellpose","l":"OpCreators"},{"p":"qupath.ext.biop.cellpose","l":"OpCreators.PercentileTileOpCreator"},{"p":"qupath.ext.biop.cellpose","l":"OpCreators.TileOpCreator"},{"p":"qupath.ext.biop.cmd","l":"VirtualEnvironmentRunner"},{"p":"qupath.ext.biop.cellpose","l":"OpCreators.ZeroMeanVarianceTileOpCreator"}];updateSearchResults(); -------------------------------------------------------------------------------- /files/cellpose-omnipose-biop-gpu.yml: -------------------------------------------------------------------------------- 1 | name: cellpose-omnipose-biop-gpu 2 | channels: 3 | - pytorch 4 | - nvidia 5 | - conda-forge 6 | dependencies: 7 | - python>=3.8 8 | - pytorch-cuda=11.7 9 | - pytorch 10 | - mahotas=1.4.13 11 | - pip 12 | - pip: 13 | - cellpose==2.2.1 14 | - omnipose==0.4.4 15 | - scikit-image==0.20.0 -------------------------------------------------------------------------------- /files/cellpose-qupath-setup-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/files/cellpose-qupath-setup-example.png -------------------------------------------------------------------------------- /files/cellpose-qupath-training-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/files/cellpose-qupath-training-example.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'qupath-extension-cellpose' 2 | 3 | gradle.ext.qupathVersion = "0.5.1" 4 | 5 | dependencyResolutionManagement { 6 | 7 | repositories { 8 | 9 | mavenLocal() 10 | 11 | mavenCentral() 12 | 13 | maven { 14 | url "https://maven.scijava.org/content/repositories/releases" 15 | } 16 | 17 | maven { 18 | url "https://maven.scijava.org/content/repositories/snapshots" 19 | } 20 | 21 | } 22 | 23 | 24 | versionCatalogs { 25 | libs { 26 | from("io.github.qupath:qupath-catalog:${gradle.ext.qupathVersion}") 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/java/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BIOP/qupath-extension-cellpose/afe61c49c0c1083a93b1348c5b00c9f38f480e3e/src/main/java/.gitkeep -------------------------------------------------------------------------------- /src/main/java/qupath/ext/biop/cellpose/CellposeExtension.java: -------------------------------------------------------------------------------- 1 | package qupath.ext.biop.cellpose; 2 | 3 | import javafx.beans.property.StringProperty; 4 | import org.controlsfx.control.PropertySheet; 5 | import org.controlsfx.control.action.Action; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import qupath.fx.prefs.controlsfx.PropertyItemBuilder; 9 | import qupath.lib.common.Version; 10 | import qupath.lib.gui.QuPathGUI; 11 | import qupath.lib.gui.extensions.GitHubProject; 12 | import qupath.lib.gui.extensions.QuPathExtension; 13 | import qupath.lib.gui.prefs.PathPrefs; 14 | import qupath.lib.gui.tools.MenuTools; 15 | 16 | import java.io.File; 17 | import java.io.InputStream; 18 | import java.util.LinkedHashMap; 19 | 20 | /** 21 | * Install Cellpose as an extension. 22 | *

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 --------------------------------------------------------------------------------