Bayer-Group / paquo

PAthological QUpath Obsession - QuPath and Python conversations
GNU General Public License v3.0
105 stars 16 forks source link

Getting Current Qupath Program #71

Open HistoCleanQUB opened 2 years ago

HistoCleanQUB commented 2 years ago

Hi,

Really excellent work with this, just a quick question. Is there an easy way to get the file path of the QuPath Program directory that is being used in the paquo environment??

Hope this makes sense, Many thanks

ap-- commented 2 years ago

Hi @HistoCleanQUB,

This is currently not provided by a public interface. We could make this information easily available. Can I ask what's your specific use case?

As of now, you can get that information by doing:

>>> from paquo.jpype_backend import find_qupath
>>> from paquo._config import to_kwargs, settings
>>> find_qupath(**to_kwargs(settings))
(PosixPath('/Applications/QuPath.app/Contents/app'),
 PosixPath('/Applications/QuPath.app/Contents/runtime/Contents/Home'), 
 PosixPath('/Applications/QuPath.app/Contents/runtime/Contents/Home/lib/libjli.dylib'),
 ['-XX:MaxRAMPercentage=50', '-Djava.library.path=/Applications/QuPath.app/Contents/app'])

You would usually configure your .paquo.toml to determine which QuPath you want to use.

Cheers, Andreas

ap-- commented 2 years ago

A simple way to determine which version you a running is to execute:

paquo --qupath-version

in your commandline. (This of course doesn't let you differentiate in case you have the same version installed multiple times.

HistoCleanQUB commented 2 years ago

That's fantastic thank you! I'm using paquo to run some deep learning models in pytoch then feed annotations back to QuPath. Just wondering if Ihad multiple versions of QuPath in the one search directory from the .toml file would there be a way to change to a specific version.

Many thanks

ap-- commented 2 years ago

Glad I could help ❤️

In case you want to configure a specific version, you can set:

qupath_dir = "/path/to/your/Qupath"

in your .paquo.toml file. If qupath_dir is set, the search will be skipped.

Cheers, Andreas 😃