-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
103 changed files
with
18,165 additions
and
990 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(Cpp) |
21 changes: 21 additions & 0 deletions
21
Applications/ctkDICOMVisualBrowser/Testing/Cpp/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
ctkDICOM2Test1.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>) |
58 changes: 58 additions & 0 deletions
58
Applications/ctkDICOMVisualBrowser/Testing/Cpp/ctkDICOMVisualBrowserTest1.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
99
Applications/ctkDICOMVisualBrowser/ctkDICOMVisualBrowserMain.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("DirectoryButton")); | ||
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/*========================================================================= | ||
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. | ||
This file was originally developed by Davide Punzo, [email protected], | ||
and development was supported by the Center for Intelligent Image-guided Interventions (CI3). | ||
=========================================================================*/ | ||
|
||
#include "ctkAbstractTaskPool.h" | ||
|
||
// -------------------------------------------------------------------------- | ||
ctkAbstractTaskPool::ctkAbstractTaskPool(QObject* parent) | ||
: QObject(parent) | ||
{ | ||
} | ||
|
||
// -------------------------------------------------------------------------- | ||
ctkAbstractTaskPool::~ctkAbstractTaskPool() | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/*========================================================================= | ||
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. | ||
This file was originally developed by Davide Punzo, [email protected], | ||
and development was supported by the Center for Intelligent Image-guided Interventions (CI3). | ||
=========================================================================*/ | ||
|
||
#ifndef __ctkAbstractTaskPool_h | ||
#define __ctkAbstractTaskPool_h | ||
|
||
// Qt includes | ||
#include <QObject> | ||
|
||
// CTK includes | ||
#include "ctkCoreExport.h" | ||
|
||
//------------------------------------------------------------------------------ | ||
/// \ingroup Core | ||
class CTK_CORE_EXPORT ctkAbstractTaskPool : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit ctkAbstractTaskPool(QObject* parent = 0); | ||
virtual ~ctkAbstractTaskPool(); | ||
|
||
public Q_SLOTS: | ||
virtual void taskStarted() = 0; | ||
virtual void taskFinished() = 0; | ||
virtual void taskCanceled() = 0; | ||
|
||
private: | ||
Q_DISABLE_COPY(ctkAbstractTaskPool) | ||
}; | ||
|
||
|
||
#endif // ctkAbstractTaskPool_h |
Oops, something went wrong.