Skip to content

Commit

Permalink
Merge branch 'main' into vchang/cli-add-support
Browse files Browse the repository at this point in the history
  • Loading branch information
mocsharp authored Oct 21, 2024
2 parents 2c46275 + d13c0e9 commit 7265edd
Show file tree
Hide file tree
Showing 20 changed files with 443 additions and 85 deletions.
6 changes: 4 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
}
},
"runArgs": [
"<env>"
"--net=host",
//"<env>"
],
"containerEnv": {
// X11 support
Expand Down Expand Up @@ -81,6 +82,7 @@
"ms-python.vscode-pylance",
"ms-vscode.cpptools-extension-pack",
"redhat.vscode-yaml",
"rioj7.command-variable",
"shardulm94.trailing-spaces",
"shd101wyy.markdown-preview-enhanced",
"stkb.rewrap"
Expand All @@ -100,4 +102,4 @@
"HOLOHUB_DATA_DIR": "${containerWorkspaceFolder}/data"
},
"remoteUser": "holoscan"
}
}
32 changes: 17 additions & 15 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
}
},
//#endregion asr_to_llm

//#region sam2
{
"name": "(debugpy) sam2/python",
Expand Down Expand Up @@ -178,7 +177,6 @@
}
},
//#endregion sam2

//#region colonoscopy_segmentation
{
"name": "(debugpy) colonoscopy_segmentation/python",
Expand Down Expand Up @@ -858,10 +856,10 @@
"name": "(gdb) Holoviz examples",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "Build ${input:holoviz_example_name}",
"preLaunchTask": "Build Holoviz examples",
"program": "${workspaceFolder}/build/${input:holoviz_example_name}/applications/holoviz/${input:holoviz_example_name}/${input:holoviz_example_name}",
"args": [ ],
"environment": [ ],
"args": [],
"environment": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build/${input:holoviz_example_name}/applications/holoviz/${input:holoviz_example_name}",
"externalConsole": false,
Expand Down Expand Up @@ -1071,15 +1069,19 @@
"inputs": [
{
"id": "holoviz_example_name",
"description": "Select Holoviz example program",
"type": "pickString",
"options": [
"holoviz_hdr",
"holoviz_srgb",
"holoviz_vsync",
"holoviz_yuv",
],
"default": "holoviz_srgb"
}
"type": "command",
"command": "extension.commandvariable.pickStringRemember",
"args": {
"description": "Select Holoviz example program",
"options": [],
"fileName": "${workspaceFolder}/applications/holoviz/template/generate_projects.sh",
"fileFormat": "pattern",
"pattern": {
"regexp": "^generate [\"](.*?)[\"].*$",
"flags": "gm",
},
"key": "holoviz_example_name"
}
},
],
}
64 changes: 11 additions & 53 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
Expand Down Expand Up @@ -307,62 +308,11 @@
},
{
"type": "shell",
"label": "Build holoviz_hdr",
"label": "Build Holoviz examples",
"command": "./run",
"args": [
"build",
"holoviz_hdr",
"--type",
"debug"
],
"options": {
"cwd": "${env:WORKSPACE_DIR}"
},
"group": "build",
"problemMatcher": [],
"detail": "CMake template build task"
},
{
"type": "shell",
"label": "Build holoviz_srgb",
"command": "./run",
"args": [
"build",
"holoviz_srgb",
"--type",
"debug"
],
"options": {
"cwd": "${env:WORKSPACE_DIR}"
},
"group": "build",
"problemMatcher": [],
"detail": "CMake template build task"
},
{
"type": "shell",
"label": "Build holoviz_vsync",
"command": "./run",
"args": [
"build",
"holoviz_vsync",
"--type",
"debug"
],
"options": {
"cwd": "${env:WORKSPACE_DIR}"
},
"group": "build",
"problemMatcher": [],
"detail": "CMake template build task"
},
{
"type": "shell",
"label": "Build holoviz_yuv",
"command": "./run",
"args": [
"build",
"holoviz_yuv",
"${input:remember_holoviz_example_name}",
"--type",
"debug"
],
Expand Down Expand Up @@ -481,5 +431,13 @@
"description": "Select Application",
"type": "promptString",
},
{
"id": "remember_holoviz_example_name",
"type": "command",
"command": "extension.commandvariable.remember",
"args": {
"key": "holoviz_example_name"
}
}
]
}
1 change: 1 addition & 0 deletions applications/holoviz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@

add_holohub_application(holoviz_hdr)
add_holohub_application(holoviz_srgb)
add_holohub_application(holoviz_ui)
add_holohub_application(holoviz_vsync)
add_holohub_application(holoviz_yuv)
1 change: 1 addition & 0 deletions applications/holoviz/holoviz_hdr/holoviz_hdr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class App : public holoscan::Application {
add_flow(source, holoviz, {{"output", "receivers"}});
}

private:
const int count_;
};

Expand Down
1 change: 1 addition & 0 deletions applications/holoviz/holoviz_srgb/holoviz_srgb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class App : public holoscan::Application {
add_flow(source, holoviz, {{"output", "receivers"}});
}

private:
const int count_;
};

Expand Down
42 changes: 42 additions & 0 deletions applications/holoviz/holoviz_ui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.20)

project(holoviz_ui)

find_package(holoscan 2.5 REQUIRED CONFIG
PATHS "/opt/nvidia/holoscan" "/workspace/holoscan-sdk/install")

add_executable(holoviz_ui
holoviz_ui.cpp
)

target_link_libraries(holoviz_ui
PRIVATE
holoscan::core
holoscan::ops::holoviz
holoscan::viz::imgui
)

if(BUILD_TESTING)
# Add test
add_test(NAME holoviz_ui_test
COMMAND holoviz_ui
--count=10
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_tests_properties(holoviz_ui_test PROPERTIES
PASS_REGULAR_EXPRESSION "Application has finished running.")
endif()
12 changes: 12 additions & 0 deletions applications/holoviz/holoviz_ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Holoviz UI

![](holoviz_ui.png)
This application uses the layer callback provided by the Holoviz operator and leverages the Holoviz module API to add an UI layer with `Dear ImGui` elements and a geometry layer dynamically changing based on user input.

## Run Instructions

To build and start the application:

```bash
./dev_container build_and_run holoviz_ui
```
Loading

0 comments on commit 7265edd

Please sign in to comment.