A TDA plugin for girder/slicer_cli_web_plugin with examples of slicer CLIs written in python and c++.
In the requirements.txt file, we need to define the library version under Python2.
- clone this repo
- build under Dockerhub repo
- Access HistomicsTK Docker image
$ docker exec -it histomicstk_histomicstk bash - Pull new Docker image from Dockerhub
$ docker pull demiqin/tda_plugin:version-1.0 - Generate new Docker image to HistomicsTK web-API
$docker run demiqin/tda_plugin:version-1.0 —-list_cli
$docker run demiqin/tda_plugin:version-1.0 [cliname] --xml
- Deploy HistomicsTK
cd HistomicsTK/ansible
Python3 deploy_docker.py start
- Access localhost:8080 and open Web-API, in the PUT /HistomicsTK/HistomicsTK/docker_image endpoint, you can add a list of Docker images, such as ["dsarchive/histomicstk:latest"], and then click “Try it out”.
To compute persistent homology and corrspondes persistence image of input image, we use the scikit-TDA which is a complete suite of TDA Python tools. The main library we used is CechMate. This library provides easy to use constructors for custom filtrations that are suitable for use with Phat. Phat currently provides a clean interface for persistence reduction algorithms for boundary matrics.
Check out complete documentation for CechMate at CechMate document.
Running docker run <image-name> --list_cli will output the list of all CLIs (their relative path and type/language) exposed.
$ docker run cdeepakroy/slicer_cli_web_plugin --list_cli
{
"sample_python_cli": {
"type" : "python"
},
"sample_cpp_cli": {
"type" : "cxx"
}
}
Running docker run <image-name> <cli-rel-path> --xml will output the Slicer XML spec of the CLI.
$ docker run cdeepakroy/slicer_cli_web_plugin sample_python_cli --xml
Running docker run <image-name> <cli-rel-path> --help will output the command-line usage help generated by ctk_cli.CLIArgumentParser for Python CLIs and GenerateCLP's PARSE_ARGS for C++ CLIs.
$ docker run cdeepakroy/slicer_cli_web_plugin sample_python_cli --help
Slicer-cli-web runs docker run <image-name> --list_cli to find the CLI's exposed, runs docker run <image-name> <cli-rel-path> --xml for each CLI to get its XML spec, automatically converts the XML spec into girder-worker task-spec to generate REST end-points and web UI.
- For usage #5, if it shows
/build/miniconda/lib/python2.7/argparse.py:2279: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if action.choices is not None and value not in action.choices: usage: cli_list_entrypoint.py [-h] [--list_cli] <cli> cli_list_entrypoint.py: error: argument <cli>: invalid choice: '\xe2\x80\x94list_cli' (choose from u'sample_cpp_cli', u'tda_python_cli', u'sample_python_cli')