Skip to content

Commit

Permalink
Updates to overall scope GUI
Browse files Browse the repository at this point in the history
Checkbox to use annotations on first round, export json file, and pass location of exported json file to python
  • Loading branch information
MichaelSNelson committed Dec 21, 2023
1 parent 6c1e859 commit ede0ffb
Show file tree
Hide file tree
Showing 16 changed files with 211 additions and 63 deletions.
Binary file modified .gradle/7.5.1/checksums/checksums.lock
Binary file not shown.
Binary file modified .gradle/7.5.1/checksums/md5-checksums.bin
Binary file not shown.
Binary file modified .gradle/7.5.1/checksums/sha1-checksums.bin
Binary file not shown.
Binary file modified .gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock
Binary file not shown.
Binary file modified .gradle/7.5.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/7.5.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/7.5.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/7.5.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/7.5.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file modified .gradle/file-system.probe
Binary file not shown.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies {
implementation "io.github.qupath:qupath-extension-bioformats:${qupathVersion}"
implementation "qupath.ext.basicstitching:BasicStitching:0.1.0"

//TODO figure out syntax for other plugins

// For logging - the version comes from QuPath's version catalog at
// https://github.com/qupath/qupath/blob/main/gradle/libs.versions.toml
// See https://docs.gradle.org/current/userguide/platforms.html
Expand Down
2 changes: 1 addition & 1 deletion src/main/groovy/qupath/ext/qp_scope/QP_scope.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class QP_scope implements QuPathExtension {
fileNameStitching.setOnAction(e -> {
//TODO check preferences for all necessary entries

QP_scope_GUI.createGUI()
QP_scope_GUI.createGUI1()

})
menu.getItems() << fileNameStitching
Expand Down
263 changes: 205 additions & 58 deletions src/main/groovy/qupath/ext/qp_scope/functions/QP_scope_GUI.groovy

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,18 @@ class utilityFunctions {
* @param x2 The second x-coordinate to be passed to the Python script.
* @param y2 The second y-coordinate to be passed to the Python script.
*/
static void runPythonCommand(String anacondaEnvPath, String pythonScriptPath,String projectsFolderPath, String sampleLabel, String x1, String y1, String x2, String y2) {
static void runPythonCommand(String anacondaEnvPath, String pythonScriptPath,String projectsFolderPath, String sampleLabel,String imageType, String x1 = "", String y1 = "", String x2 = "", String y2 = "", annotationJsonFileLocation = null) {
try {
def logger = LoggerFactory.getLogger(QuPathGUI.class)
// Path to the Python executable in the Anaconda environment
String pythonExecutable = "${anacondaEnvPath}/python.exe";

// Combine coordinates into a single argument
String args = "$pythonScriptPath, $projectsFolderPath, $sampleLabel, ${x1},${y1},${x2},${y2}";
String args = "$anacondaEnvPath $projectsFolderPath $sampleLabel $imageType $x1 $y1 $x2 $y2 $annotationJsonFileLocation";
logger.info(args)
// Construct the command
String command = "\"${pythonExecutable}\" \"${pythonScriptPath}\" ${args}";
logger.info("Check the following command")
logger.info(command)
// Execute the command
Process process = command.execute();
Expand All @@ -167,6 +168,6 @@ class utilityFunctions {
//If preferences are null or missing, throw an error and close
//Open to discussion whether scan types should be included here or typed every time, or some other option
//TODO fix the installation to be a folder with an expected .py file target? Or keep as .py file target?
return [installation: "C:\\ImageAnalysis\\python\\py_dummydoc.py", environment: "C:\\Anaconda\\envs\\paquo", projects: "C:\\ImageAnalysis\\slides", firstScanType: "4x_bf_", secondScanType:"20x_bf"]
return [installation: "C:\\ImageAnalysis\\python\\pycromanager_step_1.py", environment: "C:\\Anaconda\\envs\\paquo", projects: "C:\\ImageAnalysis\\slides", firstScanType: "4x_bf_", secondScanType:"20x_bf", deleteTiles:"True"]
}
}

0 comments on commit ede0ffb

Please sign in to comment.