Skip to content

Commit e00b632

Browse files
committed
Merge branch '54-use-msvVTKButtons-in-ButtonClusters' into ButtonClustering
# By Julien Finet (41) and others # Via Richard Christie (20) and others * 54-use-msvVTKButtons-in-ButtonClusters: (105 commits) Fix crash on uninitialized variables Show VTKButtons on interaction Don't refresh the view unnecessarilly when toggling data visibility Support sub-subdirectory for loading data Don't show the volume corners Copy icon.png to build and install directory Fix compilation warnings by using vtkIdType instead of size_t Use CTK utility functions to convert vtkImage to QImage Fix unistd compilation error with VisualStudio Add multiple improvements. WIP: Adding cluster representation to display clustering using a graph WIP: Add cluster visualization and cleaned GUI a bit. WIP: Adding msvVTKButtons support WIP: Adding msvVTKButtons support in button clustering The demo now takes any data directory and loads all containing files. WIP: Integrating msvVTKButtons to the clustering interface. Fix VTK based documentation Fix msvQTimePlayerWidget documentation. Add documentation for msvVTKButtons Expand vtk macros such as vtkSetMacro... ...
2 parents bcd4c3b + 850491a commit e00b632

200 files changed

Lines changed: 47015 additions & 2120 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Applications/ButtonClusters/CMakeLists.txt

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
###########################################################################
2+
#
3+
# Library: MSVTK
4+
#
5+
# Copyright (c) Kitware Inc.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0.txt
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
###########################################################################
20+
121
set(KIT ButtonClusters)
222
project(msv${KIT})
323

@@ -64,6 +84,13 @@ target_link_libraries(msv${KIT}
6484
msvQtWidgets
6585
)
6686

87+
add_custom_command(TARGET msv${KIT} PRE_BUILD
88+
COMMAND ${CMAKE_COMMAND} -E copy
89+
"${CMAKE_CURRENT_SOURCE_DIR}/Resources/Logo/icon.png"
90+
"$<TARGET_FILE_DIR:msv${KIT}>/Resources/Logo/icon.png")
91+
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/Resources/Logo/icon.png"
92+
DESTINATION "${MSVTK_INSTALL_BIN_DIR}/Resources/Logo/")
93+
6794
install(TARGETS msv${KIT}
6895
RUNTIME DESTINATION ${MSVTK_INSTALL_BIN_DIR} COMPONENT RuntimeLibraries
6996
LIBRARY DESTINATION ${MSVTK_INSTALL_LIB_DIR} COMPONENT RuntimeLibraries
@@ -108,7 +135,7 @@ endif()
108135
# --------------------------------------------------------------------------
109136
# Install
110137
# --------------------------------------------------------------------------
111-
if(NOT APPLE)
138+
if(NOT PACKAGE_WITH_BUNDLE)
112139
set(${KIT}_INSTALL_DESTINATION_ARGS RUNTIME DESTINATION ${MSVTK_INSTALL_BIN_DIR})
113140
else()
114141
set(${KIT}_INSTALL_DESTINATION_ARGS RUNTIME DESTINATION ".")

Applications/ButtonClusters/Resources/UI/msvQButtonClustersMainWindow.ui

Lines changed: 98 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -73,103 +73,115 @@
7373
<number>0</number>
7474
</property>
7575
<item>
76-
<widget class="QCheckBox" name="ShowVolume">
76+
<widget class="QLabel" name="DataLabel">
7777
<property name="text">
78-
<string>Show Volume</string>
78+
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
79+
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
80+
p, li { white-space: pre-wrap; }
81+
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
82+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Data&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
7983
</property>
80-
<property name="checked">
81-
<bool>true</bool>
84+
<property name="textFormat">
85+
<enum>Qt::AutoText</enum>
86+
</property>
87+
<property name="alignment">
88+
<set>Qt::AlignCenter</set>
89+
</property>
90+
</widget>
91+
</item>
92+
<item>
93+
<widget class="ctkCheckableComboBox" name="DataLoader" native="true"/>
94+
</item>
95+
<item>
96+
<widget class="Line" name="line">
97+
<property name="orientation">
98+
<enum>Qt::Horizontal</enum>
99+
</property>
100+
</widget>
101+
</item>
102+
<item>
103+
<widget class="QLabel" name="AlgorithmsLabel">
104+
<property name="text">
105+
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
106+
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
107+
p, li { white-space: pre-wrap; }
108+
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
109+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Algorithms&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
110+
</property>
111+
<property name="alignment">
112+
<set>Qt::AlignCenter</set>
113+
</property>
114+
</widget>
115+
</item>
116+
<item>
117+
<widget class="QCheckBox" name="EnableClustering">
118+
<property name="text">
119+
<string>Enable Clustering</string>
82120
</property>
83121
</widget>
84122
</item>
85123
<item>
86-
<widget class="QCheckBox" name="ShowDiscs">
124+
<widget class="QCheckBox" name="ClusterWithinGroups">
87125
<property name="text">
88-
<string>Show Spinal Discs</string>
126+
<string>Cluster Within Groups</string>
127+
</property>
128+
</widget>
129+
</item>
130+
<item>
131+
<widget class="QCheckBox" name="UsePlainVTKButtons">
132+
<property name="text">
133+
<string>Use Plain VTKButtons</string>
89134
</property>
90135
<property name="checked">
91-
<bool>true</bool>
136+
<bool>false</bool>
92137
</property>
93138
</widget>
94139
</item>
95140
<item>
96-
<widget class="Line" name="line">
97-
<property name="orientation">
98-
<enum>Qt::Horizontal</enum>
141+
<widget class="QCheckBox" name="ShowClustersRep">
142+
<property name="text">
143+
<string>Show Clusters Graph</string>
99144
</property>
100145
</widget>
101146
</item>
102147
<item>
103-
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0">
104-
<property name="sizeConstraint">
105-
<enum>QLayout::SetNoConstraint</enum>
106-
</property>
107-
<property name="leftMargin">
108-
<number>1</number>
109-
</property>
110-
<property name="rightMargin">
111-
<number>1</number>
112-
</property>
113-
<property name="bottomMargin">
114-
<number>1</number>
115-
</property>
116-
<item row="1" column="0">
117-
<widget class="QDoubleSpinBox" name="PixelRadius">
118-
<property name="maximumSize">
119-
<size>
120-
<width>143</width>
121-
<height>19</height>
122-
</size>
123-
</property>
124-
<property name="decimals">
125-
<number>0</number>
126-
</property>
127-
<property name="minimum">
128-
<double>0.000000000000000</double>
129-
</property>
130-
<property name="maximum">
131-
<double>1000.000000000000000</double>
132-
</property>
133-
<property name="singleStep">
134-
<double>10.000000000000000</double>
135-
</property>
136-
<property name="value">
137-
<double>1.000000000000000</double>
138-
</property>
139-
</widget>
140-
</item>
141-
<item row="1" column="1">
142-
<widget class="QLabel" name="PixelRadiusLabel">
143-
<property name="text">
144-
<string>Pixel Radius</string>
145-
</property>
146-
</widget>
147-
</item>
148-
<item row="2" column="0">
149-
<widget class="QComboBox" name="ShowLevel">
150-
<property name="currentIndex">
151-
<number>-1</number>
152-
</property>
153-
<property name="frame">
154-
<bool>true</bool>
155-
</property>
156-
</widget>
157-
</item>
158-
<item row="2" column="1">
159-
<widget class="QLabel" name="ShowLevelLabel">
160-
<property name="text">
161-
<string>Show Level</string>
162-
</property>
163-
</widget>
164-
</item>
165-
<item row="0" column="0">
166-
<widget class="QCheckBox" name="EnableClustering">
167-
<property name="text">
168-
<string>Enable Clustering</string>
169-
</property>
170-
</widget>
171-
</item>
172-
</layout>
148+
<widget class="QLabel" name="PixelRadiusLabel">
149+
<property name="text">
150+
<string>Pixel Radius:</string>
151+
</property>
152+
</widget>
153+
</item>
154+
<item>
155+
<widget class="QDoubleSpinBox" name="PixelRadius">
156+
<property name="maximumSize">
157+
<size>
158+
<width>143</width>
159+
<height>19</height>
160+
</size>
161+
</property>
162+
<property name="decimals">
163+
<number>0</number>
164+
</property>
165+
<property name="minimum">
166+
<double>0.000000000000000</double>
167+
</property>
168+
<property name="maximum">
169+
<double>1000.000000000000000</double>
170+
</property>
171+
<property name="singleStep">
172+
<double>10.000000000000000</double>
173+
</property>
174+
<property name="value">
175+
<double>100.000000000000000</double>
176+
</property>
177+
</widget>
178+
</item>
179+
<item>
180+
<widget class="Line" name="line_2">
181+
<property name="orientation">
182+
<enum>Qt::Horizontal</enum>
183+
</property>
184+
</widget>
173185
</item>
174186
<item>
175187
<spacer name="verticalSpacer">
@@ -230,6 +242,12 @@
230242
<header>QVTKWidget2.h</header>
231243
<container>1</container>
232244
</customwidget>
245+
<customwidget>
246+
<class>ctkCheckableComboBox</class>
247+
<extends>QWidget</extends>
248+
<header>ctkCheckableComboBox.h</header>
249+
<container>1</container>
250+
</customwidget>
233251
</customwidgets>
234252
<resources>
235253
<include location="../msvQButtonClusters.qrc"/>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1+
###########################################################################
2+
#
3+
# Library: MSVTK
4+
#
5+
# Copyright (c) Kitware Inc.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0.txt
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
###########################################################################
20+
121
add_subdirectory(Cpp)

Applications/ButtonClusters/Testing/Cpp/CMakeLists.txt

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
###########################################################################
2+
#
3+
# Library: MSVTK
4+
#
5+
# Copyright (c) Kitware Inc.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0.txt
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
###########################################################################
20+
121
set(KIT ButtonClusters)
222
set(KIT_TEST_SRCS
323
buttonclustersTest1.cxx
@@ -10,24 +30,16 @@ create_test_sourcelist(Tests ${KIT}CxxTests.cxx
1030

1131
set(LIBRARY_NAME msv${KIT})
1232

13-
add_executable(${KIT}CxxTests ${Tests})
14-
target_link_libraries(${KIT}CxxTests ${LIBRARY_NAME})
15-
16-
macro(SIMPLE_TEST TESTNAME)
17-
add_test(NAME ${TESTNAME} COMMAND $<TARGET_FILE:${KIT}CxxTests>
18-
${TESTNAME}
19-
${ARGN})
20-
endmacro()
33+
add_executable(msv${KIT}CxxTests ${Tests})
34+
target_link_libraries(msv${KIT}CxxTests ${LIBRARY_NAME})
2135

2236
#
2337
# Add Tests
2438
#
25-
2639
add_test(
2740
NAME buttonclustersTest1
28-
COMMAND $<TARGET_FILE:${KIT}CxxTests> buttonclustersTest1
29-
--buttonclusters $<TARGET_FILE_DIR:${KIT}CxxTests>
41+
COMMAND $<TARGET_FILE:msv${KIT}CxxTests> buttonclustersTest1
42+
--buttonclusters $<TARGET_FILE_DIR:msv${KIT}CxxTests>
3043
)
3144

3245
SIMPLE_TEST( msvQButtonClustersMainWindowTest1 )
33-
SIMPLE_TEST( msvVTKButtonClustersTest1 )

Applications/ButtonClusters/Testing/Cpp/buttonclustersTest1.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*==============================================================================
22
3-
Program: MSV BUTTON CLUSTERS
3+
Library: MSVTK
44
55
Copyright (c) Kitware Inc.
66
@@ -31,7 +31,7 @@ int buttonclustersTest1(int argc, char * argv[])
3131
{
3232
QCoreApplication app(argc, argv);
3333
QString path = (argc > 2) ? ("\"" + QString(argv[2]) + "/") : "";
34-
QString command = QString(path + "button_clusters\"");
34+
QString command = QString(path + "ButtonClusters\"");
3535
QProcess process;
3636
process.start(command);
3737
bool res = process.waitForStarted();

Applications/ButtonClusters/msvQButtonClustersAboutDialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
class msvQButtonClustersAboutDialogPrivate;
3434

35+
/// \brief About dialog for the ButtonClusters demo.
3536
class MSV_ButtonClusters_EXPORT msvQButtonClustersAboutDialog : public QDialog
3637
{
3738
Q_OBJECT

0 commit comments

Comments
 (0)