AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Script debugger add sdef11/10/2023 Create a new groovy class file in the source folder of your script project (Right click to src folder>New>Other>Groovy>Groovy Type).Groovy Project>Properties>Groovy Compiler>Enable script folder support – Project>Properties>Project References> Select the Groovy Script project (to build the script project when starting QuPath from Eclipse) – Project>Properties>Run/Debug Settings>QuPath (Launch configuration)>Edit>Source>Add>Workspace Folder> qp_scripts\bin (Class folder of the groovy script project) (groovy-3.03.jar, groovy-jsr223-3.03.jar and groovy-xml-3.03.jar have to be added to the class path of the qupath-gui-fx project) Use the modified DefaultScriptEditor.java in the QuPath project.**/*.groovy inserted AND selected in pattern list (see image below) To run an entire script in debug mode, add -x after the /bin/ shell on the first line: For Example : /bin/sh -x. – Groovy Project>Properties>Groovy Compiler>Enable script folder support = true gson-2.8.6.jar (this is used for code auto completion) – Groovy Project>Properties>Java Build Path>Libraries> If necessary, add other jars to the build path, e.g. – Groovy Project>Properties>Java Build Path>Projects> Add all qupath projects to the build path (this is used for code auto completion) Create a Groovy project for the QuPath scripts (my name: qp_scripts).The modified version of the DefaultScriptEditor.java is attached here : DefaultScriptEditor.zip (18.5 KB) My changes are marked in the code. Therefore I have implemented an additional function in the QuPath ScriptEditor in the menu Run: This is necessary to link the script to the debugger. The core of the approach is to evaluate the script code directly from the script file with a GroovyShell instead of utilizing the ScriptEngine (as QuPath currently does). Probably not all options are fully exhausted yet and not all problems are fixed. This approach is currently a first and minimum version.
0 Comments
Read More
Leave a Reply. |