-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit fec6d22
Showing
6 changed files
with
239 additions
and
0 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,22 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Custom for Visual Studio | ||
*.cs diff=csharp | ||
*.sln merge=union | ||
*.csproj merge=union | ||
*.vbproj merge=union | ||
*.fsproj merge=union | ||
*.dbproj merge=union | ||
|
||
# Standard to msysgit | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain |
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 @@ | ||
Build-VS/ |
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,26 @@ | ||
################################################################################ | ||
# | ||
# 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. | ||
# | ||
################################################################################ | ||
|
||
cmake_minimum_required(VERSION 2.8.6) | ||
|
||
project(ImageViewer) | ||
|
||
add_subdirectory(ImageViewer) | ||
|
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,41 @@ | ||
################################################################################ | ||
# | ||
# 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. | ||
# | ||
################################################################################ | ||
|
||
cmake_minimum_required(VERSION 2.8.6) | ||
|
||
project(ImageViewer) | ||
|
||
find_package(CTK REQUIRED) | ||
include(${CTK_USE_FILE}) | ||
|
||
find_package(CTK REQUIRED) | ||
include(${CTK_USE_FILE}) | ||
|
||
find_package(Qt4 REQUIRED) | ||
SET(QT_USE_QTMAIN TRUE) | ||
SET(QT_USE_QTSQL TRUE) | ||
include(${QT_USE_FILE}) | ||
|
||
add_executable(ImageViewer main.cpp) | ||
target_link_libraries(ImageViewer ${QT_QTMAIN_LIBRARY} CTKWidgets CTKDICOMCore CTKDICOMWidgets CTKPluginFramework) | ||
IF(WIN32) | ||
set_target_properties(ImageViewer PROPERTIES LINK_FLAGS "/SUBSYSTEM:WINDOWS") | ||
|
||
ENDIF(WIN32) |
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,110 @@ | ||
/*========================================================================= | ||
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 <QApplication> | ||
#include <QFormLayout> | ||
#include <QVBoxLayout> | ||
|
||
#include <QApplication> | ||
#include <QTreeView> | ||
#include <QSettings> | ||
#include <QDir> | ||
#include <QResource> | ||
// CTK includes | ||
#include <ctkCheckablePushButton.h> | ||
#include <ctkCollapsibleButton.h> | ||
#include <ctkColorPickerButton.h> | ||
#include <ctkRangeWidget.h> | ||
#include <ctkDICOMAppWidget.h> | ||
// ctkDICOMCore includes | ||
#include "ctkDICOMDatabase.h" | ||
#include "ctkDICOMModel.h" | ||
// CTK Widgets | ||
#include "ctkDICOMItemView.h" | ||
|
||
// DCMTK includes | ||
#include <dcmimage.h> | ||
#include <QFileDialog> | ||
|
||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
QApplication app(argc, argv); | ||
|
||
QWidget topLevel; | ||
QVBoxLayout* topLevelLayout = new QVBoxLayout; | ||
|
||
ctkCollapsibleButton buttons("Buttons"); | ||
QFormLayout* buttonsLayout = new QFormLayout; | ||
buttonsLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); | ||
topLevelLayout->addWidget(&buttons); | ||
|
||
ctkCheckablePushButton checkablePushButton; | ||
checkablePushButton.setText("Checkable"); | ||
buttonsLayout->addRow("ctkCheckablePushButton", &checkablePushButton); | ||
|
||
ctkColorPickerButton colorPickerButton; | ||
colorPickerButton.setColor(QColor("#9e1414")); | ||
buttonsLayout->addRow("ctkColorPickerButton", &colorPickerButton); | ||
|
||
buttons.setLayout(buttonsLayout); | ||
|
||
ctkCollapsibleButton sliders("Sliders"); | ||
QFormLayout* slidersLayout = new QFormLayout; | ||
topLevelLayout->addWidget(&sliders); | ||
|
||
ctkRangeWidget rangeWidget; | ||
slidersLayout->addRow("ctkRangeWidget", &rangeWidget); | ||
|
||
sliders.setLayout(slidersLayout); | ||
|
||
topLevel.setLayout(topLevelLayout); | ||
topLevel.show(); | ||
ctkDICOMAppWidget DICOMApp; | ||
|
||
QString databaseDirectory; | ||
DICOMApp.setDatabaseDirectory(databaseDirectory); | ||
DICOMApp.show(); | ||
QString s; | ||
if( QApplication::argc() > 1 ) | ||
{ | ||
s = QApplication::argv()[1]; | ||
} | ||
else | ||
{ | ||
s = QFileDialog::getOpenFileName( 0, | ||
"Choose an image file", ".", | ||
"DCM (*)" | ||
); | ||
if( s.size() == 0 ) | ||
{ | ||
return EXIT_SUCCESS; | ||
} | ||
} | ||
|
||
DicomImage dcmImage( s.toStdString().c_str() ); | ||
|
||
ctkDICOMItemView imageView; | ||
imageView.addImage( dcmImage ); | ||
imageView.show(); | ||
imageView.raise(); | ||
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,39 @@ | ||
Examples | ||
======== | ||
|
||
Collection of independent CMake-based projects illustrating how to build and link against CTK. | ||
|
||
Build Instructions | ||
------------------ | ||
|
||
* First [download and build CTK](http://www.commontk.org/index.php/Build_Instructions) | ||
``` | ||
~/work$ git clone git://github.com/commontk/CTK.git | ||
~/work$ mkdir CTK-Superbuild | ||
~/work/CTK-Superbuild$ cd CTK-Superbuild | ||
~/work/CTK-Superbuild$ ccmake ../CTK | ||
~/work/CTK-Superbuild$ make | ||
``` | ||
|
||
* Then download and build Examples | ||
``` | ||
~/work$ git clone git://github.com/commontk/Examples.git | ||
~/work$ mkdir Examples-build | ||
~/work$ cd Examples-build | ||
~/work/Examples-build$ ccmake ../Examples -DCTK_DIR:PATH=~/work/CTK-Superbuild/ | ||
~/work/Examples-build$ make | ||
``` | ||
|
||
* Run example1 | ||
``` | ||
~/work/Examples-build$ ./Example1/example1 | ||
``` | ||
|
||
Help | ||
---- | ||
|
||
More information on the CommonToolkit webpage: | ||
* http://www.commontk.org | ||
|
||
Ask your questions on the CTK developer mailing list: | ||
* http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers |