Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Visual DICOM Browser | ⚠️ Authorship of integration commit changed #1165

Merged
merged 73 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
cf6c99d
ENH: Add visual DICOM browser
Punzo Jan 6, 2024
4dddac2
BUG: Fix query bugs and warning background of query filters widget
Punzo Jan 8, 2024
eb372e4
ENH: Minor improvements for the visual DICOM browser
Punzo Jan 10, 2024
bd1f8fb
BUG: Fix ctkDICOMSchedulerTest1 test
Punzo Jan 12, 2024
7eb3a65
COMP: Fix -Wcatch-value in ctkDICOMVisualBrowserWidget
jcfr Jan 12, 2024
104e2ed
COMP: Fix deprecated use of QFileDialog::DirectoryOnly in ctkDICOMVis…
jcfr Jan 12, 2024
d103df2
COMP: Fix -Wsign-promo in ctkDICOMVisualBrowserWidget
jcfr Jan 12, 2024
610ac8f
BUG: Fix -Wint-in-bool-context in ctkDICOMPatientItemWidget
jcfr Jan 12, 2024
25c9518
COMP: Fix compilation of tests to account for API changes
jcfr Jan 12, 2024
5befcd1
BUG: Fix logging
Punzo Jan 16, 2024
a181270
COMP: Update newly introduced ctor/dtor to use "default" keyword if e…
jcfr Jan 16, 2024
4643cbd
COMP: Update newly introduced "extendable" private dtor to be virtual
jcfr Jan 16, 2024
0ce2b98
DOC: Group docstrings of newly introduced methods
jcfr Jan 16, 2024
91a6fc6
COMP: Fix constness of newly introduced DICOM methods accepting POD type
jcfr Jan 16, 2024
983edf3
COMP: Declare as "override" newly introduced virtual DICOM methods
jcfr Jan 16, 2024
18b8f16
COMP: Fix constness of ctkDICOMScheduler method accepting QString param
jcfr Jan 16, 2024
02ad815
COMP: Remove re-declaration of virtual pure methods in DICOM worker
jcfr Jan 16, 2024
c7dc6b8
STYLE: Rename DICOM property from "TypeOfJob" to "jobType"
jcfr Jan 17, 2024
94d29fb
STYLE: Rename DICOMDatabase ivar from "typeOfTask" to "jobType"
jcfr Jan 17, 2024
06d1305
COMP: Rename "ctkJobDetail" to "ctkDICOMJobDetail"
jcfr Jan 17, 2024
90e889c
COMP: Update DICOM scheduler API to use QString for server connection…
jcfr Jan 17, 2024
4c84f02
COMP: Fix ctkDICOMJobDetail wrapping renaming JobUID -> jobUID, addin…
jcfr Jan 17, 2024
b228ae4
COMP: Remove invalid declaration from ctkDICOMScheduler.cpp
jcfr Jan 17, 2024
fbda0f1
COMP: Fix clazy-range-loop-detach warning in ctkDICOMJobResponseSet
jcfr Jan 17, 2024
df9faf8
COMP: Explicitly exclude abstract job/scheduler/worker from wrapping
jcfr Jan 17, 2024
316980c
COMP: Manage jobs and workers as abstract objects
jcfr Jan 17, 2024
c53acee
COMP: Relocate onJob<Status> from DICOM to Abstract scheduler
jcfr Jan 17, 2024
3772564
COMP: Relocate Workers and JobsQueue map to abstract scheduler
jcfr Jan 17, 2024
a5b8baf
COMP: Simplify initialization of ctkDICOMJobDetails
jcfr Jan 17, 2024
efad661
COMP: Add ctkJobDetail
jcfr Jan 17, 2024
868bfb9
COMP: Rename "jobResponseSetToDetail()" to "toVariant()"
jcfr Jan 17, 2024
ac8c843
COMP: Remove scheduler "jobToDetail" and add "toVariant()" job function
jcfr Jan 17, 2024
b074c3e
COMP: Move "generateCopy" from ctkDICOMJob to ctkAbstractJob
jcfr Jan 17, 2024
3adca6f
COMP: Rename ctkAbstractJob "generateCopy()" to "clone()"
jcfr Jan 17, 2024
3147c37
COMP: Move startNextJob/onJobCanceled to ctkAbstractWorker
jcfr Jan 17, 2024
6e77c25
BUG: Adding missing jobUID and jobType to ctkDICOMJobDetail from resp…
Punzo Jan 17, 2024
9fbc04b
BUG: Fix loggerReport for the ctkDICOMInserterJob
Punzo Jan 17, 2024
6ebab36
COMP: Improve argument parsing in newly added DICOM tests
jcfr Jan 18, 2024
f003815
STYLE: Remove unused includes, fix include comment, remove extra EOF …
jcfr Jan 18, 2024
0540c88
COMP: Ensure DICOM Query, Retrieve and Schedule tests use a different DB
jcfr Jan 18, 2024
ef1bc89
COMP: Add "dcmqrscp" resource lock to CTK DICOM Echo and Scheduler tests
jcfr Jan 18, 2024
315af4c
ENH: Improve Browser and VisualBrowser test output to include testname
jcfr Jan 18, 2024
19d3faf
BUG: Fix ctkDICOMVisualBrowserWidgetTest1 argument parsing
jcfr Jan 18, 2024
e9b51c2
BUG: Update ctkDICOMVisualBrowserWidgetTest1 to use its own DB directory
jcfr Jan 18, 2024
742cc83
COMP: Update DICOMWidget CMakeLists.txt to include "Svg"
Punzo Jan 18, 2024
537501f
COMP: Update DICOM job "createWorker" function to return ctkAbstractJob
jcfr Jan 18, 2024
c096ffa
COMP: Simplify setting Finished status in retrieve and storageListene…
jcfr Jan 18, 2024
75955c0
COMP: Simplify worker API marking setJob with shared pointer param vi…
jcfr Jan 18, 2024
83e078a
COMP: Add ctkDICOMInserterWorkerPrivate::setInserterParameters
jcfr Jan 18, 2024
2ae3772
COMP: Fix constness of ctkDICOMServer method accepting QString param
jcfr Jan 18, 2024
3ad6394
COMP: Fix constness of ctkDICOMScheduler methods for inserting respon…
jcfr Jan 18, 2024
9d5272f
COMP: Prefer qSharedPointerObjectCast instead of qobject_cast<QShared…
jcfr Jan 18, 2024
d7fd6be
COMP: Fix more constness of introduced DICOM methods accepting POD type
jcfr Jan 18, 2024
4a4421b
COMP: Remove used of "const int" for ivars in ctkDICOMServerNodeWidget2
jcfr Jan 18, 2024
fbba856
COMP: Fix constness of ctkDICOMJobResponseSet::setDatasets
jcfr Jan 18, 2024
9b0bc8a
COMP: Fix constness of ctkDICOMJob::(copy|set)JobResponseSets
jcfr Jan 18, 2024
bf28636
COMP: Fix more constness in new DICOM widgets accepting QVariant
jcfr Jan 18, 2024
007982f
COMP: Fix more constness in DICOM ctkDICOMVisualBrowserWidget methods
jcfr Jan 18, 2024
2873a57
STYLE: Fix spacing, remove extra EOF lines
jcfr Jan 18, 2024
749d128
COMP: Fix constness of connectionName param in API for set/remove server
jcfr Jan 18, 2024
57d92c1
COMP: Remove "const bool&" in DICOM SeriesItem and VisualBrowser widgets
jcfr Jan 18, 2024
bbab77b
COMP: Fix more constness in DICOM ctkDICOMVisualBrowserWidget methods
jcfr Jan 18, 2024
8d1a470
DOC: Group docstrings of newly introduced methods in VisualBrowserWidget
jcfr Jan 18, 2024
0ae38b7
COMP: Remove deprecated ctkDICOMVisualBrowserWidget::onImportDirectory
jcfr Jan 18, 2024
7694c2a
COMP: Fix constness of ctkDICOMStorageListener::done() signal
jcfr Jan 18, 2024
81940a8
COMP: Rename ctkAbstractScheduler to ctkJobScheduler
jcfr Jan 18, 2024
71ed8f0
COMP: Rename ctkAbstractScheduler files to ctkJobScheduler
jcfr Jan 18, 2024
f8bf2f3
COMP: Simplify copy of JobResponseSet introducing clone()
jcfr Jan 18, 2024
92ebce8
DOC: Add comment in ctkDICOMItem::Clone()
jcfr Jan 18, 2024
3040abc
STYLE: Cleanup includes
jcfr Jan 18, 2024
3e025b8
STYLE: Fix line endings
jcfr Jan 18, 2024
61f8d36
STYLE: Remove ctkDICOMWorker class
Punzo Jan 18, 2024
e1f97cb
STYLE: Seletively apply clang reformatting
jcfr Jan 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Applications/ctkDICOMVisualBrowser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
project(ctkDICOMVisualBrowser)

#
# See CTK/CMake/ctkMacroBuildApp.cmake for details
#

# Source files
set(KIT_SRCS
ctkDICOMVisualBrowserMain.cpp
)

# Headers that should run through moc
set(KIT_MOC_SRCS
)

# UI files
set(KIT_UI_FORMS
)

# Resources
set(KIT_resources
)

# Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
# The following macro will read the target libraries from the file 'target_libraries.cmake'
ctkFunctionGetTargetLibraries(KIT_target_libraries)

ctkMacroBuildApp(
NAME ${PROJECT_NAME}
SRCS ${KIT_SRCS}
MOC_SRCS ${KIT_MOC_SRCS}
UI_FORMS ${KIT_UI_FORMS}
TARGET_LIBRARIES ${KIT_target_libraries}
RESOURCES ${KIT_resources}
)

# Testing
if(BUILD_TESTING)
add_subdirectory(Testing)
endif()
1 change: 1 addition & 0 deletions Applications/ctkDICOMVisualBrowser/Testing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(Cpp)
21 changes: 21 additions & 0 deletions Applications/ctkDICOMVisualBrowser/Testing/Cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
set(KIT ${PROJECT_NAME})

create_test_sourcelist(Tests ${KIT}CppTests.cpp
ctkDICOMVisualBrowserTest1.cpp
)

SET (TestsToRun ${Tests})
REMOVE (TestsToRun ${KIT}CppTests.cpp)

# Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
# The following macro will read the target libraries from the file '<KIT_SOURCE_DIR>/target_libraries.cmake'
ctkFunctionGetTargetLibraries(KIT_target_libraries ${${KIT}_SOURCE_DIR})

ctk_add_executable_utf8(${KIT}CppTests ${Tests})
target_link_libraries(${KIT}CppTests ${KIT_target_libraries})

#
# Add Tests
#

SIMPLE_TEST(ctkDICOMVisualBrowserTest1 $<TARGET_FILE:ctkDICOMVisualBrowser>)
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*=========================================================================

Library: CTK

Copyright (c) Kitware Inc.

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.txt

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.

=========================================================================*/

// Qt includes
#include <QCoreApplication>
#include <QProcess>

// STD includes
#include <cstdlib>
#include <iostream>

int ctkDICOMVisualBrowserTest1(int argc, char * argv [])
{
QCoreApplication app(argc, argv);
if (app.arguments().count() != 2)
{
std::cerr << "Line " << __LINE__ << " - Failed to run " << argv[0] << "\n"
<< "Usage:\n"
<< " " << argv[0] << " /path/to/ctkDICOM";
return EXIT_FAILURE;
}
QString command = app.arguments().at(1);
QProcess process;
process.start(command, /* arguments= */ QStringList());
bool res = process.waitForStarted();
if (!res)
{
std::cerr << '\"' << qPrintable(command) << '\"'
<< " didn't start correctly" << std::endl;
return res ? EXIT_SUCCESS : EXIT_FAILURE;
}
process.kill();
res = process.waitForFinished();
if (!res)
{
std::cerr << '\"' << qPrintable(command) << '\"'
<< " failed to terminate" << std::endl;
return res ? EXIT_SUCCESS : EXIT_FAILURE;
}
return res ? EXIT_SUCCESS : EXIT_FAILURE;
}
99 changes: 99 additions & 0 deletions Applications/ctkDICOMVisualBrowser/ctkDICOMVisualBrowserMain.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*=========================================================================

Library: CTK

Copyright (c) Isomics Inc.

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.txt

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.

=========================================================================*/

// Qt includes
#include <QApplication>
#include <QLabel>
#include <QDir>
#include <QHBoxLayout>
#include <QMainWindow>
#include <QResource>
#include <QSettings>
#include <QVBoxLayout>

// CTK widget includes
#include <ctkCollapsibleGroupBox.h>
#include <ctkDirectoryButton.h>
#include <ctkDICOMVisualBrowserWidget.h>

// STD includes
#include <iostream>

int main(int argc, char** argv)
{
QApplication app(argc, argv);

app.setOrganizationName("commontk");
app.setOrganizationDomain("commontk.org");
app.setApplicationName("ctkDICOM");

// set up Qt resource files
QResource::registerResource("./Resources/ctkDICOM.qrc");

QWidget mainWidget;
mainWidget.setObjectName(QString::fromUtf8("MainWidget"));
mainWidget.setWindowTitle(QString::fromUtf8("DICOM Visual Browser"));

QVBoxLayout mainLayout;
mainLayout.setObjectName(QString::fromUtf8("mainLayout"));
mainLayout.setContentsMargins(1, 1, 1, 1);

QHBoxLayout topLayout;
topLayout.setObjectName(QString::fromUtf8("topLayout"));
topLayout.setContentsMargins(1, 1, 1, 1);

QLabel databaseNameLabel;
databaseNameLabel.setObjectName(QString::fromUtf8("DatabaseNameLabel"));
databaseNameLabel.setMaximumSize(QSize(100, 30));
topLayout.addWidget(&databaseNameLabel);

ctkDirectoryButton directoryButton;
directoryButton.setObjectName(QString::fromUtf8("DirectoryButton"));
directoryButton.setMinimumSize(QSize(200, 30));
if (argc > 1)
{
directoryButton.setDirectory(argv[1]);
}
topLayout.addWidget(&directoryButton);

mainLayout.addLayout(&topLayout);

ctkDICOMVisualBrowserWidget DICOMVisualBrowser;
DICOMVisualBrowser.setObjectName(QString::fromUtf8("DICOMVisualBrowser"));
DICOMVisualBrowser.setDatabaseDirectorySettingsKey("DatabaseDirectory");
DICOMVisualBrowser.setMinimumSize(QSize(1000, 1000));
// set up the database
if (argc > 1)
{
DICOMVisualBrowser.setDatabaseDirectory(argv[1]);
}

DICOMVisualBrowser.serverSettingsGroupBox()->setChecked(true);
QObject::connect(&directoryButton, SIGNAL(directoryChanged(const QString&)),
&DICOMVisualBrowser, SLOT(setDatabaseDirectory(const QString&)));

mainLayout.addWidget(&DICOMVisualBrowser);

mainWidget.setLayout(&mainLayout);

mainWidget.show();

return app.exec();
}
9 changes: 9 additions & 0 deletions Applications/ctkDICOMVisualBrowser/target_libraries.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# See CMake/ctkFunctionGetTargetLibraries.cmake
#
# This file should list the libraries required to build the current CTK application.
#

set(target_libraries
CTKDICOMWidgets
)
6 changes: 6 additions & 0 deletions CMake/ctkMacroSetupQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ macro(ctkMacroSetupQt)

# See https://github.com/commontk/CTK/wiki/Maintenance#updates-of-required-qt-components

if(CTK_LIB_Widgets
OR CTK_LIB_DICOM/Widgets
)
list(APPEND CTK_QT5_COMPONENTS Svg)
endif()

if(CTK_LIB_Widgets
OR CTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTXML
)
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ ctk_app_option(ctkDICOM2
"Build the new DICOM example application (experimental)" OFF
CTK_ENABLE_DICOM AND CTK_BUILD_EXAMPLES)

ctk_app_option(ctkDICOMVisualBrowser
"Build the new DICOM example application (experimental)" OFF
CTK_ENABLE_DICOM AND CTK_BUILD_EXAMPLES)

ctk_app_option(ctkDICOMIndexer
"Build the DICOM example application" OFF
CTK_ENABLE_DICOM AND CTK_BUILD_EXAMPLES)
Expand Down
20 changes: 20 additions & 0 deletions Libs/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ set(KIT_SRCS
ctkAbstractFactory.tpp
ctkAbstractFileBasedFactory.h
ctkAbstractFileBasedFactory.tpp
ctkAbstractJob.cpp
ctkAbstractJob.h
ctkAbstractObjectFactory.h
ctkAbstractObjectFactory.tpp
ctkAbstractPluginFactory.h
Expand All @@ -30,6 +32,8 @@ set(KIT_SRCS
ctkAbstractQObjectFactory.tpp
ctkAbstractLibraryFactory.h
ctkAbstractLibraryFactory.tpp
ctkAbstractWorker.cpp
ctkAbstractWorker.h
ctkBackTrace.cpp
ctkBooleanMapper.cpp
ctkBooleanMapper.h
Expand Down Expand Up @@ -65,6 +69,9 @@ set(KIT_SRCS
ctkFileLogger.cpp
ctkFileLogger.h
ctkHighPrecisionTimer.cpp
ctkJobScheduler.cpp
ctkJobScheduler.h
ctkJobScheduler_p.h
ctkLinearValueProxy.cpp
ctkLinearValueProxy.h
ctkLogger.cpp
Expand Down Expand Up @@ -100,6 +107,8 @@ endif()

# Headers that should run through moc
set(KIT_MOC_SRCS
ctkAbstractJob.h
ctkAbstractWorker.h
ctkBooleanMapper.h
ctkCallback.h
ctkCommandLineParser.h
Expand All @@ -111,6 +120,8 @@ set(KIT_MOC_SRCS
ctkErrorLogQtMessageHandler.h
ctkErrorLogTerminalOutput.h
ctkFileLogger.h
ctkJobScheduler.h
ctkJobScheduler_p.h
ctkLinearValueProxy.h
ctkLogger.h
ctkModelTester.h
Expand All @@ -122,6 +133,15 @@ set(KIT_MOC_SRCS
ctkWorkflowTransitions.h
)

# Abstract class should not be wrapped !
set_source_files_properties(
ctkAbstractJob.h
ctkAbstractWorker.h
ctkJobScheduler.h
ctkJobScheduler_p.h
WRAP_EXCLUDE
)

# UI files
set(KIT_UI_FORMS
)
Expand Down
Loading
Loading