Skip to content

Commit 7265edd

Browse files
authored
Merge branch 'main' into vchang/cli-add-support
2 parents 2c46275 + d13c0e9 commit 7265edd

File tree

20 files changed

+443
-85
lines changed

20 files changed

+443
-85
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
}
3333
},
3434
"runArgs": [
35-
"<env>"
35+
"--net=host",
36+
//"<env>"
3637
],
3738
"containerEnv": {
3839
// X11 support
@@ -81,6 +82,7 @@
8182
"ms-python.vscode-pylance",
8283
"ms-vscode.cpptools-extension-pack",
8384
"redhat.vscode-yaml",
85+
"rioj7.command-variable",
8486
"shardulm94.trailing-spaces",
8587
"shd101wyy.markdown-preview-enhanced",
8688
"stkb.rewrap"
@@ -100,4 +102,4 @@
100102
"HOLOHUB_DATA_DIR": "${containerWorkspaceFolder}/data"
101103
},
102104
"remoteUser": "holoscan"
103-
}
105+
}

.vscode/launch.json

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@
149149
}
150150
},
151151
//#endregion asr_to_llm
152-
153152
//#region sam2
154153
{
155154
"name": "(debugpy) sam2/python",
@@ -178,7 +177,6 @@
178177
}
179178
},
180179
//#endregion sam2
181-
182180
//#region colonoscopy_segmentation
183181
{
184182
"name": "(debugpy) colonoscopy_segmentation/python",
@@ -858,10 +856,10 @@
858856
"name": "(gdb) Holoviz examples",
859857
"type": "cppdbg",
860858
"request": "launch",
861-
"preLaunchTask": "Build ${input:holoviz_example_name}",
859+
"preLaunchTask": "Build Holoviz examples",
862860
"program": "${workspaceFolder}/build/${input:holoviz_example_name}/applications/holoviz/${input:holoviz_example_name}/${input:holoviz_example_name}",
863-
"args": [ ],
864-
"environment": [ ],
861+
"args": [],
862+
"environment": [],
865863
"stopAtEntry": false,
866864
"cwd": "${workspaceFolder}/build/${input:holoviz_example_name}/applications/holoviz/${input:holoviz_example_name}",
867865
"externalConsole": false,
@@ -1071,15 +1069,19 @@
10711069
"inputs": [
10721070
{
10731071
"id": "holoviz_example_name",
1074-
"description": "Select Holoviz example program",
1075-
"type": "pickString",
1076-
"options": [
1077-
"holoviz_hdr",
1078-
"holoviz_srgb",
1079-
"holoviz_vsync",
1080-
"holoviz_yuv",
1081-
],
1082-
"default": "holoviz_srgb"
1083-
}
1072+
"type": "command",
1073+
"command": "extension.commandvariable.pickStringRemember",
1074+
"args": {
1075+
"description": "Select Holoviz example program",
1076+
"options": [],
1077+
"fileName": "${workspaceFolder}/applications/holoviz/template/generate_projects.sh",
1078+
"fileFormat": "pattern",
1079+
"pattern": {
1080+
"regexp": "^generate [\"](.*?)[\"].*$",
1081+
"flags": "gm",
1082+
},
1083+
"key": "holoviz_example_name"
1084+
}
1085+
},
10841086
],
10851087
}

.vscode/tasks.json

Lines changed: 11 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"version": "2.0.0",
23
"tasks": [
34
{
45
"type": "shell",
@@ -307,62 +308,11 @@
307308
},
308309
{
309310
"type": "shell",
310-
"label": "Build holoviz_hdr",
311+
"label": "Build Holoviz examples",
311312
"command": "./run",
312313
"args": [
313314
"build",
314-
"holoviz_hdr",
315-
"--type",
316-
"debug"
317-
],
318-
"options": {
319-
"cwd": "${env:WORKSPACE_DIR}"
320-
},
321-
"group": "build",
322-
"problemMatcher": [],
323-
"detail": "CMake template build task"
324-
},
325-
{
326-
"type": "shell",
327-
"label": "Build holoviz_srgb",
328-
"command": "./run",
329-
"args": [
330-
"build",
331-
"holoviz_srgb",
332-
"--type",
333-
"debug"
334-
],
335-
"options": {
336-
"cwd": "${env:WORKSPACE_DIR}"
337-
},
338-
"group": "build",
339-
"problemMatcher": [],
340-
"detail": "CMake template build task"
341-
},
342-
{
343-
"type": "shell",
344-
"label": "Build holoviz_vsync",
345-
"command": "./run",
346-
"args": [
347-
"build",
348-
"holoviz_vsync",
349-
"--type",
350-
"debug"
351-
],
352-
"options": {
353-
"cwd": "${env:WORKSPACE_DIR}"
354-
},
355-
"group": "build",
356-
"problemMatcher": [],
357-
"detail": "CMake template build task"
358-
},
359-
{
360-
"type": "shell",
361-
"label": "Build holoviz_yuv",
362-
"command": "./run",
363-
"args": [
364-
"build",
365-
"holoviz_yuv",
315+
"${input:remember_holoviz_example_name}",
366316
"--type",
367317
"debug"
368318
],
@@ -481,5 +431,13 @@
481431
"description": "Select Application",
482432
"type": "promptString",
483433
},
434+
{
435+
"id": "remember_holoviz_example_name",
436+
"type": "command",
437+
"command": "extension.commandvariable.remember",
438+
"args": {
439+
"key": "holoviz_example_name"
440+
}
441+
}
484442
]
485443
}

applications/holoviz/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515

1616
add_holohub_application(holoviz_hdr)
1717
add_holohub_application(holoviz_srgb)
18+
add_holohub_application(holoviz_ui)
1819
add_holohub_application(holoviz_vsync)
1920
add_holohub_application(holoviz_yuv)

applications/holoviz/holoviz_hdr/holoviz_hdr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ class App : public holoscan::Application {
147147
add_flow(source, holoviz, {{"output", "receivers"}});
148148
}
149149

150+
private:
150151
const int count_;
151152
};
152153

applications/holoviz/holoviz_srgb/holoviz_srgb.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ class App : public holoscan::Application {
125125
add_flow(source, holoviz, {{"output", "receivers"}});
126126
}
127127

128+
private:
128129
const int count_;
129130
};
130131

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
cmake_minimum_required(VERSION 3.20)
17+
18+
project(holoviz_ui)
19+
20+
find_package(holoscan 2.5 REQUIRED CONFIG
21+
PATHS "/opt/nvidia/holoscan" "/workspace/holoscan-sdk/install")
22+
23+
add_executable(holoviz_ui
24+
holoviz_ui.cpp
25+
)
26+
27+
target_link_libraries(holoviz_ui
28+
PRIVATE
29+
holoscan::core
30+
holoscan::ops::holoviz
31+
holoscan::viz::imgui
32+
)
33+
34+
if(BUILD_TESTING)
35+
# Add test
36+
add_test(NAME holoviz_ui_test
37+
COMMAND holoviz_ui
38+
--count=10
39+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
40+
set_tests_properties(holoviz_ui_test PROPERTIES
41+
PASS_REGULAR_EXPRESSION "Application has finished running.")
42+
endif()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Holoviz UI
2+
3+
![](holoviz_ui.png)
4+
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.
5+
6+
## Run Instructions
7+
8+
To build and start the application:
9+
10+
```bash
11+
./dev_container build_and_run holoviz_ui
12+
```

0 commit comments

Comments
 (0)