1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
|
<!--
This tutorial shows a VTK scene containing a 3D image and a 3D model.
To use this application, you should open a 3D image mask of an organ. An used the mesher actions to creates a
reconstruction. Then, you can update the organ color, transparence, ... using the editors in the right.
-->
<plugin id="tuto08_mesher_with_generic_scene">
<requirement id="sight::module::ui" />
<requirement id="sight::module::viz::scene3d" />
<requirement id="sight::module::ui::qt" />
<requirement id="sight::module::service" />
<extension implements="sight::app::extension::config">
<id>tuto08_mesher_with_generic_scene_app_cfg</id>
<config>
<!-- ******************************* Objects declaration ****************************** -->
<object uid="modelSeries" type="sight::data::model_series" deferred="true" />
<object uid="imageSeries" type="sight::data::image_series" />
<object uid="tf" type="sight::data::transfer_function" />
<object uid="reconstruction" type="sight::data::reconstruction" deferred="true" />
<object uid="snapshot" type="sight::data::image" />
<object uid="threshold_value" type="sight::data::integer" value="255" />
<object uid="reduction_value" type="sight::data::real" value="50" />
<!-- ******************************* UI declaration *********************************** -->
<service uid="main_frame" type="sight::module::ui::frame">
<gui>
<frame>
<name>tuto08_mesher_with_generic_scene</name>
<icon>tuto08_mesher_with_generic_scene/tuto.ico</icon>
</frame>
<menubar />
</gui>
<registry>
<menubar sid="menu_bar_view" start="true" />
<view sid="main_view" start="true" />
</registry>
</service>
<service uid="progress_bar_view" type="sight::module::ui::job_bar" />
<service uid="menu_bar_view" type="sight::module::ui::menubar">
<gui>
<layout>
<menu name="File" />
<menu name="Mesher" />
</layout>
</gui>
<registry>
<menu sid="menu_file_view" start="true" />
<menu sid="menu_mesher_view" start="true" />
</registry>
</service>
<service uid="menu_file_view" type="sight::module::ui::menu">
<gui>
<layout>
<menuItem name="Open image" shortcut="Ctrl+O" />
<menuItem name="Save meshes" shortcut="Ctrl+S" />
<separator />
<menuItem name="Quit" specialAction="QUIT" shortcut="Ctrl+Q" />
</layout>
</gui>
<registry>
<menuItem sid="open_image_act" start="true" />
<menuItem sid="save_model_series_act" start="true" />
<menuItem sid="quit_act" start="true" />
</registry>
</service>
<service uid="menu_mesher_view" type="sight::module::ui::menu">
<gui>
<layout>
<menuItem name="Create Mesh" />
</layout>
</gui>
<registry>
<menuItem sid="create_mesh_act" start="true" />
</registry>
</service>
<service uid="main_view" type="sight::module::ui::view">
<gui>
<layout type="sight::ui::layout::line">
<orientation value="vertical" />
<view proportion="1" />
<view proportion="0" minHeight="30" resizable="false" backgroundColor="#3E4453" />
</layout>
</gui>
<registry>
<view sid="container_view" start="true" />
<view sid="scene_editors_view" start="true" />
</registry>
</service>
<service uid="container_view" type="sight::module::ui::view">
<gui>
<layout type="sight::ui::layout::line">
<orientation value="horizontal" />
<view proportion="2" />
<view proportion="1" backgroundColor="#36393E" />
</layout>
</gui>
<registry>
<view sid="generic_scene_srv" start="true" />
<view sid="right_view" start="true" />
</registry>
</service>
<service uid="right_view" type="sight::module::ui::view">
<gui>
<layout type="sight::ui::layout::line">
<orientation value="vertical" />
<view proportion="0" />
<spacer />
</layout>
</gui>
<registry>
<view sid="organs_view" start="true" />
</registry>
</service>
<service uid="organs_view" type="sight::module::ui::view">
<gui>
<layout type="sight::ui::layout::toolbox">
<icon_color value="#FFFFFF" />
<view caption="Organs" expanded="true" />
<view caption="Material" expanded="true" />
<view caption="Representation" />
<view caption="Threshold" expanded="true" />
</layout>
</gui>
<registry>
<view sid="list_organ_editor_srv" start="false" />
<view sid="organ_material_editor_srv" start="false" />
<view sid="representation_editor_srv" start="false" />
<view sid="threshold_slider_srv" start="false" />
</registry>
</service>
<service uid="scene_editors_view" type="sight::module::ui::view">
<gui>
<layout type="sight::ui::layout::line">
<orientation value="horizontal" />
<view proportion="0" minWidth="50" />
<view proportion="1" />
<view proportion="0" minWidth="30" />
</layout>
</gui>
<registry>
<view sid="show_negato_srv" start="true" />
<view sid="slider_index_editor_srv" start="false" />
<view sid="snapshot_srv" start="true" />
</registry>
</service>
<!-- *************************** Begin generic scene *************************** -->
<service uid="generic_scene_srv" type="sight::viz::scene3d::render">
<scene>
<background topColor="#36393E" bottomColor="#36393E" />
<layer id="default" order="1">
<adaptor uid="trackball_interactor_adp" />
<adaptor uid="model_series_adp" />
<adaptor uid="negato_adp" />
<adaptor uid="snapshot_adp" />
</layer>
</scene>
</service>
<service uid="trackball_interactor_adp" type="sight::module::viz::scene3d::adaptor::trackball_camera">
<config priority="0" />
</service>
<service uid="model_series_adp" type="sight::module::viz::scene3d::adaptor::model_series" auto_connect="true">
<in key="model" uid="${modelSeries}" />
</service>
<service uid="negato_adp" type="sight::module::viz::scene3d::adaptor::negato3d" auto_connect="true">
<in key="image" uid="imageSeries" />
<inout key="tf" uid="tf" />
<config sliceIndex="axial" interactive="true" />
</service>
<service uid="snapshot_adp" type="sight::module::viz::scene3d::adaptor::fragments_info">
<inout key="image" uid="snapshot" />
</service>
<!-- ******************************* Actions ****************************************** -->
<service uid="open_image_act" type="sight::module::ui::action" />
<service uid="save_model_series_act" type="sight::module::ui::action" />
<service uid="quit_act" type="sight::module::ui::quit" />
<service uid="create_mesh_act" type="sight::module::ui::action" />
<!-- ******************************* Services ***************************************** -->
<service uid="snapshot_srv" type="sight::module::ui::qt::com::signal_button">
<config>
<checkable>false</checkable>
<icon>sight::module::ui::icons/frame.svg</icon>
</config>
</service>
<service uid="threshold_slider_srv" type="sight::module::ui::qt::settings">
<inout group="keys">
<key uid="${threshold_value}" />
<key uid="${reduction_value}" />
</inout>
<ui>
<item name="Threshold" widget="slider" min="0" max="255" emit_on_release="true" />
<item name="Reduction" widget="slider" min="0." max="99." emit_on_release="true" />
</ui>
</service>
<service uid="show_negato_srv" type="sight::module::ui::qt::com::signal_button">
<config>
<checkable>true</checkable>
<icon>sight::module::ui::icons/cross.svg</icon>
<icon2>sight::module::ui::icons/layers.svg</icon2>
<iconWidth>40</iconWidth>
<iconHeight>16</iconHeight>
<checked>true</checked>
</config>
</service>
<service uid="list_organ_editor_srv" type="sight::module::ui::qt::model::model_series_list" auto_connect="true">
<inout key="modelSeries" uid="modelSeries" />
<columns>
<organ_name>@organ_name</organ_name>
</columns>
</service>
<service uid="slider_index_editor_srv" type="sight::module::ui::qt::image::slice_index_position_editor" auto_connect="true">
<inout key="image" uid="imageSeries" />
<config orientation="axial" label="index" display_axis_selector="false" display_step_buttons="false" />
</service>
<service uid="mesher_srv" type="sight::module::filter::mesh::vtk_mesher">
<in key="imageSeries" uid="imageSeries" />
<out key="modelSeries" uid="modelSeries" />
<properties percent_reduction="${reduction_value}" threshold="${threshold_value}" />
</service>
<service uid="model_series_writer_srv" type="sight::module::ui::io::selector">
<inout key="data" uid="modelSeries" />
<type mode="writer" />
</service>
<service uid="image_reader_srv" type="sight::module::ui::io::selector">
<inout key="data" uid="imageSeries" />
<type mode="reader" />
</service>
<service uid="updater_reconst_srv" type="sight::module::data::select_object">
<out key="object" uid="reconstruction" />
</service>
<service uid="organ_material_editor_srv" type="sight::module::ui::qt::reconstruction::organ_material_editor" auto_connect="true">
<inout key="reconstruction" uid="reconstruction" />
</service>
<service uid="representation_editor_srv" type="sight::module::ui::qt::reconstruction::representation_editor" auto_connect="true">
<inout key="reconstruction" uid="reconstruction" />
</service>
<!-- Write the snapshot image -->
<service uid="image_writer_srv" type="sight::module::io::bitmap::writer">
<in key="data" uid="snapshot" />
<dialog policy="always" />
<backends enable="all" mode="best" />
</service>
<!-- ******************************* Connections ***************************************** -->
<connect>
<signal>model_series_writer_srv/job_created</signal>
<slot>progress_bar_view/show_job</slot>
</connect>
<connect>
<signal>list_organ_editor_srv/reconstruction_selected</signal>
<slot>updater_reconst_srv/add</slot>
</connect>
<connect>
<signal>snapshot_srv/clicked</signal>
<slot>image_writer_srv/update</slot>
</connect>
<!--
Connection for 3D image slice:
Connect the button (show_negato_srv) signal "toggled" to the image adaptor (negato_adp)
slot "showSlice", this signals/slots contains a boolean.
The image slices will be show or hide when the button is checked/unchecked.
The "waitForKey" attribut means that the signal and slot are connected only if the key
"image" is present in the scene map. It is recommanded to used because the adaptors
exists only if the object is present.
-->
<connect>
<signal>show_negato_srv/toggled</signal>
<slot>negato_adp/update_visibility</slot>
</connect>
<!-- ******************************* Start services ***************************************** -->
<connect>
<signal>open_image_act/clicked</signal>
<slot>image_reader_srv/update</slot>
</connect>
<connect>
<signal>save_model_series_act/clicked</signal>
<slot>model_series_writer_srv/update</slot>
</connect>
<connect>
<signal>create_mesh_act/clicked</signal>
<slot>mesher_srv/update</slot>
</connect>
<start uid="main_frame" />
<start uid="progress_bar_view" />
<start uid="image_writer_srv" />
<start uid="updater_reconst_srv" />
<start uid="representation_editor_srv" />
<start uid="organ_material_editor_srv" />
<start uid="slider_index_editor_srv" />
<start uid="threshold_slider_srv" />
<start uid="list_organ_editor_srv" />
<start uid="mesher_srv" />
<start uid="trackball_interactor_adp" />
<start uid="model_series_adp" />
<start uid="negato_adp" />
<start uid="snapshot_adp" />
<start uid="image_reader_srv" />
<start uid="model_series_writer_srv" />
</config>
</extension>
</plugin>
|