Kaynağa Gözat

Merge branch '336-new-dicom-browser'

Marco Nolden 12 yıl önce
ebeveyn
işleme
5a6f48baa0

+ 2 - 2
Applications/ctkDICOM/ctkDICOMMain.cpp

@@ -26,7 +26,7 @@
 #include <QResource>
 
 // CTK widget includes
-#include <ctkDICOMAppWidget.h>
+#include <ctkDICOMBrowser.h>
 
 // ctkDICOMCore includes
 #include "ctkDICOMDatabase.h"
@@ -79,7 +79,7 @@ int main(int argc, char** argv)
     }
   }
 
-  ctkDICOMAppWidget DICOMApp;
+  ctkDICOMBrowser DICOMApp;
 
   DICOMApp.setDatabaseDirectory(databaseDirectory);
   DICOMApp.show();

+ 40 - 0
Applications/ctkDICOM2/CMakeLists.txt

@@ -0,0 +1,40 @@
+project(ctkDICOM2)
+
+#
+# See CTK/CMake/ctkMacroBuildApp.cmake for details
+#
+  
+# Source files
+set(KIT_SRCS
+  ctkDICOM2Main.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 - 0
Applications/ctkDICOM2/Testing/CMakeLists.txt

@@ -0,0 +1 @@
+add_subdirectory(Cpp)

+ 21 - 0
Applications/ctkDICOM2/Testing/Cpp/CMakeLists.txt

@@ -0,0 +1,21 @@
+set(KIT ${PROJECT_NAME})
+
+create_test_sourcelist(Tests ${KIT}CppTests.cpp
+  ctkDICOMTest1.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})
+
+add_executable(${KIT}CppTests ${Tests})
+target_link_libraries(${KIT}CppTests ${KIT_target_libraries})
+
+#
+# Add Tests
+#
+
+SIMPLE_TEST(ctkDICOMTest1 $<TARGET_FILE:ctkDICOM>)

+ 58 - 0
Applications/ctkDICOM2/Testing/Cpp/ctkDICOMTest1.cpp

@@ -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 ctkDICOMTest1(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);
+  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;
+}

+ 88 - 0
Applications/ctkDICOM2/ctkDICOM2Main.cpp

@@ -0,0 +1,88 @@
+/*=========================================================================
+
+  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 <QTreeView>
+#include <QSettings>
+#include <QDir>
+#include <QResource>
+
+// CTK widget includes
+#include <ctkDICOMBrowser.h>
+
+// ctkDICOMCore includes
+#include "ctkDICOMDatabase.h"
+#include "ctkDICOMModel.h"
+
+// Logger
+#include "ctkLogger.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");
+
+  QSettings settings;
+  QString databaseDirectory;
+
+  // set up the database
+  if (argc > 1)
+  {
+    QString directory(argv[1]);
+    settings.setValue("DatabaseDirectory", directory);
+    settings.sync();
+  }
+
+  if ( settings.value("DatabaseDirectory", "") == "" )
+  {
+    databaseDirectory = QString("./ctkDICOM-Database");
+    std::cerr << "No DatabaseDirectory on command line or in settings.  Using \"" << databaseDirectory.toLatin1().data() << "\".\n";
+  } else
+  {
+    databaseDirectory = settings.value("DatabaseDirectory", "").toString();
+  }
+
+  QDir qdir(databaseDirectory);
+  if ( !qdir.exists(databaseDirectory) )
+  {
+    if ( !qdir.mkpath(databaseDirectory) )
+    {
+      std::cerr << "Could not create database directory \"" << databaseDirectory.toLatin1().data() << "\".\n";
+      return EXIT_FAILURE;
+    }
+  }
+
+  ctkDICOMBrowser DICOMApp;
+
+  DICOMApp.setDatabaseDirectory(databaseDirectory);
+  DICOMApp.show();
+
+  return app.exec();
+}

+ 9 - 0
Applications/ctkDICOM2/target_libraries.cmake

@@ -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
+  )

+ 5 - 0
CMakeLists.txt

@@ -508,6 +508,11 @@ set(CTK_ENABLED_LIBS ${_enabled_libs} CACHE INTERNAL "" FORCE)
 ctk_app_option(ctkDICOM
                "Build the DICOM example application" OFF
                CTK_ENABLE_DICOM AND CTK_BUILD_EXAMPLES)
+
+
+ctk_app_option(ctkDICOM2
+               "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

+ 4 - 0
Libs/DICOM/Widgets/CMakeLists.txt

@@ -11,6 +11,8 @@ set(KIT_export_directive "CTK_DICOM_WIDGETS_EXPORT")
 set(KIT_SRCS
   ctkDICOMAppWidget.cpp
   ctkDICOMAppWidget.h
+  ctkDICOMBrowser.cpp
+  ctkDICOMBrowser.h
   ctkDICOMDirectoryListWidget.cpp
   ctkDICOMDirectoryListWidget.h
   ctkDICOMImage.cpp
@@ -38,6 +40,7 @@ set(KIT_SRCS
 # Headers that should run through moc
 set(KIT_MOC_SRCS
   ctkDICOMAppWidget.h
+  ctkDICOMBrowser.h
   ctkDICOMItemView.h
   ctkDICOMDirectoryListWidget.h
   ctkDICOMImage.h
@@ -52,6 +55,7 @@ set(KIT_MOC_SRCS
 # UI files - includes new widgets
 set(KIT_UI_FORMS
   Resources/UI/ctkDICOMAppWidget.ui
+  Resources/UI/ctkDICOMBrowser.ui
   Resources/UI/ctkDICOMDirectoryListWidget.ui
   Resources/UI/ctkDICOMImportWidget.ui
   Resources/UI/ctkDICOMListenerWidget.ui

+ 762 - 0
Libs/DICOM/Widgets/Resources/UI/ctkDICOMBrowser.ui

@@ -0,0 +1,762 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ctkDICOMBrowser</class>
+ <widget class="QWidget" name="ctkDICOMBrowser">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>788</width>
+    <height>607</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
+   <string>ctkDICOMBrowser</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <property name="leftMargin">
+    <number>0</number>
+   </property>
+   <property name="topMargin">
+    <number>0</number>
+   </property>
+   <property name="rightMargin">
+    <number>0</number>
+   </property>
+   <property name="bottomMargin">
+    <number>12</number>
+   </property>
+   <item>
+    <widget class="QToolBar" name="ToolBar">
+     <property name="windowTitle">
+      <string>toolBar</string>
+     </property>
+     <property name="floatable">
+      <bool>true</bool>
+     </property>
+     <addaction name="ActionImport"/>
+     <addaction name="ActionExport"/>
+     <addaction name="ActionQuery"/>
+     <addaction name="ActionSend"/>
+     <addaction name="ActionRemove"/>
+    </widget>
+   </item>
+   <item>
+    <layout class="QVBoxLayout" name="VerticalLayout">
+     <property name="spacing">
+      <number>12</number>
+     </property>
+     <item>
+      <layout class="QHBoxLayout" name="TopLayout">
+       <property name="leftMargin">
+        <number>12</number>
+       </property>
+       <property name="rightMargin">
+        <number>12</number>
+       </property>
+       <item>
+        <widget class="QLabel" name="DatabaseNameLabel">
+         <property name="maximumSize">
+          <size>
+           <width>100</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>LocalDatabase:</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="ctkDirectoryButton" name="DirectoryButton" native="true">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="HorizontalSpacer">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QPushButton" name="SearchPopUpButton">
+         <property name="maximumSize">
+          <size>
+           <width>100</width>
+           <height>32</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Search</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="QueryLayout" stretch="1,0">
+     <property name="spacing">
+      <number>0</number>
+     </property>
+     <property name="leftMargin">
+      <number>12</number>
+     </property>
+     <property name="rightMargin">
+      <number>12</number>
+     </property>
+     <item>
+      <widget class="QTreeView" name="TreeView">
+       <property name="alternatingRowColors">
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <layout class="QVBoxLayout" name="searchOptionLayout">
+       <property name="spacing">
+        <number>6</number>
+       </property>
+       <item>
+        <widget class="QDockWidget" name="SearchDockWidget">
+         <property name="floating">
+          <bool>false</bool>
+         </property>
+         <property name="features">
+          <set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
+         </property>
+         <property name="windowTitle">
+          <string/>
+         </property>
+         <widget class="QWidget" name="dockWidgetContents">
+          <layout class="QVBoxLayout" name="verticalLayout_4">
+           <item>
+            <widget class="ctkDICOMQueryWidget" name="SearchOption" native="true">
+             <property name="minimumSize">
+              <size>
+               <width>0</width>
+               <height>0</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+        </widget>
+       </item>
+       <item>
+        <spacer name="VerticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QFrame" name="UserFrame">
+     <property name="frameShape">
+      <enum>QFrame::StyledPanel</enum>
+     </property>
+     <property name="frameShadow">
+      <enum>QFrame::Raised</enum>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="ViewerLayout">
+     <property name="leftMargin">
+      <number>12</number>
+     </property>
+     <property name="rightMargin">
+      <number>12</number>
+     </property>
+     <property name="bottomMargin">
+      <number>0</number>
+     </property>
+     <item>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <widget class="ctkDICOMThumbnailListWidget" name="ThumbnailsWidget" native="true">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>200</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_3">
+         <item>
+          <spacer name="horizontalSpacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QSlider" name="ThumbnailWidthSlider">
+           <property name="maximumSize">
+            <size>
+             <width>200</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="minimum">
+            <number>64</number>
+           </property>
+           <property name="maximum">
+            <number>256</number>
+           </property>
+           <property name="value">
+            <number>64</number>
+           </property>
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <widget class="QFrame" name="PreviewFrame">
+       <property name="minimumSize">
+        <size>
+         <width>256</width>
+         <height>256</height>
+        </size>
+       </property>
+       <layout class="QVBoxLayout" name="verticalLayout_3">
+        <item>
+         <layout class="QHBoxLayout" name="HorizontalLayout">
+          <item>
+           <widget class="QPushButton" name="PrevStudyButton">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+              <horstretch>32</horstretch>
+              <verstretch>32</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>40</width>
+              <height>32</height>
+             </size>
+            </property>
+            <property name="toolTip">
+             <string>Previous study</string>
+            </property>
+            <property name="text">
+             <string>&lt;&lt;&lt;</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QPushButton" name="PrevSeriesButton">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+              <horstretch>32</horstretch>
+              <verstretch>32</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>40</width>
+              <height>32</height>
+             </size>
+            </property>
+            <property name="toolTip">
+             <string>Previous series</string>
+            </property>
+            <property name="text">
+             <string>&lt;&lt;</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QPushButton" name="PrevImageButton">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+              <horstretch>32</horstretch>
+              <verstretch>32</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>40</width>
+              <height>32</height>
+             </size>
+            </property>
+            <property name="toolTip">
+             <string>Previous image</string>
+            </property>
+            <property name="text">
+             <string>&lt;</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QPushButton" name="NextImageButton">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+              <horstretch>32</horstretch>
+              <verstretch>32</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>40</width>
+              <height>32</height>
+             </size>
+            </property>
+            <property name="toolTip">
+             <string>Next image</string>
+            </property>
+            <property name="text">
+             <string>&gt;</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QPushButton" name="NextSeriesButton">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+              <horstretch>32</horstretch>
+              <verstretch>32</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>40</width>
+              <height>32</height>
+             </size>
+            </property>
+            <property name="toolTip">
+             <string>Next series</string>
+            </property>
+            <property name="text">
+             <string>&gt;&gt;</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QPushButton" name="NextStudyButton">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+              <horstretch>32</horstretch>
+              <verstretch>32</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>40</width>
+              <height>32</height>
+             </size>
+            </property>
+            <property name="toolTip">
+             <string>Next study</string>
+            </property>
+            <property name="text">
+             <string>&gt;&gt;&gt;</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+        <item>
+         <widget class="ctkDICOMItemView" name="ImagePreview" native="true">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <layout class="QHBoxLayout" name="horizontalLayout_2">
+          <item>
+           <widget class="QCheckBox" name="AutoPlayCheckbox">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="maximumSize">
+             <size>
+              <width>90</width>
+              <height>16777215</height>
+             </size>
+            </property>
+            <property name="text">
+             <string>auto-play</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QSlider" name="PlaySlider">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+  <action name="ActionImport">
+   <property name="text">
+    <string>Import</string>
+   </property>
+   <property name="toolTip">
+    <string>Import a DICOM file or folder</string>
+   </property>
+  </action>
+  <action name="ActionExport">
+   <property name="enabled">
+    <bool>false</bool>
+   </property>
+   <property name="text">
+    <string>Export</string>
+   </property>
+   <property name="toolTip">
+    <string>Export selected study/series to a DICOM folder (not yet available)</string>
+   </property>
+  </action>
+  <action name="ActionQuery">
+   <property name="text">
+    <string>Query</string>
+   </property>
+   <property name="toolTip">
+    <string>Query and Retrieve DICOM studies from a DICOM node</string>
+   </property>
+  </action>
+  <action name="ActionSend">
+   <property name="enabled">
+    <bool>false</bool>
+   </property>
+   <property name="text">
+    <string>Send</string>
+   </property>
+   <property name="toolTip">
+    <string>Send DICOM Studies to a DICOM node (not yet available)</string>
+   </property>
+  </action>
+  <action name="ActionRemove">
+   <property name="enabled">
+    <bool>false</bool>
+   </property>
+   <property name="text">
+    <string>Remove</string>
+   </property>
+   <property name="toolTip">
+    <string>Remove from database</string>
+   </property>
+  </action>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>ctkDICOMQueryWidget</class>
+   <extends>QWidget</extends>
+   <header>ctkDICOMQueryWidget.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>ctkDirectoryButton</class>
+   <extends>QWidget</extends>
+   <header>ctkDirectoryButton.h</header>
+   <container>1</container>
+   <slots>
+    <signal>directoryChanged(QString)</signal>
+   </slots>
+  </customwidget>
+  <customwidget>
+   <class>ctkDICOMThumbnailListWidget</class>
+   <extends>QWidget</extends>
+   <header>ctkDICOMThumbnailListWidget.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>ctkDICOMItemView</class>
+   <extends>QWidget</extends>
+   <header location="global">ctkDICOMItemView.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>ActionImport</sender>
+   <signal>triggered(bool)</signal>
+   <receiver>ctkDICOMBrowser</receiver>
+   <slot>openImportDialog()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>319</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>ActionExport</sender>
+   <signal>triggered(bool)</signal>
+   <receiver>ctkDICOMBrowser</receiver>
+   <slot>openExportDialog()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>319</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>ActionQuery</sender>
+   <signal>triggered(bool)</signal>
+   <receiver>ctkDICOMBrowser</receiver>
+   <slot>openQueryDialog()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>319</x>
+     <y>239</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>NextImageButton</sender>
+   <signal>clicked()</signal>
+   <receiver>ctkDICOMBrowser</receiver>
+   <slot>onNextImage()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>608</x>
+     <y>395</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>369</x>
+     <y>318</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PrevImageButton</sender>
+   <signal>clicked()</signal>
+   <receiver>ctkDICOMBrowser</receiver>
+   <slot>onPreviousImage()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>566</x>
+     <y>395</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>369</x>
+     <y>318</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>NextSeriesButton</sender>
+   <signal>clicked()</signal>
+   <receiver>ctkDICOMBrowser</receiver>
+   <slot>onNextSeries()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>650</x>
+     <y>395</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>369</x>
+     <y>318</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PrevSeriesButton</sender>
+   <signal>clicked()</signal>
+   <receiver>ctkDICOMBrowser</receiver>
+   <slot>onPreviousSeries()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>524</x>
+     <y>395</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>369</x>
+     <y>318</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>NextStudyButton</sender>
+   <signal>clicked()</signal>
+   <receiver>ctkDICOMBrowser</receiver>
+   <slot>onNextStudy()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>692</x>
+     <y>395</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>369</x>
+     <y>318</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>PrevStudyButton</sender>
+   <signal>clicked()</signal>
+   <receiver>ctkDICOMBrowser</receiver>
+   <slot>onPreviousStudy()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>482</x>
+     <y>395</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>369</x>
+     <y>318</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>AutoPlayCheckbox</sender>
+   <signal>stateChanged(int)</signal>
+   <receiver>ctkDICOMBrowser</receiver>
+   <slot>onAutoPlayCheckboxStateChanged(int)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>430</x>
+     <y>596</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>369</x>
+     <y>318</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>ThumbnailWidthSlider</sender>
+   <signal>valueChanged(int)</signal>
+   <receiver>ctkDICOMBrowser</receiver>
+   <slot>onThumbnailWidthSliderValueChanged(int)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>236</x>
+     <y>610</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>369</x>
+     <y>318</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>ActionRemove</sender>
+   <signal>triggered()</signal>
+   <receiver>ctkDICOMBrowser</receiver>
+   <slot>onRemoveAction()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>391</x>
+     <y>303</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <slot>openImportDialog()</slot>
+  <slot>openExportDialog()</slot>
+  <slot>openQueryDialog()</slot>
+  <slot>onDatabaseDirectoryChaged(QString)</slot>
+  <slot>onNextImage()</slot>
+  <slot>onPreviousImage()</slot>
+  <slot>onNextSeries()</slot>
+  <slot>onPreviousSeries()</slot>
+  <slot>onNextStudy()</slot>
+  <slot>onPreviousStudy()</slot>
+  <slot>onAutoPlayCheckboxStateChanged(int)</slot>
+  <slot>onThumbnailWidthSliderValueChanged(int)</slot>
+  <slot>onRemoveAction()</slot>
+ </slots>
+</ui>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1039 - 0
Libs/DICOM/Widgets/ctkDICOMBrowser.cpp


+ 168 - 0
Libs/DICOM/Widgets/ctkDICOMBrowser.h

@@ -0,0 +1,168 @@
+/*=========================================================================
+
+  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.
+
+=========================================================================*/
+
+#ifndef __ctkDICOMBrowser_h
+#define __ctkDICOMBrowser_h
+
+// Qt includes 
+#include <QWidget>
+
+#include "ctkDICOMWidgetsExport.h"
+
+class ctkDICOMBrowserPrivate;
+class ctkThumbnailLabel;
+class QModelIndex;
+class ctkDICOMDatabase;
+
+/// \ingroup DICOM_Widgets
+class CTK_DICOM_WIDGETS_EXPORT ctkDICOMBrowser : public QWidget
+{
+  Q_OBJECT
+  Q_PROPERTY(ctkDICOMDatabase* database READ database)
+  Q_PROPERTY(QString databaseDirectory READ databaseDirectory WRITE setDatabaseDirectory)
+  Q_PROPERTY(bool searchWidgetPopUpMode READ searchWidgetPopUpMode WRITE setSearchWidgetPopUpMode)
+  Q_PROPERTY(QStringList tagsToPrecache READ tagsToPrecache WRITE setTagsToPrecache)
+  Q_PROPERTY(bool displayImportSummary READ displayImportSummary WRITE setDisplayImportSummary)
+
+public:
+  typedef QWidget Superclass;
+  explicit ctkDICOMBrowser(QWidget* parent=0);
+  virtual ~ctkDICOMBrowser();
+
+  /// Directory being used to store the dicom database
+  QString databaseDirectory() const;
+
+  /// See ctkDICOMDatabase for description - these accessors
+  /// delegate to the corresponding routines of the internal
+  /// instance of the database.
+  /// @see ctkDICOMDatabase
+  void setTagsToPrecache(const QStringList tags);
+  const QStringList tagsToPrecache();
+
+  /// Updates schema of loaded database to match the one
+  /// coded by the current version of ctkDICOMDatabase.
+  /// Also provides a dialog box for progress
+  void updateDatabaseSchemaIfNeeded();
+
+  /// Setting search widget pop-up mode
+  /// Default value is false. Setting it to true will make
+  /// search widget to be displayed as pop-up widget
+  void setSearchWidgetPopUpMode(bool flag);
+  bool searchWidgetPopUpMode();
+  ctkDICOMDatabase* database();
+
+  /// Option to show or not import summary dialog.
+  /// Since the summary dialog is modal, we give the option
+  /// of disabling it for batch modes or testing.
+  void setDisplayImportSummary(bool);
+  bool displayImportSummary();
+  /// Accessors to status of last directory import operation
+  int patientsAddedDuringImport();
+  int studiesAddedDuringImport();
+  int seriesAddedDuringImport();
+  int instancesAddedDuringImport();
+
+public Q_SLOTS:
+  void setDatabaseDirectory(const QString& directory);
+  void onFileIndexed(const QString& filePath);
+
+  void openImportDialog();
+  void openExportDialog();
+  void openQueryDialog();
+  void onRemoveAction();
+
+  void suspendModel();
+  void resumeModel();
+  void resetModel();
+
+  /// Import a directory - this is used when the user selects a directory
+  /// from the Import Dialog, but can also be used externally to trigger
+  /// an import (i.e. for testing or to support drag-and-drop)
+  void onImportDirectory(QString directory);
+
+  /// slots to capture status updates from the database during an 
+  /// import operation
+  void onPatientAdded(int, QString, QString, QString);
+  void onStudyAdded(QString);
+  void onSeriesAdded(QString);
+  void onInstanceAdded(QString);
+
+Q_SIGNALS:
+  /// Emited when directory is changed
+  void databaseDirectoryChanged(const QString&);
+  /// Emited when query/retrieve operation has happened
+  void queryRetrieveFinished();
+  /// Emited when the directory import operation has completed
+  void directoryImported();
+
+protected:
+    QScopedPointer<ctkDICOMBrowserPrivate> d_ptr;
+protected Q_SLOTS:
+    void onModelSelected(const QModelIndex& index);
+
+    /// To be called when a thumbnail in thumbnail list widget is selected
+    void onThumbnailSelected(const ctkThumbnailLabel& widget);
+
+    /// To be called when a thumbnail in thumbnail list widget is double-clicked
+    void onThumbnailDoubleClicked(const ctkThumbnailLabel& widget);
+
+    /// To be called when previous and next buttons are clicked
+    void onNextImage();
+    void onPreviousImage();
+    void onNextSeries();
+    void onPreviousSeries();
+    void onNextStudy();
+    void onPreviousStudy();
+    /// To be called when dialog finishes
+    void onQueryRetrieveFinished();
+
+    /// To be called when an entry of the tree list is collapsed
+    void onTreeCollapsed(const QModelIndex& index);
+
+    /// To be called when an entry of the tree list is expanded
+    void onTreeExpanded(const QModelIndex& index);
+
+    /// To be called when auto-play checkbox state changed
+    void onAutoPlayCheckboxStateChanged(int state);
+
+    /// Called by timer for auto-play functionality
+    void onAutoPlayTimer();
+
+    /// To be called when the value of thumbnail size slider bar is changed
+    void onThumbnailWidthSliderValueChanged(int val);
+
+    /// To be called when search parameters in query widget changed
+    void onSearchParameterChanged();
+
+    /// To be called after image preview displayed an image
+    void onImagePreviewDisplayed(int imageID, int count);
+
+private Q_SLOTS:
+
+    void onSearchPopUpButtonClicked();
+
+    void onSearchWidgetTopLevelChanged(bool topLevel);
+
+private:
+  Q_DECLARE_PRIVATE(ctkDICOMBrowser);
+  Q_DISABLE_COPY(ctkDICOMBrowser);
+};
+
+#endif