├── .clang-format ├── .gitignore ├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── VERSION ├── cpp-client ├── CMakeExternals │ ├── ITK.cmake │ ├── Poco.cmake │ ├── SuperBuild.cmake │ └── nlohmann_json.cmake ├── CMakeLists.txt ├── Doxyfile ├── cmake │ ├── Config.cmake.in │ └── ConfigVersion.cmake.in ├── include │ └── nvidia │ │ └── aiaa │ │ ├── aiaautils.h │ │ ├── client.h │ │ ├── common.h │ │ ├── curlutils.h │ │ ├── exception.h │ │ ├── imageinfo.h │ │ ├── log.h │ │ ├── model.h │ │ ├── pointset.h │ │ ├── polygon.h │ │ └── utils.h ├── src │ ├── aiaautils.cpp │ ├── client.cpp │ ├── curlutils.cpp │ ├── imageinfo.cpp │ ├── model.cpp │ ├── pointset.cpp │ ├── polygon.cpp │ └── utils.cpp ├── test │ ├── CMakeLists.txt │ ├── data │ │ ├── image_slice_2D.png │ │ ├── pointset.json │ │ ├── polygons-old.json │ │ ├── polygons.json │ │ └── polygonslist.json │ └── src │ │ └── test-json.cpp └── tools │ ├── CMakeLists.txt │ ├── aiaa │ ├── aiaa-deepgrow.cpp │ ├── aiaa-dextra3d.cpp │ ├── aiaa-fix-polygon.cpp │ ├── aiaa-inference.cpp │ ├── aiaa-mask-polygon.cpp │ ├── aiaa-model.cpp │ ├── aiaa-sampling3d.cpp │ ├── aiaa-segmentation.cpp │ └── aiaa-session.cpp │ ├── commonutils.h │ └── dicom │ ├── dicom-to-nifti.cpp │ └── nifti-to-dicom.cpp ├── docs ├── .gitignore ├── Makefile ├── build.rst ├── build.sh ├── conf.py ├── contribute.rst ├── index.rst ├── python_api.rst ├── quickstart.rst ├── templates │ └── layout.html └── tools.rst ├── mitk-plugin ├── CMake │ └── PackageDepends │ │ └── MITK_NvidiaAIAAClient_Config.cmake ├── CMakeExternals │ ├── ExternalProjectList.cmake │ └── NvidiaAIAAClient.cmake ├── Modules │ ├── ModuleList.cmake │ └── NvidiaAIAAModule │ │ ├── CMakeLists.txt │ │ ├── files.cmake │ │ ├── include │ │ ├── NvidiaDeepgrowSegTool2D.h │ │ ├── NvidiaDextrSegTool3D.h │ │ ├── NvidiaPointSetDataInteractor.h │ │ └── NvidiaSmartPolySegTool2D.h │ │ ├── resource │ │ └── nvidia_logo.png │ │ └── src │ │ ├── NvidiaDeepgrowSegTool2D.cpp │ │ ├── NvidiaDextrSegTool3D.cpp │ │ ├── NvidiaPointSetDataInteractor.cpp │ │ └── NvidiaSmartPolySegTool2D.cpp ├── Plugins │ ├── PluginList.cmake │ └── org.mitk.nvidia.aiaa │ │ ├── CMakeLists.txt │ │ ├── files.cmake │ │ ├── manifest_headers.cmake │ │ ├── plugin.xml │ │ └── src │ │ ├── NvidiaDeepgrowSegTool2DGUI.cpp │ │ ├── NvidiaDeepgrowSegTool2DGUI.h │ │ ├── NvidiaDeepgrowSegTool2DGUI.ui │ │ ├── NvidiaDextrSegTool3DGUI.cpp │ │ ├── NvidiaDextrSegTool3DGUI.h │ │ ├── NvidiaDextrSegTool3DGUI.ui │ │ ├── NvidiaSmartPolySegTool2DGUI.cpp │ │ ├── NvidiaSmartPolySegTool2DGUI.h │ │ ├── NvidiaSmartPolySegTool2DGUI.ui │ │ └── internal │ │ ├── PluginActivator.cpp │ │ ├── PluginActivator.h │ │ ├── QmitkNvidiaAIAAPreferencePage.cpp │ │ ├── QmitkNvidiaAIAAPreferencePage.h │ │ └── QmitkNvidiaAIAAPreferencePage.ui └── README.md ├── py_client ├── .gitignore ├── __init__.py ├── aas_tests.json ├── client_api.py ├── readme.md ├── requirements.txt ├── test-data │ ├── AC07112011207153620_v2.png │ ├── fixpolygon.input.json │ ├── fixpolygon.input.png │ ├── image.nii.gz │ ├── mask2polygon.input.json │ └── mask2polygon.input.nii.gz └── test_aiaa_server.py ├── setup.py └── slicer-plugin ├── .gitignore ├── CMakeLists.txt ├── NvidiaAIAA ├── .gitignore ├── CMakeLists.txt ├── NvidiaAIAAClientAPI │ └── __init__.py ├── SegmentEditorNvidiaAIAA.py ├── SegmentEditorNvidiaAIAALib │ ├── SegmentEditorEffect.png │ ├── SegmentEditorEffect.py │ ├── SegmentEditorNvidiaAIAA.ui │ ├── __init__.py │ ├── edit-icon.png │ ├── filter-icon.png │ ├── nvidia-icon.png │ └── refresh-icon.png └── Testing │ ├── CMakeLists.txt │ └── Python │ └── CMakeLists.txt ├── NvidiaAIAssistedAnnotation.png ├── README.md ├── snapshot-annotation-points-brain.jpg ├── snapshot-annotation-points-liver.jpg ├── snapshot-annotation-result-brain.jpg ├── snapshot-annotation-result-liver.jpg ├── snapshot-deepgrow-result-liver.jpg ├── snapshot-segmentation-result-liver.jpg └── snapshot.jpg /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | DerivePointerAlignment: false 5 | PointerAlignment: Right 6 | IndentPPDirectives: AfterHash 7 | Cpp11BracedListStyle: false 8 | AlwaysBreakTemplateDeclarations: false 9 | AllowShortCaseLabelsOnASingleLine: true 10 | SpaceAfterTemplateKeyword: false 11 | AllowShortBlocksOnASingleLine: true 12 | ... 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 3rdparty 2 | build 3 | install 4 | 5 | .cproject 6 | .project 7 | .pydevproject 8 | .DS_Store 9 | 10 | # Prerequisites 11 | *.d 12 | 13 | # Compiled Object files 14 | *.slo 15 | *.lo 16 | *.o 17 | *.obj 18 | 19 | # Precompiled Headers 20 | *.gch 21 | *.pch 22 | 23 | # Compiled Dynamic libraries 24 | *.so 25 | *.dylib 26 | *.dll 27 | 28 | # Fortran module files 29 | *.mod 30 | *.smod 31 | 32 | # Compiled Static libraries 33 | *.lai 34 | *.la 35 | *.a 36 | *.lib 37 | 38 | # Executables 39 | *.exe 40 | *.out 41 | *.app 42 | *.pyc 43 | 44 | .idea 45 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | cmake_minimum_required(VERSION 3.12.1) 28 | set_property(GLOBAL PROPERTY USE_FOLDERS ON) 29 | 30 | # Logging Enable/Disable 31 | set(AIAA_LOG_DEBUG_ENABLED "0" CACHE STRING "Enable Debug Level logs for AIAA Client") 32 | set(AIAA_LOG_INFO_ENABLED "1" CACHE STRING "Enable Info Level logs for AIAA Client") 33 | 34 | # 3D Slicer's extension build tool defines NvidiaAIAssistedAnnotation_BUILD_SLICER_EXTENSION:BOOL=ON 35 | # to indicate that this project is being built as a 3D Slicer extension. 36 | if (NvidiaAIAssistedAnnotation_BUILD_SLICER_EXTENSION) 37 | message(STATUS "Building project as a Slicer extension") 38 | project(NvidiaAIAssistedAnnotation) 39 | add_subdirectory(slicer-plugin) 40 | return() 41 | endif() 42 | 43 | if (NOT DEFINED USE_SUPERBUILD) 44 | project(NvidiaAIAAClient-superbuild) 45 | include (cpp-client/CMakeExternals/SuperBuild.cmake) 46 | return() 47 | endif() 48 | 49 | project(NvidiaAIAAClient) 50 | 51 | # Version 52 | file(STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PACKAGE_VERSION) 53 | message(STATUS "NvidiaAIAAClient package version: ${PACKAGE_VERSION}") 54 | 55 | string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CPACK_PACKAGE_VERSION_MAJOR ${PACKAGE_VERSION}) 56 | string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" CPACK_PACKAGE_VERSION_MINOR ${PACKAGE_VERSION}) 57 | string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_PATCH ${PACKAGE_VERSION}) 58 | 59 | set(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) 60 | set(PROJECT_VERSION ${COMPLETE_VERSION}) 61 | 62 | # Output Directories 63 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 64 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 65 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 66 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) 67 | 68 | 69 | # Global compiler flags 70 | set(CMAKE_CXX_STANDARD 14) 71 | set(CMAKE_POSITION_INDEPENDENT_CODE ON) 72 | 73 | 74 | ############################################################# 75 | include_directories(cpp-client/include) 76 | add_subdirectory(cpp-client) 77 | #add_subdirectory(cpp-client/test) 78 | add_subdirectory(cpp-client/tools) 79 | 80 | 81 | ############################################################# 82 | # Package 83 | include(InstallRequiredSystemLibraries) 84 | set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "NVIDIA AIAA Client Libraries") 85 | set(CPACK_PACKAGE_VENDOR "NVIDIA") 86 | #set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") 87 | set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") 88 | set(CPACK_PACKAGE_INSTALL_DIRECTORY "NvidiaAIAAClient") 89 | include(CPack) 90 | 91 | 92 | 93 | ############################################################# 94 | # Doxygen 95 | find_package(Doxygen QUIET) 96 | if(DOXYGEN_FOUND) 97 | set(DOXYGEN_GENERATE_HTML YES) 98 | set(DOXYGEN_GENERATE_MAN NO) 99 | set(DOXYGEN_PROJECT_NAME "NVIDIA AIAA Client C++") 100 | set(DOXYGEN_PROJECT_BRIEF "NVIDIA AIAA Client C++ API to connect to AIAA Server to execute operations like dextr3d(), fixPolygon()...") 101 | 102 | doxygen_add_docs( 103 | doxygen 104 | ${PROJECT_SOURCE_DIR}/cpp-client/include/nvidia/aiaa/client.h 105 | ${PROJECT_SOURCE_DIR}/cpp-client/include/nvidia/aiaa/aiaautils.h 106 | ${PROJECT_SOURCE_DIR}/cpp-client/include/nvidia/aiaa/common.h 107 | ${PROJECT_SOURCE_DIR}/cpp-client/include/nvidia/aiaa/model.h 108 | ${PROJECT_SOURCE_DIR}/cpp-client/include/nvidia/aiaa/pointset.h 109 | ${PROJECT_SOURCE_DIR}/cpp-client/include/nvidia/aiaa/polygon.h 110 | ${PROJECT_SOURCE_DIR}/cpp-client/include/nvidia/aiaa/utils.h 111 | ${PROJECT_SOURCE_DIR}/cpp-client/include/nvidia/aiaa/imageinfo.h 112 | ${PROJECT_SOURCE_DIR}/cpp-client/include/nvidia/aiaa/exception.h 113 | COMMENT "Generate doxygen html for NVIDIA AIAA cpp-client API" 114 | ) 115 | endif(DOXYGEN_FOUND) 116 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Information related agreement... 9 | 10 | ## Code reviews 11 | 12 | All submissions, including submissions by project members, require review. We 13 | use GitHub pull requests for this purpose. Consult 14 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 15 | information on using pull requests. 16 | 17 | ## Community Guidelines 18 | 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NVIDIA AI-Assisted Annotation Client 2 | NVIDIA AI-Assisted Annotation SDK follows a client-server approach to integrate into an application. Clara Train SDK container on [ngc.nvidia.com](https://ngc.nvidia.com/) is generally available for download, annotation server is included in the package. Once a user has setup the AI-Assisted Annotation Server, user can use either C++ or Python client to integrate the SDK into an existing medical imaging application. 3 | 4 | [![Documentation](https://img.shields.io/badge/NVIDIA-documentation-brightgreen.svg)](https://docs.nvidia.com/clara/aiaa/sdk-api/docs/index.html) 5 | [![GitHub license](https://img.shields.io/badge/license-BSD3-blue.svg)](/LICENSE) 6 | [![GitHub Releases](https://img.shields.io/github/release/NVIDIA/ai-assisted-annotation-client.svg)](https://github.com/NVIDIA/ai-assisted-annotation-client/releases) 7 | [![GitHub Issues](https://img.shields.io/github/issues/NVIDIA/ai-assisted-annotation-client.svg)](https://github.com/NVIDIA/ai-assisted-annotation-client/issues) 8 | 9 | ## Supported Platforms 10 | AI-Assisted Annotation is a cross-platform C++/Python Client API to communicate with AI-Assisted Annotation Server for NVIDIA and it officially supports: 11 | - Linux (Ubuntu16+) 12 | - macOS (High Sierra and above) 13 | - Windows (Windows 10) 14 | 15 | ## Plugins 16 | Following plugins integrate with NVIDIA AI-Assisted Annotation through either C++/Python Client APIs 17 | - [NVIDIA MITK Plugin](/mitk-plugin) *(based on c++ client APIs)* 18 | - [NVIDIA 3D Slicer](/slicer-plugin) *(based on py_client APIs)* 19 | 20 | ## Quick Start 21 | Follow the [Quick Start](https://docs.nvidia.com/clara/aiaa/sdk-api/docs/quickstart.html) guide to build/install AI-Assisted Annotation Client Libraries for C++ and run some basic tools to verify few important functionalities like *dextr3D*, *segmentation*, *fixPolygon* over an existing AI-Assisted Annotation Server. 22 | 23 | >C++ Client Library provides support for CMake project 24 | 25 | For installing py\_client: 26 | 27 | ```bash 28 | # 1. build first and install 29 | python setup.py sdist bdist_wheel 30 | python -m pip install dist/aiaa_client-*.whl 31 | 32 | # 2. Or just install 33 | python -m pip install -e ./ 34 | ``` 35 | 36 | To use py\_client in code: 37 | 38 | ```python 39 | from py_client import client_api 40 | ``` 41 | 42 | ## Contributions 43 | Contributions to NVIDIA AI-Assisted Annotation Client are more than welcome. To contribute make a pull request and follow the guidelines outlined in the [CONTRIBUTING](/CONTRIBUTING.md) document. 44 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.0.2 2 | -------------------------------------------------------------------------------- /cpp-client/CMakeExternals/ITK.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | include(ExternalProject) 28 | 29 | if(NOT DEFINED ITK_DIR) 30 | ExternalProject_Add( 31 | ITK 32 | PREFIX ITK 33 | BINARY_DIR ITK-Build 34 | 35 | #DOWNLOAD_COMMAND "" 36 | URL http://mitk.org/download/thirdparty/InsightToolkit-4.13.1.tar.xz 37 | URL_MD5 bc7296e7faccdcb5656a7669d4d875d2 38 | 39 | SOURCE_DIR ${CMAKE_SOURCE_DIR}/3rdparty/ITK 40 | CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/3rdparty -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF 41 | 42 | TEST_COMMAND "" 43 | ) 44 | 45 | set(ITK_DIR ${CMAKE_BINARY_DIR}/ITK-Build) 46 | endif() 47 | -------------------------------------------------------------------------------- /cpp-client/CMakeExternals/Poco.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | include(ExternalProject) 28 | 29 | if(NOT DEFINED Poco_DIR) 30 | ExternalProject_Add( 31 | Poco 32 | PREFIX Poco 33 | BINARY_DIR Poco-Build 34 | 35 | #DOWNLOAD_COMMAND "" 36 | URL https://pocoproject.org/releases/poco-1.9.0/poco-1.9.0-all.tar.bz2 37 | URL_MD5 790bc520984616ae27eb0f95bafd2c8f 38 | 39 | SOURCE_DIR "${CMAKE_SOURCE_DIR}/3rdparty/Poco" 40 | CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/3rdparty 41 | -DBUILD_SHARED_LIBS:BOOL=OFF 42 | -DPOCO_MT:BOOL=OFF 43 | -DPOCO_STATIC:BOOL=ON 44 | -DENABLE_XML:BOOL=ON 45 | -DENABLE_JSON:BOOL=ON 46 | -DENABLE_MONGODB:BOOL=OFF 47 | -DENABLE_PDF:BOOL=OFF 48 | -DENABLE_UTIL:BOOL=ON 49 | -DENABLE_NET:BOOL=ON 50 | -DENABLE_NETSSL:BOOL=OFF 51 | -DENABLE_NETSSL_WIN:BOOL=OFF 52 | -DENABLE_CRYPTO:BOOL=OFF 53 | -DENABLE_DATA:BOOL=OFF 54 | -DENABLE_DATA_SQLITE:BOOL=OFF 55 | -DENABLE_DATA_MYSQL:BOOL=OFF 56 | -DENABLE_DATA_ODBC:BOOL=OFF 57 | -DENABLE_SEVENZIP:BOOL=OFF 58 | -DENABLE_ZIP:BOOL=OFF 59 | -DENABLE_APACHECONNECTOR:BOOL=OFF 60 | -DENABLE_CPPPARSER:BOOL=OFF 61 | -DENABLE_POCODOC:BOOL=OFF 62 | -DENABLE_PAGECOMPILER:BOOL=OFF 63 | -DENABLE_PAGECOMPILER_FILE2PAGE:BOOL=OFF 64 | 65 | TEST_COMMAND "" 66 | ) 67 | set(Poco_DIR ${CMAKE_BINARY_DIR}/Poco-Build) 68 | endif() 69 | -------------------------------------------------------------------------------- /cpp-client/CMakeExternals/SuperBuild.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | include (ExternalProject) 28 | 29 | set(proj_DEPENDENCIES ) 30 | 31 | # ITK 32 | if(EXTERNAL_ITK_DIR) 33 | set(ITK_DIR ${EXTERNAL_ITK_DIR}) 34 | else() 35 | if(NOT DEFINED ITK_DIR) 36 | include(cpp-client/CMakeExternals/ITK.cmake) 37 | list(APPEND proj_DEPENDENCIES ITK) 38 | set(ITK_DIR ${CMAKE_BINARY_DIR}/3rdparty/lib/cmake/ITK-4.13) 39 | endif() 40 | endif() 41 | 42 | # Poco 43 | if(EXTERNAL_Poco_DIR) 44 | set(Poco_DIR ${EXTERNAL_Poco_DIR}) 45 | else() 46 | if(NOT DEFINED Poco_DIR) 47 | include(cpp-client/CMakeExternals/Poco.cmake) 48 | list(APPEND proj_DEPENDENCIES Poco) 49 | set(Poco_DIR ${CMAKE_BINARY_DIR}/3rdparty/lib/cmake/Poco) 50 | endif() 51 | endif() 52 | 53 | # Others 54 | include(cpp-client/CMakeExternals/nlohmann_json.cmake) 55 | list(APPEND proj_DEPENDENCIES nlohmann_json) 56 | 57 | message(STATUS "(SuperBuild: ${USE_SUPERBUILD}) Dependenceies: ${proj_DEPENDENCIES}") 58 | message(STATUS "(SuperBuild: ${USE_SUPERBUILD}) Using ITK_DIR: ${ITK_DIR}") 59 | message(STATUS "(SuperBuild: ${USE_SUPERBUILD}) Using Poco_DIR: ${Poco_DIR}") 60 | message(STATUS "(SuperBuild: ${USE_SUPERBUILD}) AIAA_LOG_DEBUG_ENABLED: ${AIAA_LOG_DEBUG_ENABLED}") 61 | message(STATUS "(SuperBuild: ${USE_SUPERBUILD}) AIAA_LOG_INFO_ENABLED: ${AIAA_LOG_INFO_ENABLED}") 62 | 63 | ExternalProject_Add( 64 | NvidiaAIAAClient 65 | PREFIX NvidiaAIAAClient 66 | BINARY_DIR ${CMAKE_BINARY_DIR}/NvidiaAIAAClient-Build 67 | 68 | DEPENDS ${proj_DEPENDENCIES} 69 | 70 | DOWNLOAD_COMMAND "" 71 | SOURCE_DIR ${CMAKE_SOURCE_DIR} 72 | BUILD_ALWAYS 1 73 | 74 | CMAKE_ARGS 75 | -DUSE_SUPERBUILD=OFF 76 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/install 77 | -DTHIRDPARTY_BINARY_DIR=${CMAKE_BINARY_DIR}/3rdparty 78 | -DITK_DIR:PATH=${ITK_DIR} 79 | -DPoco_DIR:PATH=${Poco_DIR} 80 | -DAIAA_LOG_DEBUG_ENABLED=${AIAA_LOG_DEBUG_ENABLED} 81 | -DAIAA_LOG_INFO_ENABLED=${AIAA_LOG_INFO_ENABLED} 82 | 83 | TEST_COMMAND "" 84 | ) 85 | 86 | # Install 87 | install(DIRECTORY ${CMAKE_BINARY_DIR}/install/ 88 | DESTINATION ${CMAKE_INSTALL_PREFIX} 89 | FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ) 90 | 91 | set(AIAA_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include) 92 | set(AIAA_LIBRARY_DIR ${CMAKE_INSTALL_PREFIX}/lib) 93 | set(AIAA_CMAKE_DIR ${CMAKE_INSTALL_PREFIX}/lib/cmake/NvidiaAIAAClient) 94 | set(AIAA_LIBRARY_NAME NvidiaAIAAClient) 95 | 96 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cpp-client/cmake/Config.cmake.in "${CMAKE_BINARY_DIR}/NvidiaAIAAClientConfig.cmake" @ONLY) 97 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cpp-client/cmake/ConfigVersion.cmake.in "${CMAKE_BINARY_DIR}/NvidiaAIAAClientConfigVersion.cmake" @ONLY) 98 | 99 | install(FILES 100 | "${CMAKE_BINARY_DIR}/NvidiaAIAAClientConfig.cmake" 101 | "${CMAKE_BINARY_DIR}/NvidiaAIAAClientConfigVersion.cmake" 102 | DESTINATION "lib/cmake/NvidiaAIAAClient" COMPONENT dev) 103 | 104 | -------------------------------------------------------------------------------- /cpp-client/CMakeExternals/nlohmann_json.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | include(ExternalProject) 28 | 29 | ExternalProject_Add( 30 | nlohmann_json 31 | PREFIX JSON 32 | BINARY_DIR JSON-Build 33 | 34 | #DOWNLOAD_COMMAND "" 35 | URL https://github.com/nlohmann/json/archive/v3.4.0.tar.gz 36 | URL_MD5 ebe637e7f9b0abe4f57f4f56dd2e5e74 37 | 38 | SOURCE_DIR "${CMAKE_SOURCE_DIR}/3rdparty/nlohmann_json" 39 | CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DJSON_BuildTests=OFF -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/3rdparty 40 | 41 | TEST_COMMAND "" 42 | ) 43 | 44 | set(nlohmann_json_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/3rdparty/include") 45 | -------------------------------------------------------------------------------- /cpp-client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | # NvidiaAIAAClient-CPP 28 | #cmake_minimum_required(VERSION 3.12.4) 29 | #project(NvidiaAIAAClient-CPP) 30 | 31 | set(CMAKE_MACOSX_RPATH 1) 32 | set(CMAKE_CXX_STANDARD 14) 33 | set(CMAKE_POSITION_INDEPENDENT_CODE ON) 34 | 35 | message(STATUS "AIAA_LOG_DEBUG_ENABLED: ${AIAA_LOG_DEBUG_ENABLED}") 36 | message(STATUS "AIAA_LOG_INFO_ENABLED: ${AIAA_LOG_INFO_ENABLED}") 37 | 38 | add_compile_definitions(AIAA_LOG_DEBUG_ENABLED=${AIAA_LOG_DEBUG_ENABLED}) 39 | add_compile_definitions(AIAA_LOG_INFO_ENABLED=${AIAA_LOG_INFO_ENABLED}) 40 | add_compile_definitions(AIAA_MAKEDLL=1) 41 | add_compile_definitions(POCO_NO_AUTOMATIC_LIBS=1) 42 | 43 | 44 | include_directories(include) 45 | file(GLOB NvidiaAIAAClient_headers include/*.h) 46 | file(GLOB NvidiaAIAAClient_sources src/*.cpp) 47 | 48 | add_library(NvidiaAIAAClient SHARED ${NvidiaAIAAClient_headers} ${NvidiaAIAAClient_sources}) 49 | 50 | target_include_directories(NvidiaAIAAClient PUBLIC 51 | $ 52 | $ 53 | PRIVATE src) 54 | 55 | #################################################################### 56 | # 3rdParty Dependencies 57 | include_directories(${THIRDPARTY_BINARY_DIR}/include) 58 | 59 | # Poco 60 | find_package(Poco REQUIRED Foundation Util Net) 61 | target_link_libraries(NvidiaAIAAClient Poco::Foundation Poco::Util Poco::Net) 62 | if(MSVC) 63 | target_link_libraries(NvidiaAIAAClient iphlpapi.lib) 64 | endif() 65 | 66 | # ITK 67 | find_package(ITK) 68 | include(${ITK_USE_FILE}) 69 | target_link_libraries(NvidiaAIAAClient ${ITK_LIBRARIES}) 70 | #################################################################### 71 | 72 | include(CMakePackageConfigHelpers) 73 | 74 | install(TARGETS NvidiaAIAAClient EXPORT NvidiaAIAAClientTargets 75 | ARCHIVE DESTINATION lib 76 | LIBRARY DESTINATION lib 77 | RUNTIME DESTINATION bin) 78 | 79 | install(FILES 80 | include/nvidia/aiaa/client.h 81 | include/nvidia/aiaa/aiaautils.h 82 | include/nvidia/aiaa/common.h 83 | include/nvidia/aiaa/model.h 84 | include/nvidia/aiaa/pointset.h 85 | include/nvidia/aiaa/polygon.h 86 | include/nvidia/aiaa/utils.h 87 | include/nvidia/aiaa/imageinfo.h 88 | include/nvidia/aiaa/exception.h 89 | DESTINATION include/nvidia/aiaa) 90 | 91 | install(EXPORT NvidiaAIAAClientTargets DESTINATION lib/cmake/NvidiaAIAAClient) 92 | 93 | #export(TARGETS NvidiaAIAAClient FILE NvidiaAIAAClientConfig.cmake) 94 | 95 | -------------------------------------------------------------------------------- /cpp-client/Doxyfile: -------------------------------------------------------------------------------- 1 | INPUT = include 2 | FILE_PATTERNS = client.h \ 3 | common.h \ 4 | model.h \ 5 | pointset.h \ 6 | polygon.h \ 7 | utils.h \ 8 | exception.h 9 | -------------------------------------------------------------------------------- /cpp-client/cmake/Config.cmake.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | include(CMakeFindDependencyMacro) 28 | 29 | # Capturing values from configure 30 | set(NvidiaAIAAClient_DIR "@AIAA_CMAKE_DIR@") 31 | 32 | set(NvidiaAIAAClient_INCLUDE_DIRS "@AIAA_INCLUDE_DIR@") 33 | set(NvidiaAIAAClient_INCLUDE_DIRECTORIES "@AIAA_INCLUDE_DIR@") 34 | 35 | set(NvidiaAIAAClient_LIBRARY_DIR "@AIAA_LIBRARY_DIR@") 36 | set(NvidiaAIAAClient_LIBRARY @AIAA_LIBRARY_NAME@) 37 | set(NvidiaAIAAClient_LIBRARIES @AIAA_LIBRARY_NAME@) 38 | 39 | find_library(NvidiaAIAAClient_LIBRARY @AIAA_LIBRARY_NAME@ HINTS @AIAA_LIBRARY_DIR@) 40 | 41 | if(NvidiaAIAAClient_LIBRARY) 42 | set(NvidiaAIAAClient_FOUND TRUE) 43 | endif() 44 | -------------------------------------------------------------------------------- /cpp-client/cmake/ConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | set(PACKAGE_VERSION @PROJECT_VERSION@) 28 | 29 | IF("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 30 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 31 | else() 32 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 33 | if("${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") 34 | set(PACKAGE_VERSION_EXACT TRUE) 35 | endif() 36 | endif() -------------------------------------------------------------------------------- /cpp-client/include/nvidia/aiaa/aiaautils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #include "common.h" 32 | #include "pointset.h" 33 | #include "imageinfo.h" 34 | 35 | #include 36 | 37 | namespace nvidia { 38 | namespace aiaa { 39 | 40 | class AIAA_CLIENT_API AiaaUtils { 41 | public: 42 | // Pre Process 43 | static PointSet imagePreProcess(const PointSet &pointSet, const std::string &inputImage, const std::string &outputImage, ImageInfo &imageInfo, 44 | double PAD, const Point& ROI); 45 | 46 | /// Post Process 47 | static void imagePostProcess(const std::string &inputImage, const std::string &outputImage, const ImageInfo &imageInfo); 48 | }; 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /cpp-client/include/nvidia/aiaa/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) 32 | #if AIAA_MAKEDLL 33 | #define AIAA_CLIENT_API __declspec(dllexport) 34 | #else 35 | #define AIAA_CLIENT_API __declspec(dllimport) 36 | #endif 37 | #else 38 | #define AIAA_CLIENT_API 39 | #endif 40 | 41 | #pragma warning(disable:4251) 42 | -------------------------------------------------------------------------------- /cpp-client/include/nvidia/aiaa/curlutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #include 32 | 33 | namespace nvidia { 34 | namespace aiaa { 35 | 36 | class CurlUtils { 37 | public: 38 | static std::string doMethod(const std::string &method, const std::string &uri, int timeoutInSec); 39 | static std::string doMethod(const std::string &method, const std::string &uri, const std::string ¶mStr, const std::string &uploadFilePath, 40 | int timeoutInSec); 41 | static std::string doMethod(const std::string &method, const std::string &uri, const std::string ¶mStr, const std::string &uploadFilePath, 42 | const std::string &resultFileName, int timeoutInSec); 43 | 44 | static std::string encode(const std::string ¶m); 45 | }; 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /cpp-client/include/nvidia/aiaa/exception.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #include 32 | #include 33 | 34 | namespace nvidia { 35 | namespace aiaa { 36 | 37 | /*! 38 | @brief exception indicating a parse error 39 | 40 | This exception is thrown by the library when error occurs. These errors 41 | can occur during the deserialization of JSON text, CURL, as well 42 | as when using invalid Arguments. 43 | 44 | 45 | Exceptions have ids 1xx. 46 | 47 | name / id | description 48 | ------------------------------ | ------------------------- 49 | nvidia.aiaa.error.101 | Failed to communicate to AIAA Server. 50 | nvidia.aiaa.error.102 | Failed to parse AIAA Server Response. 51 | nvidia.aiaa.error.103 | Failed to process ITK Operations. 52 | nvidia.aiaa.error.104 | Invalid Arguments. 53 | nvidia.aiaa.error.105 | AIAA Session Timeout. 54 | nvidia.aiaa.error.106 | AIAA Response Error. 55 | nvidia.aiaa.error.107 | System/Unknown Error. 56 | */ 57 | 58 | class exception : public std::exception { 59 | public: 60 | /// @brief Enum for Error Type 61 | enum errorType { 62 | AIAA_SERVER_ERROR = 101, ///Failed to communicate to AIAA Server 63 | RESPONSE_PARSE_ERROR = 102, /// Failed to parse AIAA Server Response 64 | ITK_PROCESS_ERROR = 103, /// Failed to process ITK Operations 65 | INVALID_ARGS_ERROR = 104, /// Invalid Arguments 66 | AIAA_SESSION_TIMEOUT = 105, /// AIAA Session Timeout, 67 | AIAA_RESPONSE_ERROR = 106, /// AIAA Response Error 68 | SYSTEM_ERROR = 107, /// System/Unknown Error 69 | }; 70 | 71 | /// Message String for each enum type 72 | const std::string messages[7] = { "Failed to communicate to AIAA Server", "Failed to parse AIAA Server Response", 73 | "Failed to process ITK Operations", "Invalid Arguments", "AIAA Session Timeout", "AIAA Response Error", "System/Unknown Error" }; 74 | 75 | /// returns the explanatory string 76 | const char* what() const noexcept override { 77 | return m.what(); 78 | } 79 | 80 | /// the id of the exception 81 | errorType id = SYSTEM_ERROR; 82 | 83 | /// Construct exception 84 | exception(errorType id_, const char *what_arg) 85 | : 86 | id(id_), 87 | m(what_arg) { 88 | } 89 | 90 | /// String version of error 91 | std::string name() const { 92 | return messages[id - AIAA_SERVER_ERROR]; 93 | } 94 | 95 | private: 96 | /// an exception object as storage for error messages 97 | std::runtime_error m; 98 | }; 99 | 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /cpp-client/include/nvidia/aiaa/imageinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #include "common.h" 32 | 33 | #include 34 | #include 35 | 36 | namespace nvidia { 37 | namespace aiaa { 38 | 39 | //////////// 40 | // ImageInfo // 41 | //////////// 42 | 43 | /*! 44 | @brief Image Info 45 | 46 | This class contains information related to size, crop and crop index for a 2D/3D/4D Image 47 | */ 48 | 49 | struct AIAA_CLIENT_API ImageInfo { 50 | /// Original Size in [x,y,z] format 51 | std::vector imageSize = { 0, 0, 0, 0 }; 52 | 53 | /// Cropped Size in [x,y,z] format 54 | std::vector cropSize = { 0, 0, 0, 0 }; 55 | 56 | /// Cropped Index in [x,y,z] format 57 | std::vector cropIndex = { 0, 0, 0, 0 }; 58 | 59 | /// Check if ImageInfo is empty 60 | bool empty() const; 61 | 62 | /// Returns string/json version of Image3DInfo 63 | std::string dump(); 64 | }; 65 | 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /cpp-client/include/nvidia/aiaa/log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) 39 | 40 | static std::string timestamp() { 41 | auto now = std::chrono::system_clock::now(); 42 | auto in_time_t = std::chrono::system_clock::to_time_t(now); 43 | 44 | std::stringstream ss; 45 | #pragma warning(suppress:4996) 46 | ss << std::put_time(std::localtime(&in_time_t), "%H:%M:%S"); 47 | return ss.str(); 48 | } 49 | 50 | #ifndef AIAA_LOG_DEBUG_ENABLED 51 | #define AIAA_LOG_DEBUG_ENABLED 1 52 | #endif 53 | 54 | #ifndef AIAA_LOG_INFO_ENABLED 55 | #define AIAA_LOG_INFO_ENABLED 1 56 | #endif 57 | 58 | #ifndef AIAA_LOG_DEBUG 59 | #if AIAA_LOG_DEBUG_ENABLED 60 | #define AIAA_LOG_DEBUG(s) std::cout << timestamp() << " [DEBUG] [" << __FILENAME__ << ":" << __LINE__ << " - " << __func__ << "()] " << s << std::endl 61 | #else 62 | #define AIAA_LOG_DEBUG(s) 63 | #endif 64 | #endif 65 | 66 | #ifndef AIAA_LOG_INFO 67 | #if AIAA_LOG_INFO_ENABLED 68 | #define AIAA_LOG_INFO(s) std::cout << timestamp() << " [INFO ] [" << __FILENAME__ << ":" << __LINE__ << " - " << __func__ << "()] " << s << std::endl 69 | #else 70 | #define AIAA_LOG_INFO(s) 71 | #endif 72 | #endif 73 | 74 | #ifndef AIAA_LOG_WARN 75 | #define AIAA_LOG_WARN(s) std::cerr << timestamp() << " [WARN ] [" << __FILENAME__ << ":" << __LINE__ << " - " << __func__ << "()] " << s << std::endl 76 | #endif 77 | 78 | #ifndef AIAA_LOG_ERROR 79 | #define AIAA_LOG_ERROR(s) std::cerr << timestamp() << " [ERROR] [" << __FILENAME__ << ":" << __LINE__ << " - " << __func__ << "()] " << s << std::endl 80 | #endif 81 | -------------------------------------------------------------------------------- /cpp-client/include/nvidia/aiaa/pointset.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #include "common.h" 32 | 33 | #include 34 | #include 35 | 36 | namespace nvidia { 37 | namespace aiaa { 38 | 39 | //////////// 40 | // PointSet // 41 | //////////// 42 | 43 | /// Type Definition for 2D/3D/4D Point 44 | typedef std::vector Point; 45 | 46 | /*! 47 | @brief AIAA PointSet 48 | */ 49 | struct AIAA_CLIENT_API PointSet { 50 | 51 | /// Array of 2D/3D/4D Points to represent [[x,y,z,w]+] 52 | std::vector points; 53 | 54 | /// Checks if points is empty 55 | bool empty() const; 56 | 57 | /// Count of points 58 | size_t size() const; 59 | 60 | /// Append new Point to points list 61 | void push_back(Point point); 62 | 63 | /*! 64 | @brief create Model from JSON String 65 | @param[in] json JSON String 66 | @param[in] key Specific key inside JSON String that represents PointSet. 67 | 68 | 3D Example: 69 | @code 70 | [[70,172,86],[105,161,180],[125,147,164],[56,174,124],[91,119,143],[77,219,120]] 71 | @endcode 72 | 73 | @return PointSet object 74 | */ 75 | static PointSet fromJson(const std::string &json, const std::string &key = ""); 76 | 77 | /*! 78 | @brief convert PointSet to JSON String 79 | @param[in] space If space > 0; then JSON string will be formatted accordingly 80 | @return JSON String 81 | */ 82 | std::string toJson(int space = 0) const; 83 | }; 84 | 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /cpp-client/include/nvidia/aiaa/polygon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #include "common.h" 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | namespace nvidia { 38 | namespace aiaa { 39 | 40 | //////////// 41 | // Polygons // 42 | //////////// 43 | 44 | /*! 45 | @brief AIAA Polygons 46 | */ 47 | 48 | struct AIAA_CLIENT_API Polygons { 49 | /// Type Definition for Point 50 | typedef std::vector Point; 51 | 52 | /// Type Definition for Polygon 53 | typedef std::vector Polygon; 54 | 55 | /// Array of 2D/3D/4D Points to represent [[x,y,z,w]+] 56 | std::vector polys; 57 | 58 | /// Checks if polys is empty 59 | bool empty() const; 60 | 61 | /// Count of Polygons 62 | size_t size() const; 63 | 64 | /// Append new Polygon to polys list 65 | void push_back(Polygon poly); 66 | 67 | /// Flip X,Y points to Y,X 68 | void flipXY(); 69 | 70 | /*! 71 | @brief create Model from JSON String 72 | @param[in] polygons Polygons to compare against 73 | @param[in,out] polyIndex First Polygon Index where the Polygon is not matching 74 | @param[in,out] vertexIndex Vertex Index where the Point is not matching 75 | 76 | @return True if non-matching polygon + vertex is found 77 | */ 78 | bool findFirstNonMatching(const Polygons &polygons, int &polyIndex, int &vertexIndex) const; 79 | 80 | /*! 81 | @brief create Model from JSON String 82 | @param[in] json JSON String. 83 | @param[in] key Specific key inside JSON String that represents Polygons. 84 | 85 | Example: 86 | @code 87 | [ [[170, 66],[162, 73],[169, 77],[180, 76],[185, 68],[175, 66]], [[1,2]], [] ] 88 | @endcode 89 | 90 | @return Polygons object 91 | */ 92 | static Polygons fromJson(const std::string &json, const std::string &key = ""); 93 | 94 | /*! 95 | @brief convert Polygons to JSON String 96 | @param[in] space If space > 0; then JSON string will be formatted accordingly 97 | @return JSON String 98 | */ 99 | std::string toJson(int space = 0) const; 100 | }; 101 | 102 | /*! 103 | @brief AIAA List of Polygons 104 | */ 105 | 106 | struct AIAA_CLIENT_API PolygonsList { 107 | 108 | /// List of Polygons 109 | std::vector list; 110 | 111 | /// Checks if Polygons list is empty 112 | bool empty() const; 113 | 114 | /// Count of Polygons list 115 | size_t size() const; 116 | 117 | /// Append new Polygons to the list 118 | void push_back(Polygons polygons); 119 | 120 | /// Flip X,Y points to Y,X 121 | void flipXY(); 122 | 123 | /*! 124 | @brief create PolygonsList from JSON String 125 | @param[in] json JSON String. 126 | @param[in] key Specific key inside JSON String that represents PolygonList. 127 | 128 | Example: 129 | @code 130 | [ 131 | [], 132 | [[[169,66],[163,74],[173,77],[183,75],[184,68],[174,66]]], 133 | [[[169,66],[163,74],[172,78],[183,76],[184,69],[175,66]]] 134 | ] 135 | @endcode 136 | 137 | @return PolygonsList object 138 | */ 139 | static PolygonsList fromJson(const std::string &json, const std::string &key = ""); 140 | 141 | /*! 142 | @brief convert PolygonsList to JSON String 143 | @param[in] space If space > 0; then JSON string will be formatted accordingly 144 | @return JSON String 145 | */ 146 | std::string toJson(int space = 0) const; 147 | }; 148 | 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /cpp-client/include/nvidia/aiaa/utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #include "common.h" 32 | #include "pointset.h" 33 | #include "exception.h" 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | namespace nvidia { 41 | namespace aiaa { 42 | 43 | /*! 44 | @brief AIAA Utils 45 | */ 46 | 47 | class AIAA_CLIENT_API Utils { 48 | public: 49 | /*! 50 | @brief compare if 2 strings are same with ignore-case 51 | @param[in] a left string 52 | @param[in] b right string 53 | @retval true if a == b 54 | @retval false if a != b 55 | */ 56 | static bool iequals(const std::string &a, const std::string &b); 57 | 58 | /*! 59 | @brief convert string to lower case 60 | @param[in] str input string 61 | @return lower case version of input string 62 | */ 63 | static std::string to_lower(std::string str); 64 | 65 | /*! 66 | @brief get temporary filename 67 | @return full path for temporary file 68 | */ 69 | static std::string tempfilename(); 70 | 71 | /*! 72 | @brief split the sting 73 | @param[in] str input string 74 | @param[in] delim delimiter character 75 | @return vector of split strings 76 | */ 77 | static std::vector split(const std::string &str, char delim); 78 | 79 | /*! 80 | @brief 3D point 81 | @param[in] str input string 82 | @param[in] delim delimiter character 83 | @return Point which represents x,y,z 84 | */ 85 | static Point stringToPoint(const std::string &str, char delim); 86 | 87 | /*! 88 | @brief Lexical Cast with locale support 89 | @param[in] in input string/numeric 90 | @param[in] loc local by default "C" 91 | @return numberic/string based for the given locale 92 | */ 93 | template 94 | static auto lexical_cast(U const &in, const std::locale &loc = std::locale::classic()) { 95 | std::stringstream istr; 96 | istr.imbue(loc); 97 | istr << in; 98 | 99 | std::string str = istr.str(); // save string in case of exception 100 | 101 | T val; 102 | istr >> val; 103 | 104 | if (istr.fail()) { 105 | throw exception(exception::INVALID_ARGS_ERROR, str.c_str()); 106 | } 107 | 108 | return val; 109 | } 110 | }; 111 | 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /cpp-client/src/imageinfo.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "../include/nvidia/aiaa/imageinfo.h" 30 | 31 | #include 32 | #include 33 | 34 | namespace nvidia { 35 | namespace aiaa { 36 | 37 | bool ImageInfo::empty() const { 38 | return imageSize[0] == 0 && imageSize[1] == 0 && imageSize[2] == 0 && imageSize[3] == 0; 39 | } 40 | 41 | std::string ImageInfo::dump() { 42 | std::stringstream ss; 43 | ss << "{"; 44 | ss << "\"imageSize\": [" << imageSize[0] << "," << imageSize[1] << "," << imageSize[2] << "," << imageSize[3] << "], "; 45 | ss << "\"cropSize\": [" << cropSize[0] << "," << cropSize[1] << "," << cropSize[2] << "," << cropSize[3] << "], "; 46 | ss << "\"cropIndex\": [" << cropIndex[0] << "," << cropIndex[1] << "," << cropIndex[2] << "," << cropIndex[3] << "]"; 47 | ss << "}"; 48 | 49 | return ss.str(); 50 | } 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /cpp-client/src/pointset.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "../include/nvidia/aiaa/pointset.h" 30 | #include "../include/nvidia/aiaa/log.h" 31 | #include "../include/nvidia/aiaa/exception.h" 32 | 33 | #include 34 | 35 | namespace nvidia { 36 | namespace aiaa { 37 | 38 | // [[70,172,86],[105,161,180],[125,147,164],[56,174,124],[91,119,143],[77,219,120]] 39 | 40 | bool PointSet::empty() const { 41 | return points.empty(); 42 | } 43 | 44 | size_t PointSet::size() const { 45 | return points.size(); 46 | } 47 | 48 | void PointSet::push_back(Point point) { 49 | points.push_back(point); 50 | } 51 | 52 | PointSet PointSet::fromJson(const std::string &json, const std::string &key) { 53 | try { 54 | nlohmann::json j = nlohmann::json::parse(json); 55 | if (!key.empty() && j.find(key) != j.end()) { 56 | j = j[key]; 57 | } 58 | 59 | PointSet pointSet; 60 | for (auto e : j) { 61 | if (e.empty()) { 62 | continue; 63 | } 64 | 65 | Point point; 66 | for (auto n : e) { 67 | point.push_back(n); 68 | } 69 | pointSet.push_back(point); 70 | } 71 | return pointSet; 72 | } catch (nlohmann::json::parse_error &e) { 73 | AIAA_LOG_ERROR(e.what() << "; JSON: " << json); 74 | throw exception(exception::RESPONSE_PARSE_ERROR, e.what()); 75 | } catch (nlohmann::json::type_error &e) { 76 | AIAA_LOG_ERROR(e.what()); 77 | throw exception(exception::RESPONSE_PARSE_ERROR, e.what()); 78 | } 79 | } 80 | 81 | std::string PointSet::toJson(int space) const { 82 | nlohmann::json j = points; 83 | return space ? j.dump(space) : j.dump(); 84 | } 85 | 86 | } 87 | } 88 | 89 | -------------------------------------------------------------------------------- /cpp-client/src/utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include "../include/nvidia/aiaa/utils.h" 30 | #include "../include/nvidia/aiaa/log.h" 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | namespace nvidia { 38 | namespace aiaa { 39 | 40 | bool Utils::iequals(const std::string &a, const std::string &b) { 41 | return a.size() == b.size() && std::equal(a.begin(), a.end(), b.begin(), [](const char &a, const char &b) { 42 | return (std::tolower(a) == std::tolower(b)); 43 | }); 44 | } 45 | 46 | std::string Utils::to_lower(std::string s) { 47 | std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) { 48 | return std::tolower(c); 49 | }); 50 | return s; 51 | } 52 | 53 | std::string Utils::tempfilename() { 54 | #pragma warning(suppress:4996) 55 | return std::tmpnam(nullptr); 56 | } 57 | 58 | std::vector Utils::split(const std::string &str, char delim) { 59 | std::vector strings; 60 | std::istringstream f(str); 61 | 62 | std::string s; 63 | while (std::getline(f, s, delim)) { 64 | strings.push_back(s); 65 | } 66 | return strings; 67 | } 68 | 69 | Point Utils::stringToPoint(const std::string &str, char delim) { 70 | std::vector pstr = split(str, delim); 71 | Point point; 72 | 73 | for (size_t i = 0; i < pstr.size(); i++) { 74 | point.push_back(lexical_cast(pstr[i])); 75 | } 76 | return point; 77 | } 78 | 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /cpp-client/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | # test 28 | add_executable(testJson src/test-json.cpp) 29 | target_link_libraries(testJson NvidiaAIAAClient ${CMAKE_DL_LIBS}) 30 | -------------------------------------------------------------------------------- /cpp-client/test/data/image_slice_2D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/cpp-client/test/data/image_slice_2D.png -------------------------------------------------------------------------------- /cpp-client/test/data/pointset.json: -------------------------------------------------------------------------------- 1 | [[81,221,104],[84,197,104],[88,166,104],[77,138,104],[57,171,104],[60,200,104],[74,205,92],[84,190,92],[79,157,92],[59,174,92],[70,179,84],[73,164,84],[77,213,99],[85,187,99],[59,168,99],[78,227,112],[78,198,112],[82,143,112],[56,164,112],[88,173,127],[80,216,127],[81,120,127],[55,176,127],[74,187,117],[89,155,117],[76,224,124],[70,129,124],[100,129,134],[94,166,134],[79,197,134],[55,176,134],[117,152,150],[91,167,150],[66,205,150],[83,120,150],[131,152,167],[91,168,167],[103,126,167],[75,152,167],[124,161,178],[81,179,178],[94,144,178],[115,165,182],[94,166,182],[101,169,187],[101,166,174],[114,136,174],[66,194,155],[113,128,155],[69,213,144],[93,117,144],[114,149,144]] -------------------------------------------------------------------------------- /cpp-client/test/data/polygons-old.json: -------------------------------------------------------------------------------- 1 | [[[54,162],[56,151],[62,140],[68,129],[77,121],[87,119],[97,121],[103,130],[106,139],[107,150],[102,161],[93,167],[85,178],[83,189],[81,200],[80,211],[75,220],[65,217],[59,208],[55,198],[54,187],[54,176],[54,165]]] -------------------------------------------------------------------------------- /cpp-client/test/data/polygons.json: -------------------------------------------------------------------------------- 1 | [[[54,162],[56,151],[62,140],[68,129],[77,121],[87,119],[97,121],[103,130],[106,139],[107,150],[102,161],[93,167],[85,178],[83,189],[81,200],[80,211],[75,220],[66,221],[59,208],[55,198],[54,187],[54,176],[54,165]]] -------------------------------------------------------------------------------- /cpp-client/test/src/test-json.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | const std::string SERVER_URI = "http://10.110.45.66:5000/v1"; 35 | 36 | void testJsonModelList() { 37 | std::cout << "\n\n******************************** [" << __func__ << "] ********************************\n"; 38 | std::string json = 39 | "[{\"decription\":\"\",\"internal name\":\"Dextr3dCroppedEngine\",\"labels\":[\"brain_tumor_core\"],\"name\":\"Dextr3DBrainTC\"},{\"decription\":\"\",\"internal name\":\"Dextr3dCroppedEngine\",\"labels\":[\"liver\"],\"name\":\"Dextr3DLiver\"},{\"decription\":\"\",\"internal name\":\"Dextr3dCroppedEngine\",\"labels\":[\"brain_whole_tumor\"],\"name\":\"Dextr3DBrainWT\"}]"; 40 | 41 | nvidia::aiaa::ModelList modelList = nvidia::aiaa::ModelList::fromJson(json); 42 | 43 | std::cout << "MODEL-LIST (raw ): " << json << std::endl; 44 | std::cout << "MODEL-LIST (json): " << modelList.toJson() << std::endl; 45 | assert(json == modelList.toJson()); 46 | } 47 | 48 | void testJsonPointSet() { 49 | std::cout << "\n\n******************************** [" << __func__ << "] ********************************\n"; 50 | std::string json = "[[70,172,86],[105,161,180],[125,147,164],[56,174,124],[91,119,143],[77,219,120]]"; 51 | nvidia::aiaa::Point3DSet pointSet = nvidia::aiaa::Point3DSet::fromJson(json); 52 | 53 | std::cout << "3D-POINT SET (raw ): " << json << std::endl; 54 | std::cout << "3D-POINT SET (json): " << pointSet.toJson() << std::endl; 55 | assert(json == pointSet.toJson()); 56 | } 57 | 58 | void testJsonPolygons() { 59 | std::cout << "\n\n******************************** [" << __func__ << "] ********************************\n"; 60 | std::string json = 61 | "[[[69,167],[73,156],[78,146],[87,137],[98,131],[108,130],[118,132],[123,141],[139,155],[119,161],[109,166],[98,170],[89,176],[80,183],[71,182],[69,172]]]"; 62 | nvidia::aiaa::Polygons polygons = nvidia::aiaa::Polygons::fromJson(json); 63 | 64 | std::cout << "POLYGONS (raw ): " << json << std::endl; 65 | std::cout << "POLYGONS (json): " << polygons.toJson() << std::endl; 66 | assert(json == polygons.toJson()); 67 | } 68 | 69 | void testJsonPolygonsList() { 70 | std::cout << "\n\n******************************** [" << __func__ << "] ********************************\n"; 71 | std::string json = 72 | "[[],[[[69,167],[73,156],[78,146],[87,137],[98,131],[108,130],[118,132],[123,141],[139,155],[119,161],[109,166],[98,170],[89,176],[80,183],[71,182],[69,172]]]]"; 73 | nvidia::aiaa::PolygonsList polygonsList = nvidia::aiaa::PolygonsList::fromJson(json); 74 | 75 | std::cout << "POLYGONS-LIST (raw ): " << json << std::endl; 76 | std::cout << "POLYGONS-LIST (json): " << polygonsList.toJson() << std::endl; 77 | assert(json == polygonsList.toJson()); 78 | } 79 | 80 | int main(int argc, char **argv) { 81 | testJsonModelList(); 82 | testJsonPointSet(); 83 | testJsonPolygons(); 84 | testJsonPolygonsList(); 85 | return 0; 86 | } 87 | -------------------------------------------------------------------------------- /cpp-client/tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | # NvidiaAIAAClientTools 28 | #cmake_minimum_required(VERSION 3.12.4) 29 | #project(AIAAClientTools) 30 | 31 | set(CMAKE_MACOSX_RPATH 1) 32 | set(CMAKE_CXX_STANDARD 14) 33 | set(CMAKE_POSITION_INDEPENDENT_CODE ON) 34 | 35 | # ITK 36 | find_package(ITK) 37 | include(${ITK_USE_FILE}) 38 | 39 | # DICOM NIFTI Utils 40 | add_executable(DicomToNifti dicom/dicom-to-nifti.cpp) 41 | target_link_libraries(DicomToNifti ${ITK_LIBRARIES}) 42 | 43 | add_executable(NiftiToDicom dicom/nifti-to-dicom.cpp) 44 | target_link_libraries(NiftiToDicom ${ITK_LIBRARIES}) 45 | 46 | 47 | # AIAA Client API implementations 48 | # AIAA Client API implementations 49 | add_executable(nvidiaAIAAListModels aiaa/aiaa-model.cpp) 50 | target_link_libraries(nvidiaAIAAListModels NvidiaAIAAClient ${CMAKE_DL_LIBS}) 51 | 52 | add_executable(nvidiaAIAADEXTR3D aiaa/aiaa-dextra3d.cpp) 53 | target_link_libraries(nvidiaAIAADEXTR3D NvidiaAIAAClient ${CMAKE_DL_LIBS}) 54 | 55 | add_executable(nvidiaAIAASegmentation aiaa/aiaa-segmentation.cpp) 56 | target_link_libraries(nvidiaAIAASegmentation NvidiaAIAAClient ${CMAKE_DL_LIBS}) 57 | 58 | add_executable(nvidiaAIAASampling3D aiaa/aiaa-sampling3d.cpp) 59 | target_link_libraries(nvidiaAIAASampling3D NvidiaAIAAClient ${CMAKE_DL_LIBS}) 60 | 61 | add_executable(nvidiaAIAAFixPolygon aiaa/aiaa-fix-polygon.cpp) 62 | target_link_libraries(nvidiaAIAAFixPolygon NvidiaAIAAClient ${CMAKE_DL_LIBS}) 63 | 64 | add_executable(nvidiaAIAAMaskPolygon aiaa/aiaa-mask-polygon.cpp) 65 | target_link_libraries(nvidiaAIAAMaskPolygon NvidiaAIAAClient ${CMAKE_DL_LIBS}) 66 | 67 | add_executable(nvidiaAIAASession aiaa/aiaa-session.cpp) 68 | target_link_libraries(nvidiaAIAASession NvidiaAIAAClient ${CMAKE_DL_LIBS}) 69 | 70 | add_executable(nvidiaAIAADeepgrow aiaa/aiaa-deepgrow.cpp) 71 | target_link_libraries(nvidiaAIAADeepgrow NvidiaAIAAClient ${CMAKE_DL_LIBS}) 72 | 73 | add_executable(nvidiaAIAAInference aiaa/aiaa-inference.cpp) 74 | target_link_libraries(nvidiaAIAAInference NvidiaAIAAClient ${CMAKE_DL_LIBS}) 75 | 76 | # Install Targets 77 | install(TARGETS DicomToNifti DESTINATION bin) 78 | install(TARGETS NiftiToDicom DESTINATION bin) 79 | 80 | install(TARGETS nvidiaAIAAListModels DESTINATION bin) 81 | install(TARGETS nvidiaAIAADEXTR3D DESTINATION bin) 82 | install(TARGETS nvidiaAIAASegmentation DESTINATION bin) 83 | install(TARGETS nvidiaAIAAFixPolygon DESTINATION bin) 84 | install(TARGETS nvidiaAIAAMaskPolygon DESTINATION bin) 85 | install(TARGETS nvidiaAIAASampling3D DESTINATION bin) 86 | install(TARGETS nvidiaAIAASession DESTINATION bin) 87 | install(TARGETS nvidiaAIAADeepgrow DESTINATION bin) 88 | install(TARGETS nvidiaAIAAInference DESTINATION bin) 89 | -------------------------------------------------------------------------------- /cpp-client/tools/aiaa/aiaa-deepgrow.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | #include "../commonutils.h" 33 | #include 34 | 35 | int main(int argc, char **argv) { 36 | if (argc < 2 || cmdOptionExists(argv, argv + argc, "-h")) { 37 | std::cout << "Usage:: \n" 38 | " |-h (Help) Print this information |\n" 39 | " |-server Server URI {default: http://0.0.0.0:5000} |\n" 40 | " *|-model Model Name [either -label or -model is required] |\n" 41 | " *|-fpoints Foreground Clicks [[x,y,z]+] Example: [[70,172,86],...,[105,161,86]] |\n" 42 | " *|-bpoints Background Clicks [[x,y,z]+] Example: [[80,172,86],...,[102,161,86]] |\n" 43 | " *|-image Input Image File |\n" 44 | " *|-session Session ID |\n" 45 | " *|-output Output Image File |\n" 46 | " |-timeout Timeout In Seconds {default: 60} |\n" 47 | " |-ts Print API Latency |\n"; 48 | return 0; 49 | } 50 | 51 | std::string serverUri = getCmdOption(argv, argv + argc, "-server", "http://0.0.0.0:5000"); 52 | 53 | std::string model = getCmdOption(argv, argv + argc, "-model"); 54 | std::string fpoints = getCmdOption(argv, argv + argc, "-fpoints", "[]"); 55 | std::string bpoints = getCmdOption(argv, argv + argc, "-bpoints", "[]"); 56 | 57 | std::string inputImageFile = getCmdOption(argv, argv + argc, "-image"); 58 | std::string sessionId = getCmdOption(argv, argv + argc, "-session"); 59 | std::string outputImageFile = getCmdOption(argv, argv + argc, "-output"); 60 | 61 | int timeout = nvidia::aiaa::Utils::lexical_cast(getCmdOption(argv, argv + argc, "-timeout", "60")); 62 | bool printTs = cmdOptionExists(argv, argv + argc, "-ts") ? true : false; 63 | 64 | if (model.empty()) { 65 | std::cerr << "Model is required\n"; 66 | return -1; 67 | } 68 | if (inputImageFile.empty() && sessionId.empty()) { 69 | std::cerr << "Input Image file is missing (Either session-id or input image should be provided)\n"; 70 | return -1; 71 | } 72 | if (outputImageFile.empty()) { 73 | std::cerr << "Output Image file is missing\n"; 74 | return -1; 75 | } 76 | 77 | try { 78 | nvidia::aiaa::PointSet foreground = nvidia::aiaa::PointSet::fromJson(fpoints); 79 | nvidia::aiaa::PointSet background = nvidia::aiaa::PointSet::fromJson(bpoints); 80 | nvidia::aiaa::Client client(serverUri, timeout); 81 | 82 | nvidia::aiaa::Model m = client.model(model); 83 | if (m.name.empty()) { 84 | std::cerr << "Couldn't find a model for name: " << model << "\n"; 85 | return -1; 86 | } 87 | 88 | auto begin = std::chrono::high_resolution_clock::now(); 89 | int ret = client.deepgrow(m, foreground, background, inputImageFile, outputImageFile, sessionId); 90 | 91 | auto end = std::chrono::high_resolution_clock::now(); 92 | auto ms = std::chrono::duration_cast(end - begin).count(); 93 | 94 | std::cout << "Return Code: " << ret << (ret ? " (FAILED) " : " (SUCCESS) ") << std::endl; 95 | if (printTs) { 96 | std::cout << "API Latency (in milli sec): " << ms << std::endl; 97 | } 98 | return 0; 99 | } catch (nvidia::aiaa::exception &e) { 100 | std::cerr << "nvidia::aiaa::exception => nvidia.aiaa.error." << e.id << "; description: " << e.name() << std::endl; 101 | } 102 | return -1; 103 | } 104 | -------------------------------------------------------------------------------- /cpp-client/tools/aiaa/aiaa-inference.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | #include "../commonutils.h" 33 | #include 34 | 35 | int main(int argc, char **argv) { 36 | if (argc < 2 || cmdOptionExists(argv, argv + argc, "-h")) { 37 | std::cout << "Usage:: \n" 38 | " |-h (Help) Print this information |\n" 39 | " |-server Server URI {default: http://0.0.0.0:5000} |\n" 40 | " *|-model Model Name [either -label or -model is required] |\n" 41 | " |-params Input Params (JSON) |\n" 42 | " *|-image Input Image File |\n" 43 | " *|-session Session ID |\n" 44 | " |-output Output Image File |\n" 45 | " |-timeout Timeout In Seconds {default: 60} |\n" 46 | " |-ts Print API Latency |\n"; 47 | return 0; 48 | } 49 | 50 | std::string serverUri = getCmdOption(argv, argv + argc, "-server", "http://0.0.0.0:5000"); 51 | std::string model = getCmdOption(argv, argv + argc, "-model"); 52 | 53 | std::string params = getCmdOption(argv, argv + argc, "-params"); 54 | std::string inputImageFile = getCmdOption(argv, argv + argc, "-image"); 55 | std::string sessionId = getCmdOption(argv, argv + argc, "-session"); 56 | std::string outputImageFile = getCmdOption(argv, argv + argc, "-output"); 57 | 58 | int timeout = nvidia::aiaa::Utils::lexical_cast(getCmdOption(argv, argv + argc, "-timeout", "60")); 59 | bool printTs = cmdOptionExists(argv, argv + argc, "-ts") ? true : false; 60 | 61 | if (model.empty()) { 62 | std::cerr << "Model is required\n"; 63 | return -1; 64 | } 65 | if (inputImageFile.empty() && sessionId.empty()) { 66 | std::cerr << "Input Image file is missing (Either session-id or input image should be provided)\n"; 67 | return -1; 68 | } 69 | 70 | try { 71 | nvidia::aiaa::Client client(serverUri, timeout); 72 | 73 | nvidia::aiaa::Model m; 74 | m = client.model(model); 75 | 76 | if (m.name.empty()) { 77 | std::cerr << "Couldn't find a model for name: " << model << "\n"; 78 | return -1; 79 | } 80 | 81 | auto begin = std::chrono::high_resolution_clock::now(); 82 | std::string resultJson = client.inference(m, params, inputImageFile, outputImageFile, sessionId); 83 | std::cout << "Result (JSON): " << resultJson << std::endl; 84 | 85 | auto end = std::chrono::high_resolution_clock::now(); 86 | auto ms = std::chrono::duration_cast(end - begin).count(); 87 | 88 | if (printTs) { 89 | std::cout << "API Latency (in milli sec): " << ms << std::endl; 90 | } 91 | return 0; 92 | } catch (nvidia::aiaa::exception &e) { 93 | std::cerr << "nvidia::aiaa::exception => nvidia.aiaa.error." << e.id << "; description: " << e.name() << "; reason: " << e.what() << std::endl; 94 | } 95 | return -1; 96 | } 97 | -------------------------------------------------------------------------------- /cpp-client/tools/aiaa/aiaa-mask-polygon.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | #include "../commonutils.h" 32 | #include 33 | 34 | int main(int argc, char **argv) { 35 | if (argc < 2 || cmdOptionExists(argv, argv + argc, "-h")) { 36 | std::cout << "Usage:: \n" 37 | " |-h (Help) Print this information |\n" 38 | " |-server Server URI {default: http://0.0.0.0:5000} |\n" 39 | " |-ratio Point Ratio {default: 10} |\n" 40 | " *|-image Input Image File |\n" 41 | " |-output Output File Name to store result |\n" 42 | " |-format Format Output Json |\n" 43 | " |-timeout Timeout In Seconds {default: 60} |\n" 44 | " |-ts Print API Latency |\n"; 45 | return 0; 46 | } 47 | 48 | std::string serverUri = getCmdOption(argv, argv + argc, "-server", "http://0.0.0.0:5000"); 49 | int ratio = nvidia::aiaa::Utils::lexical_cast(getCmdOption(argv, argv + argc, "-ratio", "10")); 50 | std::string inputImageFile = getCmdOption(argv, argv + argc, "-image"); 51 | std::string outputJsonFile = getCmdOption(argv, argv + argc, "-output"); 52 | int jsonSpace = cmdOptionExists(argv, argv + argc, "-format") ? 2 : 0; 53 | int timeout = nvidia::aiaa::Utils::lexical_cast(getCmdOption(argv, argv + argc, "-timeout", "60")); 54 | bool printTs = cmdOptionExists(argv, argv + argc, "-ts") ? true : false; 55 | 56 | if (ratio < 1) { 57 | std::cerr << "Invalid Point Ratio (should be > 0)\n"; 58 | return -1; 59 | } 60 | if (inputImageFile.empty()) { 61 | std::cerr << "Input Image file is missing\n"; 62 | return -1; 63 | } 64 | 65 | try { 66 | auto begin = std::chrono::high_resolution_clock::now(); 67 | nvidia::aiaa::Client client(serverUri, timeout); 68 | nvidia::aiaa::PolygonsList result = client.maskToPolygon(ratio, inputImageFile); 69 | 70 | auto end = std::chrono::high_resolution_clock::now(); 71 | auto ms = std::chrono::duration_cast(end - begin).count(); 72 | 73 | if (outputJsonFile.empty()) { 74 | std::cout << result.toJson(jsonSpace) << std::endl; 75 | } else { 76 | stringToFile(result.toJson(jsonSpace), outputJsonFile); 77 | } 78 | 79 | if (printTs) { 80 | std::cout << "API Latency (in milli sec): " << ms << std::endl; 81 | } 82 | return 0; 83 | } catch (nvidia::aiaa::exception& e) { 84 | std::cerr << "nvidia::aiaa::exception => nvidia.aiaa.error." << e.id << "; description: " << e.name() << std::endl; 85 | } 86 | 87 | return -1; 88 | } 89 | -------------------------------------------------------------------------------- /cpp-client/tools/aiaa/aiaa-model.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | #include "../commonutils.h" 32 | #include 33 | 34 | int main(int argc, char **argv) { 35 | if (cmdOptionExists(argv, argv + argc, "-h")) { 36 | std::cout << "Usage:: \n" 37 | " |-h (Help) Print this information |\n" 38 | " |-server Server URI {default: http://0.0.0.0:5000} |\n" 39 | " |-label Find Matching Model for this label; If absent, output full Model List |\n" 40 | " |-type Find Matching Model of type (segmentation/annotation) |\n" 41 | " |-output Output File Name to store result |\n" 42 | " |-format Format Output Json |\n" 43 | " |-timeout Timeout In Seconds {default: 60} |\n" 44 | " |-ts Print API Latency |\n"; 45 | 46 | return 0; 47 | } 48 | 49 | std::string serverUri = getCmdOption(argv, argv + argc, "-server", "http://0.0.0.0:5000"); 50 | std::string label = getCmdOption(argv, argv + argc, "-label"); 51 | std::string type = getCmdOption(argv, argv + argc, "-type"); 52 | std::string outputJsonFile = getCmdOption(argv, argv + argc, "-output"); 53 | int jsonSpace = cmdOptionExists(argv, argv + argc, "-format") ? 2 : 0; 54 | int timeout = nvidia::aiaa::Utils::lexical_cast(getCmdOption(argv, argv + argc, "-timeout", "60")); 55 | bool printTs = cmdOptionExists(argv, argv + argc, "-ts") ? true : false; 56 | 57 | try { 58 | auto begin = std::chrono::high_resolution_clock::now(); 59 | nvidia::aiaa::Client client(serverUri, timeout); 60 | 61 | nvidia::aiaa::Model::ModelType mt = nvidia::aiaa::Model::toModelType(type); 62 | nvidia::aiaa::ModelList modelList = type.empty() && label.empty() ? client.models() : client.models(label, mt); 63 | 64 | auto end = std::chrono::high_resolution_clock::now(); 65 | auto ms = std::chrono::duration_cast < std::chrono::milliseconds > (end - begin).count(); 66 | 67 | if (outputJsonFile.empty()) { 68 | std::cout << modelList.toJson(jsonSpace) << std::endl; 69 | } else { 70 | stringToFile(modelList.toJson(jsonSpace), outputJsonFile); 71 | } 72 | 73 | if (printTs) { 74 | std::cout << "API Latency (in milli sec): " << ms << std::endl; 75 | } 76 | return 0; 77 | } catch (nvidia::aiaa::exception& e) { 78 | std::cerr << "nvidia::aiaa::exception => nvidia.aiaa.error." << e.id << "; description: " << e.name() << std::endl; 79 | } 80 | 81 | return -1; 82 | } 83 | -------------------------------------------------------------------------------- /cpp-client/tools/aiaa/aiaa-segmentation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | #include "../commonutils.h" 33 | #include 34 | 35 | int main(int argc, char **argv) { 36 | if (argc < 2 || cmdOptionExists(argv, argv + argc, "-h")) { 37 | std::cout << "Usage:: \n" 38 | " |-h (Help) Print this information |\n" 39 | " |-server Server URI {default: http://0.0.0.0:5000} |\n" 40 | " *|-label Input Label Name [either -label or -model is required] |\n" 41 | " *|-model Model Name [either -label or -model is required] |\n" 42 | " *|-image Input Image File |\n" 43 | " *|-session Session ID |\n" 44 | " *|-output Output Image File |\n" 45 | " |-timeout Timeout In Seconds {default: 60} |\n" 46 | " |-ts Print API Latency |\n"; 47 | return 0; 48 | } 49 | 50 | std::string serverUri = getCmdOption(argv, argv + argc, "-server", "http://0.0.0.0:5000"); 51 | 52 | std::string label = getCmdOption(argv, argv + argc, "-label"); 53 | std::string model = getCmdOption(argv, argv + argc, "-model"); 54 | 55 | std::string inputImageFile = getCmdOption(argv, argv + argc, "-image"); 56 | std::string sessionId = getCmdOption(argv, argv + argc, "-session"); 57 | std::string outputImageFile = getCmdOption(argv, argv + argc, "-output"); 58 | 59 | int timeout = nvidia::aiaa::Utils::lexical_cast(getCmdOption(argv, argv + argc, "-timeout", "60")); 60 | bool printTs = cmdOptionExists(argv, argv + argc, "-ts") ? true : false; 61 | 62 | if (label.empty() && model.empty()) { 63 | std::cerr << "Either Label or Model is required\n"; 64 | return -1; 65 | } 66 | if (inputImageFile.empty() && sessionId.empty()) { 67 | std::cerr << "Input Image file is missing (Either session-id or input image should be provided)\n"; 68 | return -1; 69 | } 70 | if (outputImageFile.empty()) { 71 | std::cerr << "Output Image file is missing\n"; 72 | return -1; 73 | } 74 | 75 | try { 76 | nvidia::aiaa::Client client(serverUri, timeout); 77 | 78 | nvidia::aiaa::Model m; 79 | if (model.empty()) { 80 | nvidia::aiaa::ModelList models = client.models(); 81 | m = models.getMatchingModel(label, nvidia::aiaa::Model::segmentation); 82 | } else { 83 | m = client.model(model); 84 | } 85 | 86 | if (m.name.empty()) { 87 | std::cerr << "Couldn't find a model for name: " << model << "; label: " << label << "\n"; 88 | return -1; 89 | } 90 | 91 | auto begin = std::chrono::high_resolution_clock::now(); 92 | nvidia::aiaa::PointSet extremePoints = client.segmentation(m, inputImageFile, outputImageFile, sessionId); 93 | std::cout << "Extreme Points: " << extremePoints.toJson() << std::endl; 94 | 95 | auto end = std::chrono::high_resolution_clock::now(); 96 | auto ms = std::chrono::duration_cast(end - begin).count(); 97 | 98 | if (printTs) { 99 | std::cout << "API Latency (in milli sec): " << ms << std::endl; 100 | } 101 | return 0; 102 | } catch (nvidia::aiaa::exception &e) { 103 | std::cerr << "nvidia::aiaa::exception => nvidia.aiaa.error." << e.id << "; description: " << e.name() << std::endl; 104 | } 105 | return -1; 106 | } 107 | -------------------------------------------------------------------------------- /cpp-client/tools/aiaa/aiaa-session.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | #include "../commonutils.h" 33 | #include 34 | 35 | int main(int argc, char **argv) { 36 | if (argc < 2 || cmdOptionExists(argv, argv + argc, "-h")) { 37 | std::cout << "Usage:: \n" 38 | " |-h (Help) Print this information |\n" 39 | " |-server Server URI {default: http://0.0.0.0:5000} |\n" 40 | " *|-op Operation (create|get|delete) |\n" 41 | " |-image Input Image File in case of (create) operation |\n" 42 | " |-expiry Session expiry time in seconds (default: 0) |\n" 43 | " |-session Session ID in case of (get|delete) operation |\n" 44 | " |-timeout Timeout In Seconds {default: 60} |\n" 45 | " |-ts Print API Latency |\n"; 46 | return 0; 47 | } 48 | 49 | std::string serverUri = getCmdOption(argv, argv + argc, "-server", "http://0.0.0.0:5000"); 50 | 51 | std::string operation = getCmdOption(argv, argv + argc, "-op"); 52 | std::string inputImageFile = getCmdOption(argv, argv + argc, "-image"); 53 | int expiry = nvidia::aiaa::Utils::lexical_cast(getCmdOption(argv, argv + argc, "-expiry", "0")); 54 | std::string sessionId = getCmdOption(argv, argv + argc, "-session"); 55 | 56 | int timeout = nvidia::aiaa::Utils::lexical_cast(getCmdOption(argv, argv + argc, "-timeout", "60")); 57 | bool printTs = cmdOptionExists(argv, argv + argc, "-ts") ? true : false; 58 | 59 | if (operation.empty()) { 60 | std::cerr << "Operation is Missing\n"; 61 | return -1; 62 | } 63 | if (!(operation == "create" || operation == "get" || operation == "delete")) { 64 | std::cerr << "Operation is Invalid\n"; 65 | return -1; 66 | } 67 | if (operation == "create" && inputImageFile.empty()) { 68 | std::cerr << "Input Image file is missing (Either session-id or input image should be provided)\n"; 69 | return -1; 70 | } 71 | if ((operation == "get" || operation == "delete") && sessionId.empty()) { 72 | std::cerr << "Session ID is missing\n"; 73 | return -1; 74 | } 75 | 76 | try { 77 | nvidia::aiaa::Client client(serverUri, timeout); 78 | 79 | auto begin = std::chrono::high_resolution_clock::now(); 80 | if (operation == "create") { 81 | std::string result = client.createSession(inputImageFile, expiry); 82 | std::cout << "New Session ID: " << result << std::endl; 83 | } else if (operation == "get") { 84 | std::string result = client.getSession(sessionId); 85 | std::cout << "Session Info: " << result << std::endl; 86 | } else if (operation == "delete") { 87 | client.closeSession(sessionId); 88 | std::cout << "Session Closed: " << sessionId << std::endl; 89 | } 90 | 91 | auto end = std::chrono::high_resolution_clock::now(); 92 | auto ms = std::chrono::duration_cast(end - begin).count(); 93 | 94 | if (printTs) { 95 | std::cout << "API Latency (in milli sec): " << ms << std::endl; 96 | } 97 | return 0; 98 | } catch (nvidia::aiaa::exception &e) { 99 | std::cerr << "nvidia::aiaa::exception => nvidia.aiaa.error." << e.id << "; description: " << e.name() << std::endl; 100 | } 101 | return -1; 102 | } 103 | -------------------------------------------------------------------------------- /cpp-client/tools/commonutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #pragma once 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | std::string getCmdOption(char **begin, char **end, const std::string &option, const std::string &defaultVal = "") { 37 | char ** itr = std::find(begin, end, option); 38 | if (itr != end && ++itr != end) { 39 | return std::string(*itr); 40 | } 41 | return defaultVal; 42 | } 43 | 44 | bool cmdOptionExists(char** begin, char** end, const std::string& option) { 45 | return std::find(begin, end, option) != end; 46 | } 47 | 48 | std::string fileToString(const std::string &file) { 49 | std::ifstream in(file); 50 | std::stringstream buffer; 51 | buffer << in.rdbuf(); 52 | return buffer.str(); 53 | } 54 | 55 | void stringToFile(const std::string &str, const std::string &file) { 56 | std::ofstream out(file); 57 | out << str; 58 | out.close(); 59 | } 60 | 61 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | doxyoutput 3 | cpp_api 4 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | # Makefile for Sphinx documentation 28 | # 29 | 30 | # You can set these variables from the command line. 31 | SPHINXOPTS = 32 | SPHINXBUILD = sphinx-build 33 | SPHINXPROJ = AIAAClient 34 | SOURCEDIR = . 35 | BUILDDIR = build 36 | EXHALEDIRS = cpp_api doxyoutput 37 | PROTOBUFFILES = $(wildcard ../src/core/*.proto) 38 | 39 | # Put it first so that "make" without argument is like "make help". 40 | help: 41 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 42 | 43 | clean: 44 | @rm -fr $(BUILDDIR) $(EXHALEDIRS) ../py_client/__pycache__ 45 | 46 | # Catch-all target: route all unknown targets to Sphinx using the new 47 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 48 | %: Makefile 49 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 50 | 51 | .PHONY: help clean Makefile 52 | -------------------------------------------------------------------------------- /docs/build.rst: -------------------------------------------------------------------------------- 1 | .. 2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions 6 | # are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of NVIDIA CORPORATION nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | Building 29 | ======== 30 | 31 | 32 | Building C++ Client 33 | ------------------- 34 | 35 | Prerequisites 36 | ^^^^^^^^^^^^^ 37 | - `CMake `_ (version >= 3.12.4) 38 | - For Linux/Mac gcc which supports C++ 11 or higher 39 | - For Windows `Visual Studio 2017 `_ 40 | 41 | External Dependencies 42 | ^^^^^^^^^^^^^^^^^^^^^ 43 | - `ITK `_ (version = 4.13..1) 44 | - `Poco `_ (version = 1.9.0) 45 | - `nlohmann_json `_ 46 | 47 | .. note:: 48 | Above are source only dependencies for CMake project. 49 | They will get downloaded and built as part of super-build project for AIAA Client. 50 | 51 | Building Binaries 52 | ^^^^^^^^^^^^^^^^^ 53 | Following the below instructions to get the source code and build the project 54 | 55 | .. code-block:: bash 56 | 57 | git clone https://github.com/NVIDIA/ai-assisted-annotation-client.git NvidiaAIAAClient 58 | cd NvidiaAIAAClient 59 | mkdir build 60 | cd build 61 | cmake -DCMAKE_BUILD_TYPE=Release ../ 62 | 63 | # If ITK is installed locally 64 | export MYINSTALL_DIR=/home/xyz/install 65 | cmake -DCMAKE_BUILD_TYPE=Release -DITK_DIR=${MYINSTALL_DIR}/lib/cmake/ITK-4.13 ../ 66 | 67 | # If ITK and Poco are installed locally 68 | cmake -DCMAKE_BUILD_TYPE=Release -DITK_DIR=${MYINSTALL_DIR}/lib/cmake/ITK-4.13 -DPoco_DIR=${MYINSTALL_DIR}/lib/cmake/Poco ../ 69 | 70 | To Build binaries/package on Linux/MacOS: 71 | - make -j6 72 | - cd NvidiaAIAAClient-Build 73 | - make `package` 74 | 75 | To Build binaries/package on Windows: 76 | - open ``NvidiaAIAAClient-superbuild.sln`` and run ``ALL_BUILD`` target 77 | - open ``NvidiaAIAAClient.sln`` under NvidiaAIAAClient-Build and run ``PACKAGE`` target to build *(in Release mode)* an installable-package 78 | 79 | 80 | .. note:: 81 | - Use Release mode for faster build. 82 | - For Windows, use CMAKE GUI client to configure and generate the files. 83 | - For Windows, if ITK is not externally installed, then use shorter path for *ROOT* Folder e.g. ``C:/NvidiaAIAAClient`` to avoid ``LongPath`` error. 84 | 85 | Following are some additional CMake Flags helpful while configuring the project. 86 | - ``ITK_DIR`` - use already installed ITK libraries and includes 87 | - ``Poco_DIR`` - use already installed Poco libraries and includes 88 | - ``AIAA_LOG_DEBUG_ENABLED`` - enable/disable Debug-level Logging (default: 0) 89 | - ``AIAA_LOG_INFO_ENABLED`` - enable/disable Info-level Logging (default: 1) 90 | 91 | 92 | Building the Documentation 93 | -------------------------- 94 | 95 | The NVIDIA AI-Assisted Annotation Client documentation is found in the docs/ directory and is based 96 | on `Sphinx `_. `Doxygen `_ integrated with `Exhale `_ is 97 | used for C++ API docuementation. 98 | 99 | To build the docs install the required dependencies:: 100 | 101 | $ apt-get update 102 | $ apt-get install -y --no-install-recommends doxygen 103 | $ pip install --upgrade sphinx sphinx-rtd-theme nbsphinx exhale breathe SimpleITK numpy 104 | 105 | Then use Sphinx to build the documentation into the build/html 106 | directory:: 107 | 108 | $ cd docs 109 | $ make clean html 110 | -------------------------------------------------------------------------------- /docs/build.sh: -------------------------------------------------------------------------------- 1 | pip install --upgrade sphinx sphinx-rtd-theme nbsphinx exhale breathe SimpleITK numpy 2 | sphinx-build -b html . build 3 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | # -*- coding: utf-8 -*- 28 | # 29 | # Configuration file for the Sphinx documentation builder. 30 | # 31 | # This file does only contain a selection of the most common options. For a 32 | # full list see the documentation: 33 | # http://www.sphinx-doc.org/en/master/config 34 | 35 | # -- Path setup -------------------------------------------------------------- 36 | 37 | # If extensions (or modules to document with autodoc) are in another directory, 38 | # add these directories to sys.path here. If the directory is relative to the 39 | # documentation root, use os.path.abspath to make it absolute, like shown here. 40 | # 41 | import os 42 | import sys 43 | sys.path.insert(0, os.path.abspath('../py_client')) 44 | 45 | from builtins import str 46 | import os 47 | import re 48 | import sphinx_rtd_theme 49 | import subprocess 50 | import textwrap 51 | 52 | # -- Project information ----------------------------------------------------- 53 | project = u'NVIDIA AI-Assisted Annotation Client' 54 | copyright = u'2019, NVIDIA Corporation' 55 | author = u'NVIDIA Corporation' 56 | 57 | release = '1.0.2' 58 | version = '1.0.2' 59 | 60 | # -- General configuration --------------------------------------------------- 61 | extensions = [ 62 | 'sphinx.ext.autodoc', 63 | 'sphinx.ext.mathjax', 64 | 'sphinx.ext.napoleon', 65 | 'sphinx.ext.ifconfig', 66 | 'sphinx.ext.extlinks', 67 | 'nbsphinx', 68 | 'breathe', 69 | 'exhale' 70 | ] 71 | 72 | # Add any paths that contain templates here, relative to this directory. 73 | templates_path = ['templates'] 74 | 75 | source_suffix = '.rst' 76 | master_doc = 'index' 77 | 78 | language = None 79 | exclude_patterns = [u'build', 'Thumbs.db', '.DS_Store', '**.ipynb_checkpoints'] 80 | pygments_style = 'sphinx' 81 | 82 | # Setup the breathe extension 83 | breathe_projects = { 84 | "BreatheAIAAClient": "./doxyoutput/xml" 85 | } 86 | breathe_default_project = "BreatheAIAAClient" 87 | 88 | # Setup the exhale extension 89 | exhale_args = { 90 | # These arguments are required 91 | "containmentFolder": "./cpp_api", 92 | "rootFileName": "cpp_api_root.rst", 93 | "rootFileTitle": "C++ API", 94 | "doxygenStripFromPath": "..", 95 | 96 | # Suggested optional arguments 97 | "createTreeView": True, 98 | "exhaleExecutesDoxygen": True, 99 | "exhaleDoxygenStdin": textwrap.dedent(''' 100 | JAVADOC_AUTOBRIEF = YES 101 | INPUT = ../cpp-client/include/nvidia/aiaa/client.h ../cpp-client/include/nvidia/aiaa/common.h ../cpp-client/include/nvidia/aiaa/model.h ../cpp-client/include/nvidia/aiaa/pointset.h ../cpp-client/include/nvidia/aiaa/polygon.h ../cpp-client/include/nvidia/aiaa/utils.h ../cpp-client/include/nvidia/aiaa/imageinfo.h ../cpp-client/include/nvidia/aiaa/exception.h 102 | ''') 103 | } 104 | 105 | highlight_language = 'text' 106 | 107 | # -- Options for HTML output ------------------------------------------------- 108 | html_theme = 'sphinx_rtd_theme' 109 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] 110 | html_theme_options = { 111 | 'collapse_navigation': False, 112 | 'display_version': True, 113 | 'logo_only': False, 114 | } 115 | -------------------------------------------------------------------------------- /docs/contribute.rst: -------------------------------------------------------------------------------- 1 | .. 2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions 6 | # are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of NVIDIA CORPORATION nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | Contributing 29 | ============ 30 | 31 | Contributions to NVIDIA AI-Assisted Annotation Client are more than welcome. To 32 | contribute make a pull request and follow the guidelines outlined in 33 | the `CONTRIBUTING 34 | `_ 35 | document. 36 | 37 | Coding Convention 38 | ----------------- 39 | 40 | Use clang-format to format all source files (\*.h, \*.cpp) to 41 | a consistent format. You should run clang-format on all source files 42 | before submitting a pull request:: 43 | 44 | $ apt-get install clang-format clang-format-6.0 45 | $ clang-format-6.0 --style=file -i *.cpp *.h 46 | 47 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. 2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions 6 | # are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of NVIDIA CORPORATION nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | NVIDIA AI-Assisted Annotation Client 29 | ==================================== 30 | 31 | .. ifconfig:: "dev" in release 32 | 33 | .. warning:: 34 | You are currently viewing unstable developer preview 35 | of the documentation. To see the documentation for the latest 36 | stable release click `here 37 | `_. 38 | 39 | .. toctree:: 40 | :hidden: 41 | 42 | Documentation home 43 | 44 | .. toctree:: 45 | :maxdepth: 2 46 | :caption: User Guide 47 | 48 | quickstart 49 | build 50 | tools 51 | contribute 52 | 53 | .. toctree:: 54 | :maxdepth: 2 55 | :caption: API Reference 56 | 57 | cpp_api/cpp_api_root 58 | python_api 59 | 60 | 61 | Indices and tables 62 | ================== 63 | 64 | * :ref:`genindex` 65 | -------------------------------------------------------------------------------- /docs/python_api.rst: -------------------------------------------------------------------------------- 1 | .. 2 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions 6 | # are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of NVIDIA CORPORATION nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | Python API 29 | ========== 30 | 31 | Client 32 | ------ 33 | 34 | .. automodule:: client_api 35 | :members: 36 | :undoc-members: 37 | -------------------------------------------------------------------------------- /docs/templates/layout.html: -------------------------------------------------------------------------------- 1 | 28 | {% extends "!layout.html" %} 29 | {% block sidebartitle %} {{ super() }} 30 | 31 | 63 | {% endblock %} 64 | 65 | {% block footer %} {{ super() }} 66 | 67 | 82 | {% endblock %} 83 | -------------------------------------------------------------------------------- /mitk-plugin/CMake/PackageDepends/MITK_NvidiaAIAAClient_Config.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | find_package(NvidiaAIAAClient REQUIRED) 28 | 29 | list(APPEND ALL_INCLUDE_DIRECTORIES ${NvidiaAIAAClient_INCLUDE_DIRS}) 30 | list(APPEND ALL_LINK_DIRECTORIES "${NvidiaAIAAClient_LIBRARY_DIR}") 31 | list(APPEND ALL_LIBRARIES ${NvidiaAIAAClient_LIBRARIES}) 32 | -------------------------------------------------------------------------------- /mitk-plugin/CMakeExternals/ExternalProjectList.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | # Nvidia AIAA Client 28 | mitkFunctionAddExternalProject(NAME NvidiaAIAAClient ON ADVANCED DEPENDS ITK Poco) 29 | -------------------------------------------------------------------------------- /mitk-plugin/CMakeExternals/NvidiaAIAAClient.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | #----------------------------------------------------------------------------- 28 | # NvidiaAIAAClient 29 | #----------------------------------------------------------------------------- 30 | 31 | # Sanity checks 32 | if(DEFINED NvidiaAIAAClient_DIR AND NOT EXISTS ${NvidiaAIAAClient_DIR}) 33 | message(FATAL_ERROR "NvidiaAIAAClient_DIR variable is defined but corresponds to non-existing directory") 34 | endif() 35 | 36 | set(proj NvidiaAIAAClient) 37 | set(proj_DEPENDENCIES ) 38 | set(${proj}_DEPENDS ${proj}) 39 | 40 | if(NOT DEFINED NvidiaAIAAClient_DIR) 41 | 42 | set(additional_cmake_args ) 43 | 44 | if(EXTERNAL_ITK_DIR) 45 | list(APPEND additional_cmake_args -DITK_DIR:PATH=${EXTERNAL_ITK_DIR}) 46 | else() 47 | list(APPEND proj_DEPENDENCIES ITK) 48 | list(APPEND additional_cmake_args -DITK_DIR:PATH=${ep_prefix}/lib/cmake/ITK-4.13) 49 | endif() 50 | 51 | if(EXTERNAL_Poco_DIR) 52 | list(APPEND additional_cmake_args -DPoco_DIR:PATH=${EXTERNAL_Poco_DIR}) 53 | else() 54 | list(APPEND proj_DEPENDENCIES Poco) 55 | list(APPEND additional_cmake_args -DPoco_DIR:PATH=${ep_prefix}/lib/cmake/Poco) 56 | endif() 57 | 58 | list(APPEND additional_cmake_args -DAIAA_LOG_DEBUG_ENABLED=1) 59 | 60 | message(STATUS "NvidiaAIAAClient CMAKE_CURRENT_LIST_DIR = ${CMAKE_CURRENT_LIST_DIR}") 61 | ExternalProject_Add(${proj} 62 | SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../ 63 | DOWNLOAD_COMMAND "" 64 | BUILD_ALWAYS 1 65 | 66 | CMAKE_GENERATOR ${gen} 67 | CMAKE_ARGS 68 | ${ep_common_args} 69 | ${additional_cmake_args} 70 | DEPENDS ${proj_DEPENDENCIES} 71 | ) 72 | 73 | set(${proj}_DIR ${ep_prefix}/lib/cmake/${proj}) 74 | 75 | else() 76 | mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") 77 | endif() 78 | -------------------------------------------------------------------------------- /mitk-plugin/Modules/ModuleList.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | set(MITK_MODULES 28 | NvidiaAIAAModule 29 | ) 30 | -------------------------------------------------------------------------------- /mitk-plugin/Modules/NvidiaAIAAModule/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | mitk_create_module(NvidiaAIAAModule 28 | DEPENDS PUBLIC MitkSegmentationUI 29 | PACKAGE_DEPENDS NvidiaAIAAClient 30 | ) 31 | -------------------------------------------------------------------------------- /mitk-plugin/Modules/NvidiaAIAAModule/files.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | set(CPP_FILES 28 | NvidiaDextrSegTool3D.cpp 29 | NvidiaSmartPolySegTool2D.cpp 30 | NvidiaDeepgrowSegTool2D.cpp 31 | NvidiaPointSetDataInteractor.cpp 32 | ) 33 | 34 | set(RESOURCE_FILES 35 | nvidia_logo.png 36 | ) 37 | -------------------------------------------------------------------------------- /mitk-plugin/Modules/NvidiaAIAAModule/include/NvidiaDeepgrowSegTool2D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef NvidiaDeepgrowSegTool2D_h 30 | #define NvidiaDeepgrowSegTool2D_h 31 | 32 | #include 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include 41 | #include 42 | #include 43 | 44 | namespace us { 45 | class ModuleResource; 46 | } 47 | 48 | class MITKNVIDIAAIAAMODULE_EXPORT NvidiaDeepgrowSegTool2D : public mitk::AutoSegmentationTool 49 | { 50 | public: 51 | mitkClassMacro(NvidiaDeepgrowSegTool2D, AutoSegmentationTool); 52 | itkFactorylessNewMacro(Self); 53 | 54 | us::ModuleResource GetIconResource() const override; 55 | 56 | bool CanHandle(const mitk::BaseData* referenceData, const mitk::BaseData* workingData) const override; 57 | const char* GetName() const override; 58 | const char** GetXPM() const override; 59 | 60 | void Activated() override; 61 | void Deactivated() override; 62 | 63 | virtual mitk::DataNode::Pointer GetPointSetNode(); 64 | mitk::DataNode* GetReferenceData(); 65 | mitk::DataNode* GetWorkingData(); 66 | mitk::DataStorage* GetDataStorage(); 67 | 68 | void SetServerURI(const std::string &serverURI, const int serverTimeout); 69 | void GetModelInfo(std::map& deepgrow); 70 | void PointAdded(mitk::DataNode::Pointer imageNode, bool background); 71 | void ClearPoints(); 72 | 73 | void RunDeepGrow(const std::string &model, mitk::DataNode::Pointer imageNode); 74 | 75 | 76 | protected: 77 | NvidiaDeepgrowSegTool2D(); 78 | ~NvidiaDeepgrowSegTool2D() override; 79 | 80 | template 81 | void ItkImageProcessRunDeepgrow(itk::Image *itkImage, std::string imageNodeId); 82 | 83 | template 84 | void DisplayResult(const std::string &tmpResultFileName, const int sliceIndex); 85 | 86 | int GetCurrentSlice(const nvidia::aiaa::PointSet &points); 87 | nvidia::aiaa::PointSet GetPointsForCurrentSlice(const nvidia::aiaa::PointSet &points, int sliceIndex); 88 | 89 | private: 90 | mitk::PointSet::Pointer m_PointSet; 91 | mitk::PointSetDataInteractor::Pointer m_pointInteractor; 92 | mitk::DataNode::Pointer m_PointSetNode; 93 | 94 | std::map m_AIAASessions; 95 | nvidia::aiaa::PointSet m_foregroundPoints; 96 | nvidia::aiaa::PointSet m_backgroundPoints; 97 | 98 | std::string m_AIAAServerUri; 99 | int m_AIAAServerTimeout; 100 | nvidia::aiaa::ModelList m_AIAAModelList; 101 | std::string m_AIAACurrentModelName; 102 | }; 103 | 104 | #endif 105 | -------------------------------------------------------------------------------- /mitk-plugin/Modules/NvidiaAIAAModule/include/NvidiaDextrSegTool3D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef NvidiaDextrSegTool3D_h 30 | #define NvidiaDextrSegTool3D_h 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #include 38 | #include 39 | 40 | #include 41 | #include 42 | 43 | namespace us { 44 | class ModuleResource; 45 | } 46 | 47 | class MITKNVIDIAAIAAMODULE_EXPORT NvidiaDextrSegTool3D : public mitk::AutoSegmentationTool 48 | { 49 | public: 50 | mitkClassMacro(NvidiaDextrSegTool3D, AutoSegmentationTool); 51 | itkFactorylessNewMacro(Self); 52 | 53 | us::ModuleResource GetIconResource() const override; 54 | 55 | bool CanHandle(const mitk::BaseData* referenceData, const mitk::BaseData* workingData) const override; 56 | const char *GetName() const override; 57 | const char **GetXPM() const override; 58 | 59 | void SetServerURI(const std::string &serverURI, const int serverTimeout, bool filterByLabel); 60 | void GetModelInfo(std::map& seg, std::map& ann); 61 | void ClearPoints(); 62 | void ConfirmPoints(const std::string &modelName); 63 | void RunAutoSegmentation(const std::string &modelName); 64 | 65 | protected: 66 | NvidiaDextrSegTool3D(); 67 | ~NvidiaDextrSegTool3D() override; 68 | 69 | void Activated() override; 70 | void Deactivated() override; 71 | 72 | private: 73 | std::string m_AIAAServerUri; 74 | int m_AIAAServerTimeout; 75 | nvidia::aiaa::ModelList m_AIAAModelList; 76 | std::string m_AIAACurrentModelName; 77 | 78 | mitk::PointSet::Pointer m_PointSet; 79 | mitk::DataNode::Pointer m_PointSetNode; 80 | mitk::PointSetDataInteractor::Pointer m_SeedPointInteractor; 81 | 82 | mitk::DataNode::Pointer m_WorkingData; 83 | mitk::DataNode::Pointer m_OriginalImageNode; 84 | 85 | template 86 | void ItkImageProcessDextr3D(itk::Image *itkImage, mitk::BaseGeometry *imageGeometry); 87 | 88 | template 89 | void ItkImageProcessAutoSegmentation(itk::Image *itkImage, mitk::BaseGeometry *imageGeometry); 90 | 91 | template 92 | void addToPointSet(const nvidia::aiaa::PointSet& pointSet, mitk::BaseGeometry *imageGeometry); 93 | 94 | template 95 | nvidia::aiaa::PointSet getPointSet(mitk::BaseGeometry *imageGeometry); 96 | 97 | template 98 | void boundingBoxRender(const std::string &tmpResultFileName, const std::string &organName); 99 | 100 | template 101 | void displayResult(const std::string &tmpResultFileName); 102 | }; 103 | 104 | #endif 105 | -------------------------------------------------------------------------------- /mitk-plugin/Modules/NvidiaAIAAModule/include/NvidiaPointSetDataInteractor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef NvidiaPointSetDataInteractor_h_ 30 | #define NvidiaPointSetDataInteractor_h_ 31 | 32 | #include 33 | #include 34 | 35 | class NvidiaSmartPolySegTool2D; 36 | 37 | class MITKNVIDIAAIAAMODULE_EXPORT NvidiaPointSetDataInteractor : public mitk::PointSetDataInteractor 38 | { 39 | public: 40 | mitkClassMacro(NvidiaPointSetDataInteractor, PointSetDataInteractor) itkFactorylessNewMacro(Self) 41 | 42 | void setNvidiaSmartPolySegTool(NvidiaSmartPolySegTool2D *smartPoly); 43 | 44 | protected: 45 | NvidiaPointSetDataInteractor(); 46 | ~NvidiaPointSetDataInteractor() override; 47 | 48 | void ConnectActionsAndFunctions() override; 49 | void NvidiaSmartPoly(mitk::StateMachineAction * /*stateMachineAction*/, 50 | mitk::InteractionEvent * /*interactionEvent*/); 51 | 52 | private: 53 | NvidiaSmartPolySegTool2D *m_NvidiaSmartPolySegTool2D; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /mitk-plugin/Modules/NvidiaAIAAModule/include/NvidiaSmartPolySegTool2D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef NvidiaSmartPolySegTool2D_h 30 | #define NvidiaSmartPolySegTool2D_h 31 | 32 | #include 33 | #include 34 | 35 | #include 36 | #include 37 | 38 | #include "NvidiaPointSetDataInteractor.h" 39 | #include 40 | 41 | namespace us { 42 | class ModuleResource; 43 | } 44 | 45 | class MITKNVIDIAAIAAMODULE_EXPORT NvidiaSmartPolySegTool2D : public mitk::AutoSegmentationTool 46 | { 47 | public: 48 | mitkClassMacro(NvidiaSmartPolySegTool2D, AutoSegmentationTool); 49 | itkFactorylessNewMacro(Self); 50 | 51 | us::ModuleResource GetIconResource() const override; 52 | const char *GetName() const override; 53 | const char **GetXPM() const override; 54 | 55 | void Activated() override; 56 | void Deactivated() override; 57 | 58 | void PolygonFix(); 59 | void Mask2Polygon(); 60 | 61 | void SetCurrentSlice(unsigned int slice); 62 | void SetServerURI(const std::string &serverURI, const int serverTimeout); 63 | void SetNeighborhoodSize(int neighborhoodSize); 64 | 65 | protected: 66 | NvidiaSmartPolySegTool2D(); 67 | ~NvidiaSmartPolySegTool2D() override; 68 | 69 | std::string create2DSliceImage(); 70 | void displayResult(const std::string &tmpResultFileName); 71 | 72 | private: 73 | std::string m_AIAAServerUri; 74 | int m_AIAAServerTimeout; 75 | int m_NeighborhoodSize; 76 | 77 | mitk::PointSet::Pointer m_PointSetPolygon; 78 | mitk::DataNode::Pointer m_PointSetPolygonNode; 79 | NvidiaPointSetDataInteractor::Pointer m_PointInteractor; 80 | 81 | mitk::DataNode::Pointer m_WorkingData; 82 | mitk::DataNode::Pointer m_OriginalImageNode; 83 | mitk::DataNode::Pointer m_ResultNode; 84 | 85 | std::vector m_MinIndex; 86 | std::vector m_MaxIndex; 87 | unsigned int m_currentSlice; 88 | 89 | unsigned int *m_imageSize; 90 | mitk::BaseGeometry::Pointer m_imageGeometry; 91 | 92 | nvidia::aiaa::PolygonsList m_polygonsList; 93 | }; 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /mitk-plugin/Modules/NvidiaAIAAModule/resource/nvidia_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/mitk-plugin/Modules/NvidiaAIAAModule/resource/nvidia_logo.png -------------------------------------------------------------------------------- /mitk-plugin/Modules/NvidiaAIAAModule/src/NvidiaPointSetDataInteractor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | NvidiaPointSetDataInteractor::NvidiaPointSetDataInteractor() 33 | : m_NvidiaSmartPolySegTool2D(nullptr) { 34 | } 35 | 36 | NvidiaPointSetDataInteractor::~NvidiaPointSetDataInteractor() { 37 | } 38 | 39 | void NvidiaPointSetDataInteractor::setNvidiaSmartPolySegTool(NvidiaSmartPolySegTool2D *smartPoly) { 40 | m_NvidiaSmartPolySegTool2D = smartPoly; 41 | } 42 | 43 | void NvidiaPointSetDataInteractor::ConnectActionsAndFunctions() { 44 | Superclass::ConnectActionsAndFunctions(); 45 | CONNECT_FUNCTION("finishMovement", NvidiaSmartPoly); 46 | } 47 | 48 | void NvidiaPointSetDataInteractor::NvidiaSmartPoly(mitk::StateMachineAction * /*stateMachineAction*/, mitk::InteractionEvent * /*interactionEvent*/) { 49 | if (m_NvidiaSmartPolySegTool2D) { 50 | m_NvidiaSmartPolySegTool2D->PolygonFix(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/PluginList.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions 5 | # are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of NVIDIA CORPORATION nor the names of its 12 | # contributors may be used to endorse or promote products derived 13 | # from this software without specific prior written permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 16 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | set(MITK_PLUGINS 28 | org.mitk.nvidia.aiaa:ON 29 | ) 30 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(org_mitk_nvidia_aiaa) 2 | 3 | mitk_create_plugin( 4 | EXPORT_DIRECTIVE NVIDIA_AIAA_EXPORT 5 | EXPORTED_INCLUDE_SUFFIXES src 6 | MODULE_DEPENDS MitkNvidiaAIAAModule 7 | PACKAGE_DEPENDS Poco|Net 8 | ) 9 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/files.cmake: -------------------------------------------------------------------------------- 1 | set(CPP_FILES 2 | src/internal/PluginActivator.cpp 3 | src/internal/QmitkNvidiaAIAAPreferencePage.cpp 4 | src/NvidiaSmartPolySegTool2DGUI.cpp 5 | src/NvidiaDeepgrowSegTool2DGUI.cpp 6 | src/NvidiaDextrSegTool3DGUI.cpp 7 | ) 8 | 9 | set(UI_FILES 10 | src/internal/QmitkNvidiaAIAAPreferencePage.ui 11 | src/NvidiaSmartPolySegTool2DGUI.ui 12 | src/NvidiaDeepgrowSegTool2DGUI.ui 13 | src/NvidiaDextrSegTool3DGUI.ui 14 | ) 15 | 16 | set(MOC_H_FILES 17 | src/internal/PluginActivator.h 18 | src/internal/QmitkNvidiaAIAAPreferencePage.h 19 | src/NvidiaSmartPolySegTool2DGUI.h 20 | src/NvidiaDeepgrowSegTool2DGUI.h 21 | src/NvidiaDextrSegTool3DGUI.h 22 | ) 23 | 24 | set(CACHED_RESOURCE_FILES 25 | plugin.xml 26 | ) 27 | 28 | set(QRC_FILES 29 | ) 30 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/manifest_headers.cmake: -------------------------------------------------------------------------------- 1 | set(Plugin-Name "Nvidia AIAA") 2 | set(Plugin-Version "1.0") 3 | set(Plugin-Vendor "Nvidia") 4 | set(Plugin-ContactAddress "https://www.nvidia.com/") 5 | set(Require-Plugin org.blueberry.ui.qt) 6 | set(Plugin-ActivationPolicy "eager") 7 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/src/NvidiaDeepgrowSegTool2DGUI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | MITK_TOOL_GUI_MACRO(NVIDIA_AIAA_EXPORT, NvidiaDeepgrowSegTool2DGUI, "") 38 | 39 | NvidiaDeepgrowSegTool2DGUI::NvidiaDeepgrowSegTool2DGUI() 40 | : m_Ui(new Ui::NvidiaDeepgrowSegTool2DGUI) { 41 | 42 | m_Ui->setupUi(this); 43 | 44 | connect(this, SIGNAL(NewToolAssociated(mitk::Tool *)), this, SLOT(OnNewToolAssociated(mitk::Tool *))); 45 | connect(m_Ui->clearPointsBtn, SIGNAL(clicked()), this, SLOT(OnClearPoints())); 46 | } 47 | 48 | NvidiaDeepgrowSegTool2DGUI::~NvidiaDeepgrowSegTool2DGUI() { 49 | if (m_NvidiaDeepgrowSegTool2D.IsNull()) { 50 | return; 51 | } 52 | 53 | if (m_NvidiaDeepgrowSegTool2D->GetPointSetNode().IsNotNull()) { 54 | m_NvidiaDeepgrowSegTool2D->GetPointSetNode()->GetData()->RemoveObserver(m_PointSetAddObserverTag); 55 | m_NvidiaDeepgrowSegTool2D->GetPointSetNode()->GetData()->RemoveObserver(m_PointSetMoveObserverTag); 56 | } 57 | } 58 | 59 | void NvidiaDeepgrowSegTool2DGUI::OnNewToolAssociated(mitk::Tool *tool) { 60 | m_NvidiaDeepgrowSegTool2D = dynamic_cast(tool); 61 | if (m_NvidiaDeepgrowSegTool2D.IsNull()) { 62 | return; 63 | } 64 | 65 | m_InputImageNode = m_NvidiaDeepgrowSegTool2D->GetReferenceData(); 66 | 67 | itk::SimpleMemberCommand::Pointer pointAddedCommand = itk::SimpleMemberCommand::New(); 68 | pointAddedCommand->SetCallbackFunction(this, &NvidiaDeepgrowSegTool2DGUI::OnPointAdded); 69 | 70 | m_PointSetAddObserverTag = m_NvidiaDeepgrowSegTool2D->GetPointSetNode()->GetData()->AddObserver(mitk::PointSetAddEvent(), pointAddedCommand); 71 | m_PointSetMoveObserverTag = m_NvidiaDeepgrowSegTool2D->GetPointSetNode()->GetData()->AddObserver(mitk::PointSetMoveEvent(), pointAddedCommand); 72 | 73 | UpdateConfigs(); 74 | } 75 | 76 | void NvidiaDeepgrowSegTool2DGUI::OnClearPoints() { 77 | if (m_NvidiaDeepgrowSegTool2D.IsNotNull()) { 78 | m_NvidiaDeepgrowSegTool2D->ClearPoints(); 79 | } 80 | } 81 | 82 | void NvidiaDeepgrowSegTool2DGUI::OnPointAdded() { 83 | if (m_NvidiaDeepgrowSegTool2D.IsNull()) { 84 | return; 85 | } 86 | 87 | QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); 88 | 89 | try { 90 | bool background = m_Ui->backgroundBtn->isChecked(); 91 | m_NvidiaDeepgrowSegTool2D->PointAdded(m_InputImageNode, background); 92 | m_NvidiaDeepgrowSegTool2D->RunDeepGrow(m_Ui->deepgrowCombo->currentText().toStdString(), m_InputImageNode); 93 | } catch (...) { 94 | } 95 | 96 | QApplication::restoreOverrideCursor(); 97 | } 98 | 99 | void NvidiaDeepgrowSegTool2DGUI::UpdateConfigs() { 100 | if (m_NvidiaDeepgrowSegTool2D.IsNull()) { 101 | return; 102 | } 103 | 104 | auto preferencesService = berry::Platform::GetPreferencesService(); 105 | auto systemPreferences = preferencesService->GetSystemPreferences(); 106 | auto preferences = systemPreferences->Node("/org.mitk.preferences.nvidia.aiaa"); 107 | 108 | auto serverURI = preferences->Get(QmitkNvidiaAIAAPreferencePage::SERVER_URI, QmitkNvidiaAIAAPreferencePage::DEFAULT_SERVER_URI); 109 | auto serverTimeout = preferences->GetInt(QmitkNvidiaAIAAPreferencePage::SERVER_TIMEOUT, QmitkNvidiaAIAAPreferencePage::DEFAULT_SERVER_TIMEOUT); 110 | 111 | m_NvidiaDeepgrowSegTool2D->SetServerURI(serverURI.toStdString(), serverTimeout); 112 | 113 | m_Ui->deepgrowCombo->clear(); 114 | 115 | std::map deepgrow; 116 | m_NvidiaDeepgrowSegTool2D->GetModelInfo(deepgrow); 117 | 118 | for (auto it = deepgrow.begin(); it != deepgrow.end(); it++) { 119 | m_Ui->deepgrowCombo->addItem(QString::fromUtf8(it->first.c_str())); 120 | m_Ui->deepgrowCombo->setItemData(m_Ui->deepgrowCombo->count() - 1, QVariant(it->second.c_str()), Qt::ToolTipRole); 121 | } 122 | } 123 | 124 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/src/NvidiaDeepgrowSegTool2DGUI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef NvidiaDeepgrowSegTool2DGUI_h 30 | #define NvidiaDeepgrowSegTool2DGUI_h 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "NvidiaDeepgrowSegTool2D.h" 37 | 38 | namespace Ui { 39 | class NvidiaDeepgrowSegTool2DGUI; 40 | } 41 | 42 | // Look into NvidiaDeepgrowSegTool2D.h for more information. 43 | 44 | class NVIDIA_AIAA_EXPORT NvidiaDeepgrowSegTool2DGUI : public QmitkToolGUI 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | mitkClassMacro(NvidiaDeepgrowSegTool2DGUI, QmitkToolGUI) 50 | itkFactorylessNewMacro(Self) 51 | 52 | protected slots: 53 | void OnNewToolAssociated(mitk::Tool *); 54 | void OnClearPoints(); 55 | 56 | protected: 57 | NvidiaDeepgrowSegTool2DGUI(); 58 | ~NvidiaDeepgrowSegTool2DGUI() override; 59 | 60 | void OnPointAdded(); 61 | void UpdateConfigs(); 62 | 63 | private: 64 | QScopedPointer m_Ui; 65 | NvidiaDeepgrowSegTool2D::Pointer m_NvidiaDeepgrowSegTool2D; 66 | 67 | mitk::DataNode::Pointer m_InputImageNode; 68 | long m_PointSetAddObserverTag = 0; 69 | long m_PointSetMoveObserverTag = 0; 70 | }; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/src/NvidiaDeepgrowSegTool2DGUI.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | NvidiaDeepgrowSegTool2DGUI 4 | 5 | 6 | 7 | 0 8 | 0 9 | 320 10 | 240 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 22 | 23 | Press (Shift + Click) to add points. Change server URI in Nvidia AIAA preferences (Ctrl+P) 24 | 25 | 26 | true 27 | 28 | 29 | 30 | 31 | 32 | 33 | Select Your Deepgrow Model 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | Switch between foreground/background to add points 43 | 44 | 45 | Background Mode 46 | 47 | 48 | true 49 | 50 | 51 | 52 | 53 | 54 | 55 | Click to Discard All Selected Points 56 | 57 | 58 | Clear Points 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/src/NvidiaDextrSegTool3DGUI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef NvidiaDextrSegTool3DGUI_h 30 | #define NvidiaDextrSegTool3DGUI_h 31 | 32 | #include 33 | 34 | #include 35 | #include 36 | 37 | #include "NvidiaDextrSegTool3D.h" 38 | 39 | namespace Ui { 40 | class NvidiaDextrSegTool3DGUI; 41 | } 42 | 43 | class NVIDIA_AIAA_EXPORT NvidiaDextrSegTool3DGUI : public QmitkToolGUI 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | mitkClassMacro(NvidiaDextrSegTool3DGUI, QmitkToolGUI) 49 | itkFactorylessNewMacro(Self) 50 | 51 | protected slots: 52 | void OnClearPoints(); 53 | void OnConfirmPoints(); 54 | void OnAutoSegmentation(); 55 | void OnNewToolAssociated(mitk::Tool *); 56 | 57 | protected: 58 | NvidiaDextrSegTool3DGUI(); 59 | ~NvidiaDextrSegTool3DGUI() override; 60 | void updateConfigs(); 61 | 62 | private: 63 | QScopedPointer m_Ui; 64 | NvidiaDextrSegTool3D::Pointer m_NvidiaDextrSegTool3D; 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/src/NvidiaSmartPolySegTool2DGUI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | MITK_TOOL_GUI_MACRO(NVIDIA_AIAA_EXPORT, NvidiaSmartPolySegTool2DGUI, "") 38 | 39 | NvidiaSmartPolySegTool2DGUI::NvidiaSmartPolySegTool2DGUI() : m_Ui(new Ui::NvidiaSmartPolySegTool2DGUI) 40 | { 41 | m_Ui->setupUi(this); 42 | connect(this, SIGNAL(NewToolAssociated(mitk::Tool *)), this, SLOT(OnNewToolAssociated(mitk::Tool *))); 43 | 44 | m_SliceIsConnected = false; 45 | } 46 | 47 | NvidiaSmartPolySegTool2DGUI::~NvidiaSmartPolySegTool2DGUI() { 48 | } 49 | 50 | void NvidiaSmartPolySegTool2DGUI::updateConfigs() { 51 | if (m_NvidiaSmartPolySegTool2D.IsNotNull()) { 52 | auto preferencesService = berry::Platform::GetPreferencesService(); 53 | auto systemPreferences = preferencesService->GetSystemPreferences(); 54 | auto preferences = systemPreferences->Node("/org.mitk.preferences.nvidia.aiaa"); 55 | auto serverURI = preferences->Get(QmitkNvidiaAIAAPreferencePage::SERVER_URI, QmitkNvidiaAIAAPreferencePage::DEFAULT_SERVER_URI); 56 | auto serverTimeout = preferences->GetInt(QmitkNvidiaAIAAPreferencePage::SERVER_TIMEOUT, QmitkNvidiaAIAAPreferencePage::DEFAULT_SERVER_TIMEOUT); 57 | auto neighborhoodSize = preferences->GetInt(QmitkNvidiaAIAAPreferencePage::NEIGHBORHOOD_SIZE, QmitkNvidiaAIAAPreferencePage::DEFAULT_NEIGHBORHOOD_SIZE); 58 | 59 | m_NvidiaSmartPolySegTool2D->SetServerURI(serverURI.toStdString(), serverTimeout); 60 | m_NvidiaSmartPolySegTool2D->SetNeighborhoodSize(neighborhoodSize); 61 | } 62 | } 63 | 64 | void NvidiaSmartPolySegTool2DGUI::OnNewToolAssociated(mitk::Tool *tool) { 65 | m_NvidiaSmartPolySegTool2D = dynamic_cast(tool); 66 | 67 | if (m_NvidiaSmartPolySegTool2D.IsNotNull()) { 68 | updateConfigs(); 69 | 70 | mitk::BaseRenderer::Pointer renderer = mitk::BaseRenderer::GetInstance(mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget1")); 71 | if (renderer.IsNotNull() && !m_SliceIsConnected) { 72 | new QmitkStepperAdapter(this, renderer->GetSliceNavigationController()->GetSlice(), "stepper"); 73 | m_SliceIsConnected = true; 74 | } 75 | 76 | // convert current segmentation mask to polygon 77 | QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); 78 | try { 79 | m_NvidiaSmartPolySegTool2D->Mask2Polygon(); 80 | Refetch(); 81 | } catch (...) { 82 | } 83 | QApplication::restoreOverrideCursor(); 84 | } 85 | } 86 | 87 | void NvidiaSmartPolySegTool2DGUI::SetStepper(mitk::Stepper *stepper) { 88 | this->m_SliceStepper = stepper; 89 | } 90 | 91 | void NvidiaSmartPolySegTool2DGUI::Refetch() { 92 | // event from image navigator received - time step has changed 93 | updateConfigs(); 94 | if (m_NvidiaSmartPolySegTool2D.IsNotNull()) { 95 | m_NvidiaSmartPolySegTool2D->SetCurrentSlice(m_SliceStepper->GetPos()); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/src/NvidiaSmartPolySegTool2DGUI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of NVIDIA CORPORATION nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef NvidiaSmartPolySegTool2DGUI_h 30 | #define NvidiaSmartPolySegTool2DGUI_h 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #include "NvidiaSmartPolySegTool2D.h" 38 | 39 | namespace Ui { 40 | class NvidiaSmartPolySegTool2DGUI; 41 | } 42 | 43 | // Look into NvidiaSmartPolySegTool2D.h for more information. 44 | 45 | class NVIDIA_AIAA_EXPORT NvidiaSmartPolySegTool2DGUI : public QmitkToolGUI 46 | { 47 | Q_OBJECT 48 | 49 | public: 50 | mitkClassMacro(NvidiaSmartPolySegTool2DGUI, QmitkToolGUI) 51 | itkFactorylessNewMacro(Self) 52 | 53 | protected slots: 54 | void OnNewToolAssociated(mitk::Tool *); 55 | void Refetch(); 56 | void SetStepper(mitk::Stepper *); 57 | 58 | protected: 59 | NvidiaSmartPolySegTool2DGUI(); 60 | ~NvidiaSmartPolySegTool2DGUI() override; 61 | void updateConfigs(); 62 | 63 | private: 64 | QScopedPointer m_Ui; 65 | 66 | bool m_SliceIsConnected; 67 | mitk::Stepper::Pointer m_SliceStepper; 68 | NvidiaSmartPolySegTool2D::Pointer m_NvidiaSmartPolySegTool2D; 69 | }; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/src/NvidiaSmartPolySegTool2DGUI.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | NvidiaSmartPolySegTool2DGUI 4 | 5 | 6 | 7 | 0 8 | 0 9 | 320 10 | 240 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 22 | 23 | Drag polygon points to automatically correct 24 | 25 | 26 | true 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/src/internal/PluginActivator.cpp: -------------------------------------------------------------------------------- 1 | /*=================================================================== 2 | 3 | The Medical Imaging Interaction Toolkit (MITK) 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics. 7 | All rights reserved. 8 | 9 | This software is distributed WITHOUT ANY WARRANTY; without 10 | even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 | A PARTICULAR PURPOSE. 12 | 13 | See LICENSE.txt or http://www.mitk.org for details. 14 | 15 | ===================================================================*/ 16 | 17 | #include "PluginActivator.h" 18 | #include "QmitkNvidiaAIAAPreferencePage.h" 19 | 20 | #include 21 | 22 | void PluginActivator::start(ctkPluginContext* context) { 23 | Poco::Net::IPAddress forcePocoNetLinkage; 24 | forcePocoNetLinkage.af(); 25 | 26 | BERRY_REGISTER_EXTENSION_CLASS(QmitkNvidiaAIAAPreferencePage, context) 27 | } 28 | 29 | void PluginActivator::stop(ctkPluginContext*) { 30 | } 31 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/src/internal/PluginActivator.h: -------------------------------------------------------------------------------- 1 | /*=================================================================== 2 | 3 | The Medical Imaging Interaction Toolkit (MITK) 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics. 7 | All rights reserved. 8 | 9 | This software is distributed WITHOUT ANY WARRANTY; without 10 | even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 | A PARTICULAR PURPOSE. 12 | 13 | See LICENSE.txt or http://www.mitk.org for details. 14 | 15 | ===================================================================*/ 16 | 17 | #ifndef PluginActivator_h 18 | #define PluginActivator_h 19 | 20 | #include 21 | 22 | class PluginActivator : public QObject, public ctkPluginActivator { 23 | Q_OBJECT 24 | Q_PLUGIN_METADATA(IID "org_mitk_nvidia_aiaa") 25 | Q_INTERFACES(ctkPluginActivator) 26 | 27 | public: 28 | void start(ctkPluginContext* context); 29 | void stop(ctkPluginContext* context); 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/src/internal/QmitkNvidiaAIAAPreferencePage.cpp: -------------------------------------------------------------------------------- 1 | /*=================================================================== 2 | 3 | The Medical Imaging Interaction Toolkit (MITK) 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics. 7 | All rights reserved. 8 | 9 | This software is distributed WITHOUT ANY WARRANTY; without 10 | even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 | A PARTICULAR PURPOSE. 12 | 13 | See LICENSE.txt or http://www.mitk.org for details. 14 | 15 | ===================================================================*/ 16 | 17 | #include "QmitkNvidiaAIAAPreferencePage.h" 18 | 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | const QString QmitkNvidiaAIAAPreferencePage::SERVER_URI = "server uri"; 25 | const QString QmitkNvidiaAIAAPreferencePage::SERVER_TIMEOUT = "server timeout"; 26 | const QString QmitkNvidiaAIAAPreferencePage::FILTER_BY_LABEL = "filter models by label"; 27 | const QString QmitkNvidiaAIAAPreferencePage::NEIGHBORHOOD_SIZE = "neighborhood size"; 28 | 29 | const QString QmitkNvidiaAIAAPreferencePage::DEFAULT_SERVER_URI = "http://0.0.0.0:5000"; 30 | const int QmitkNvidiaAIAAPreferencePage::DEFAULT_SERVER_TIMEOUT = 60; 31 | const bool QmitkNvidiaAIAAPreferencePage::DEFAULT_FILTER_BY_LABEL = true; 32 | const int QmitkNvidiaAIAAPreferencePage::DEFAULT_NEIGHBORHOOD_SIZE = 1; 33 | 34 | QmitkNvidiaAIAAPreferencePage::QmitkNvidiaAIAAPreferencePage() 35 | : m_Widget(nullptr), 36 | m_Ui(new Ui::QmitkNvidiaAIAAPreferencePage), 37 | m_Preferences( 38 | berry::Platform::GetPreferencesService()->GetSystemPreferences()->Node("/org.mitk.preferences.nvidia.aiaa")) { 39 | } 40 | 41 | QmitkNvidiaAIAAPreferencePage::~QmitkNvidiaAIAAPreferencePage() { 42 | delete m_Ui; 43 | } 44 | 45 | void QmitkNvidiaAIAAPreferencePage::Init(berry::IWorkbench::Pointer) { 46 | } 47 | 48 | bool QmitkNvidiaAIAAPreferencePage::PerformOk() { 49 | m_Preferences->Put(SERVER_URI, m_Ui->serverURILineEdit->text()); 50 | m_Preferences->PutInt(SERVER_TIMEOUT, m_Ui->serverTimeoutSpinBox->value()); 51 | m_Preferences->PutBool(FILTER_BY_LABEL, m_Ui->modelFilterCheckBox->isChecked()); 52 | m_Preferences->PutInt(NEIGHBORHOOD_SIZE, m_Ui->neighborhoodSizeSpinBox->value()); 53 | 54 | return true; 55 | } 56 | 57 | void QmitkNvidiaAIAAPreferencePage::PerformCancel() { 58 | } 59 | 60 | void QmitkNvidiaAIAAPreferencePage::Update() { 61 | m_Ui->serverURILineEdit->setText(m_Preferences->Get(SERVER_URI, DEFAULT_SERVER_URI)); 62 | m_Ui->serverTimeoutSpinBox->setValue(m_Preferences->GetInt(SERVER_TIMEOUT, DEFAULT_SERVER_TIMEOUT)); 63 | m_Ui->modelFilterCheckBox->setChecked(m_Preferences->GetBool(FILTER_BY_LABEL, DEFAULT_FILTER_BY_LABEL)); 64 | m_Ui->neighborhoodSizeSpinBox->setValue(m_Preferences->GetInt(NEIGHBORHOOD_SIZE, DEFAULT_NEIGHBORHOOD_SIZE)); 65 | } 66 | 67 | void QmitkNvidiaAIAAPreferencePage::CreateQtControl(QWidget* parent) { 68 | m_Widget = new QWidget(parent); 69 | m_Ui->setupUi(m_Widget); 70 | 71 | this->Update(); 72 | } 73 | 74 | QWidget* QmitkNvidiaAIAAPreferencePage::GetQtControl() const { 75 | return m_Widget; 76 | } 77 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/src/internal/QmitkNvidiaAIAAPreferencePage.h: -------------------------------------------------------------------------------- 1 | /*=================================================================== 2 | 3 | The Medical Imaging Interaction Toolkit (MITK) 4 | 5 | Copyright (c) German Cancer Research Center, 6 | Division of Medical and Biological Informatics. 7 | All rights reserved. 8 | 9 | This software is distributed WITHOUT ANY WARRANTY; without 10 | even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 | A PARTICULAR PURPOSE. 12 | 13 | See LICENSE.txt or http://www.mitk.org for details. 14 | 15 | ===================================================================*/ 16 | 17 | #ifndef QmitkNvidiaAIAAPreferencePage_h 18 | #define QmitkNvidiaAIAAPreferencePage_h 19 | 20 | #include 21 | 22 | namespace Ui { 23 | class QmitkNvidiaAIAAPreferencePage; 24 | } 25 | 26 | class QmitkNvidiaAIAAPreferencePage : public QObject, public berry::IQtPreferencePage { 27 | Q_OBJECT 28 | Q_INTERFACES(berry::IPreferencePage) 29 | 30 | public: 31 | static const QString SERVER_URI; 32 | static const QString SERVER_TIMEOUT; 33 | static const QString FILTER_BY_LABEL; 34 | static const QString NEIGHBORHOOD_SIZE; 35 | 36 | static const QString DEFAULT_SERVER_URI; 37 | static const int DEFAULT_SERVER_TIMEOUT; 38 | static const bool DEFAULT_FILTER_BY_LABEL; 39 | static const int DEFAULT_NEIGHBORHOOD_SIZE; 40 | 41 | QmitkNvidiaAIAAPreferencePage(); 42 | ~QmitkNvidiaAIAAPreferencePage(); 43 | 44 | void Init(berry::IWorkbench::Pointer workbench) override; 45 | bool PerformOk() override; 46 | void PerformCancel() override; 47 | void Update() override; 48 | 49 | void CreateQtControl(QWidget* parent) override; 50 | QWidget* GetQtControl() const override; 51 | 52 | private: 53 | QWidget* m_Widget; 54 | Ui::QmitkNvidiaAIAAPreferencePage* m_Ui; 55 | berry::IPreferences::Pointer m_Preferences; 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /mitk-plugin/Plugins/org.mitk.nvidia.aiaa/src/internal/QmitkNvidiaAIAAPreferencePage.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | QmitkNvidiaAIAAPreferencePage 4 | 5 | 6 | 7 | 0 8 | 0 9 | 433 10 | 300 11 | 12 | 13 | 14 | Nvidia AIAA 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Server URI 23 | 24 | 25 | serverURILineEdit 26 | 27 | 28 | 29 | 30 | 31 | 32 | http://0.0.0.0:5000/v1 33 | 34 | 35 | 36 | 37 | 38 | 39 | Server Timeout (In Sec) 40 | 41 | 42 | 43 | 44 | 45 | 46 | 1 47 | 48 | 49 | 1200 50 | 51 | 52 | 60 53 | 54 | 55 | 56 | 57 | 58 | 59 | Filter Models By Label 60 | 61 | 62 | modelFilterCheckBox 63 | 64 | 65 | 66 | 67 | 68 | 69 | true 70 | 71 | 72 | 73 | 74 | 75 | 76 | SmartPoly Neighborhood Size 77 | 78 | 79 | neighborhoodSizeSpinBox 80 | 81 | 82 | 83 | 84 | 85 | 86 | 100 87 | 88 | 89 | 1 90 | 91 | 92 | 93 | 94 | 95 | 96 | Transpose Polygon 97 | 98 | 99 | flipPolyCheckBox 100 | 101 | 102 | 103 | 104 | 105 | 106 | false 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | Qt::Vertical 116 | 117 | 118 | 119 | 20 120 | 40 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /mitk-plugin/README.md: -------------------------------------------------------------------------------- 1 | # MITK Plugin 2 | This is the plugin source for MITK which integrates AIAA C++ client with MITK Workbench 3 | 4 | ## Features 5 | - NVIDIA Segmentation **(3D Tool)** 6 | * Segmentation 7 | * Annotation *(DExtr3D)* 8 | - NVIDIA SmartPoly **(2D Tool)** 9 | * Edit Polygon 10 | * Fix Polygon 11 | 12 | ## Quickstart 13 | Please download [MITK Workbench with NVIDIA AI Assisted Annotation](http://mitk.org/wiki/Downloads) and try NVIDIA features readily available 14 | 15 | ## Building From Source 16 | The project follows the template recommended by MITK to fit the extension mechanism of MITK v2018.04. 17 | Here's how it basically works: 18 | 19 | 1. Clone [MITK](https://phabricator.mitk.org/source/mitk/) 20 | 2. Clone [ai-assisted-annotation-client](https://github.com/NVIDIA/ai-assisted-annotation-client) 21 | 3. Configure the MITK superbuild and set the advanced CMake cache variable `MITK_EXTENSION_DIRS` to ai-assisted-annotation-client/mitk-plugin 22 | 4. Generate and build the MITK superbuild 23 | 24 | ## Supported platforms and other requirements 25 | See the [MITK documentation](http://docs.mitk.org/2018.04/) 26 | -------------------------------------------------------------------------------- /py_client/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | test-data/output 3 | .idea 4 | -------------------------------------------------------------------------------- /py_client/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/py_client/__init__.py -------------------------------------------------------------------------------- /py_client/readme.md: -------------------------------------------------------------------------------- 1 | ### Example 2 | ```python 3 | import client_api 4 | client = client_api.AIAAClient(server_url='http://0.0.0.0:5000') 5 | 6 | # List Models 7 | models = client.model_list(label='spleen') 8 | 9 | # Run Segmentation 10 | client.segmentation( 11 | model='segmentation_ct_spleen', 12 | image_in='input3D.nii.gz', 13 | image_out='seg_mask3D.nii.gz') 14 | 15 | # Run Annotation 16 | client.dextr3d( 17 | model='annotation_ct_spleen', 18 | point_set=[[52,181,126],[137,152,171],[97,113,148],[78,227,115],[72,178,80],[97,175,188]], 19 | image_in='input3D.nii.gz', 20 | image_out='ann_mask3D.nii.gz') 21 | ``` 22 | 23 | #### Running Tests 24 | ```bash 25 | python test_aiaa_server.py --test_config aas_tests.json \ 26 | --server_url http://0.0.0.0:5000 27 | ``` 28 | 29 | `test_aiaa_server.py` gives method to test all the possible APIs supported by NVIDIA AI-Assisted Annotation server. 30 | 31 | `aas_tests.json` specifies the required configurations. 32 | -------------------------------------------------------------------------------- /py_client/requirements.txt: -------------------------------------------------------------------------------- 1 | SimpleITK>=2.0.2 2 | numpy>=1.19.2 3 | -------------------------------------------------------------------------------- /py_client/test-data/AC07112011207153620_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/py_client/test-data/AC07112011207153620_v2.png -------------------------------------------------------------------------------- /py_client/test-data/fixpolygon.input.json: -------------------------------------------------------------------------------- 1 | {"propagate_neighbor":1,"polygonIndex":0,"vertexIndex":14,"poly":[[[53,169],[56,158],[59,147],[65,136],[74,127],[82,132],[85,142],[89,151],[93,161],[92,172],[85,181],[81,192],[84,202],[82,212],[81,227],[65,216],[59,207],[56,197],[54,187],[53,176]]],"prev_poly":[[[53,169],[56,158],[59,147],[65,136],[74,127],[82,132],[85,142],[89,151],[93,161],[92,172],[85,181],[81,192],[84,202],[82,212],[73,212],[65,216],[59,207],[56,197],[54,187],[53,176]]]} 2 | -------------------------------------------------------------------------------- /py_client/test-data/fixpolygon.input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/py_client/test-data/fixpolygon.input.png -------------------------------------------------------------------------------- /py_client/test-data/image.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/py_client/test-data/image.nii.gz -------------------------------------------------------------------------------- /py_client/test-data/mask2polygon.input.json: -------------------------------------------------------------------------------- 1 | {"more_points":10} 2 | -------------------------------------------------------------------------------- /py_client/test-data/mask2polygon.input.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/py_client/test-data/mask2polygon.input.nii.gz -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. 2 | import os 3 | from setuptools import setup, find_packages 4 | 5 | with open('README.md') as f: 6 | readme = f.read() 7 | 8 | with open('LICENSE') as f: 9 | license = f.read() 10 | 11 | with open(os.path.join("py_client", "requirements.txt")) as f: 12 | requirements = f.read().splitlines() 13 | 14 | setup( 15 | name='aiaa_client', 16 | version='1.0.2', 17 | description='NVIDIA Clara AIAA client APIs', 18 | long_description=readme, 19 | long_description_content_type="text/markdown", 20 | author='NVIDIA Clara', 21 | author_email='nvidia.clara@nvidia.com', 22 | url='https://developer.nvidia.com/clara', 23 | license=license, 24 | packages=find_packages(include=['py_client']), 25 | install_requires=requirements 26 | ) 27 | -------------------------------------------------------------------------------- /slicer-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | # client_api.py is copied from another folder, it must not be added to revision control here 2 | NvidiaAIAA/NvidiaAIAAClientAPI/client_api.py 3 | 4 | # Byte-compiled / optimized / DLL files 5 | __pycache__/ 6 | *.py[cod] 7 | *$py.class 8 | 9 | # C extensions 10 | *.so 11 | 12 | # Distribution / packaging 13 | .Python 14 | build/ 15 | develop-eggs/ 16 | dist/ 17 | downloads/ 18 | eggs/ 19 | .eggs/ 20 | lib/ 21 | lib64/ 22 | parts/ 23 | sdist/ 24 | var/ 25 | wheels/ 26 | *.egg-info/ 27 | .installed.cfg 28 | *.egg 29 | MANIFEST 30 | 31 | # PyInstaller 32 | # Usually these files are written by a python script from a template 33 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 34 | *.manifest 35 | *.spec 36 | 37 | # Installer logs 38 | pip-log.txt 39 | pip-delete-this-directory.txt 40 | 41 | # Unit test / coverage reports 42 | htmlcov/ 43 | .tox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | 53 | # Translations 54 | *.mo 55 | *.pot 56 | 57 | # Django stuff: 58 | *.log 59 | local_settings.py 60 | db.sqlite3 61 | 62 | # Flask stuff: 63 | instance/ 64 | .webassets-cache 65 | 66 | # Scrapy stuff: 67 | .scrapy 68 | 69 | # Sphinx documentation 70 | docs/_build/ 71 | 72 | # PyBuilder 73 | target/ 74 | 75 | # Jupyter Notebook 76 | .ipynb_checkpoints 77 | 78 | # pyenv 79 | .python-version 80 | 81 | # celery beat schedule file 82 | celerybeat-schedule 83 | 84 | # SageMath parsed files 85 | *.sage.py 86 | 87 | # Environments 88 | .env 89 | .venv 90 | env/ 91 | venv/ 92 | ENV/ 93 | env.bak/ 94 | venv.bak/ 95 | 96 | # Spyder project settings 97 | .spyderproject 98 | .spyproject 99 | 100 | # Rope project settings 101 | .ropeproject 102 | 103 | # mkdocs documentation 104 | /site 105 | 106 | # mypy 107 | .mypy_cache/ 108 | 109 | .idea/ 110 | -------------------------------------------------------------------------------- /slicer-plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | #----------------------------------------------------------------------------- 4 | # Extension meta-information 5 | set(EXTENSION_HOMEPAGE "https://github.com/NVIDIA/ai-assisted-annotation-client/tree/master/slicer-plugin") 6 | set(EXTENSION_CATEGORY "Segmentation") 7 | set(EXTENSION_CONTRIBUTORS "Sachidanand Alle (NVIDIA), Andras Lasso (PerkLab)") 8 | set(EXTENSION_DESCRIPTION "This extension offers automatic segmentation using NVIDIA AI-Assisted Annotation framework (Powered by the Clara Train SDK).") 9 | set(EXTENSION_ICONURL "https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/master/slicer-plugin/NvidiaAIAssistedAnnotation.png") 10 | set(EXTENSION_SCREENSHOTURLS "https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/master/slicer-plugin/snapshot.jpg https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/master/slicer-plugin/snapshot-annotation-points-liver.jpg https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/master/slicer-plugin/snapshot-annotation-result-liver.jpg https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/master/slicer-plugin/snapshot-segmentation-result-liver.jpg") 11 | set(EXTENSION_DEPENDS "NA") # Specified as a space separated string, a list or 'NA' if any 12 | 13 | #----------------------------------------------------------------------------- 14 | # Extension dependencies 15 | find_package(Slicer REQUIRED) 16 | include(${Slicer_USE_FILE}) 17 | 18 | #----------------------------------------------------------------------------- 19 | # Extension modules 20 | add_subdirectory(NvidiaAIAA) 21 | ## NEXT_MODULE 22 | 23 | #----------------------------------------------------------------------------- 24 | include(${Slicer_EXTENSION_GENERATE_CONFIG}) 25 | include(${Slicer_EXTENSION_CPACK}) 26 | -------------------------------------------------------------------------------- /slicer-plugin/NvidiaAIAA/.gitignore: -------------------------------------------------------------------------------- 1 | AIAAClient.py -------------------------------------------------------------------------------- /slicer-plugin/NvidiaAIAA/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | #----------------------------------------------------------------------------- 3 | set(MODULE_NAME SegmentEditorNvidiaAIAA) 4 | 5 | # We create a python module from client_api.py file 6 | CONFIGURE_FILE(../../py_client/client_api.py 7 | ${CMAKE_CURRENT_SOURCE_DIR}/NvidiaAIAAClientAPI/client_api.py 8 | COPYONLY 9 | ) 10 | 11 | #----------------------------------------------------------------------------- 12 | set(MODULE_PYTHON_SCRIPTS 13 | ${MODULE_NAME}.py 14 | ${MODULE_NAME}Lib/__init__.py 15 | ${MODULE_NAME}Lib/SegmentEditorEffect.py 16 | NvidiaAIAAClientAPI/__init__.py 17 | NvidiaAIAAClientAPI/client_api.py 18 | ) 19 | 20 | set(MODULE_PYTHON_RESOURCES 21 | ${MODULE_NAME}Lib/edit-icon.png 22 | ${MODULE_NAME}Lib/refresh-icon.png 23 | ${MODULE_NAME}Lib/filter-icon.png 24 | ${MODULE_NAME}Lib/nvidia-icon.png 25 | ${MODULE_NAME}Lib/SegmentEditorEffect.png 26 | ${MODULE_NAME}Lib/SegmentEditorNvidiaAIAA.ui 27 | ) 28 | 29 | #----------------------------------------------------------------------------- 30 | slicerMacroBuildScriptedModule( 31 | NAME ${MODULE_NAME} 32 | SCRIPTS ${MODULE_PYTHON_SCRIPTS} 33 | RESOURCES ${MODULE_PYTHON_RESOURCES} 34 | WITH_GENERIC_TESTS 35 | ) 36 | 37 | #----------------------------------------------------------------------------- 38 | if(BUILD_TESTING) 39 | # Register the unittest subclass in the main script as a ctest. 40 | # Note that the test will also be available at runtime. 41 | #slicer_add_python_unittest(SCRIPT ${MODULE_NAME}.py) 42 | 43 | # Additional build-time testing 44 | #add_subdirectory(Testing) 45 | endif() 46 | -------------------------------------------------------------------------------- /slicer-plugin/NvidiaAIAA/NvidiaAIAAClientAPI/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/NvidiaAIAA/NvidiaAIAAClientAPI/__init__.py -------------------------------------------------------------------------------- /slicer-plugin/NvidiaAIAA/SegmentEditorNvidiaAIAALib/SegmentEditorEffect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/NvidiaAIAA/SegmentEditorNvidiaAIAALib/SegmentEditorEffect.png -------------------------------------------------------------------------------- /slicer-plugin/NvidiaAIAA/SegmentEditorNvidiaAIAALib/__init__.py: -------------------------------------------------------------------------------- 1 | from SegmentEditorEffects.AbstractScriptedSegmentEditorEffect import * 2 | from SegmentEditorEffects.AbstractScriptedSegmentEditorLabelEffect import * 3 | 4 | from SegmentEditorEffect import * 5 | -------------------------------------------------------------------------------- /slicer-plugin/NvidiaAIAA/SegmentEditorNvidiaAIAALib/edit-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/NvidiaAIAA/SegmentEditorNvidiaAIAALib/edit-icon.png -------------------------------------------------------------------------------- /slicer-plugin/NvidiaAIAA/SegmentEditorNvidiaAIAALib/filter-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/NvidiaAIAA/SegmentEditorNvidiaAIAALib/filter-icon.png -------------------------------------------------------------------------------- /slicer-plugin/NvidiaAIAA/SegmentEditorNvidiaAIAALib/nvidia-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/NvidiaAIAA/SegmentEditorNvidiaAIAALib/nvidia-icon.png -------------------------------------------------------------------------------- /slicer-plugin/NvidiaAIAA/SegmentEditorNvidiaAIAALib/refresh-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/NvidiaAIAA/SegmentEditorNvidiaAIAALib/refresh-icon.png -------------------------------------------------------------------------------- /slicer-plugin/NvidiaAIAA/Testing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Python) 2 | -------------------------------------------------------------------------------- /slicer-plugin/NvidiaAIAA/Testing/Python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | #slicer_add_python_unittest(SCRIPT ${MODULE_NAME}ModuleTest.py) 3 | -------------------------------------------------------------------------------- /slicer-plugin/NvidiaAIAssistedAnnotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/NvidiaAIAssistedAnnotation.png -------------------------------------------------------------------------------- /slicer-plugin/snapshot-annotation-points-brain.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/snapshot-annotation-points-brain.jpg -------------------------------------------------------------------------------- /slicer-plugin/snapshot-annotation-points-liver.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/snapshot-annotation-points-liver.jpg -------------------------------------------------------------------------------- /slicer-plugin/snapshot-annotation-result-brain.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/snapshot-annotation-result-brain.jpg -------------------------------------------------------------------------------- /slicer-plugin/snapshot-annotation-result-liver.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/snapshot-annotation-result-liver.jpg -------------------------------------------------------------------------------- /slicer-plugin/snapshot-deepgrow-result-liver.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/snapshot-deepgrow-result-liver.jpg -------------------------------------------------------------------------------- /slicer-plugin/snapshot-segmentation-result-liver.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/snapshot-segmentation-result-liver.jpg -------------------------------------------------------------------------------- /slicer-plugin/snapshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NVIDIA/ai-assisted-annotation-client/2706251c9c8444e2a6e7f6fe9943a1a45e2c9da2/slicer-plugin/snapshot.jpg --------------------------------------------------------------------------------