Переглянути джерело

Removed obsolete plug-in.

Sascha Zelzer 12 роки тому
батько
коміт
5f8568476a

+ 0 - 3
CMakeLists.txt

@@ -578,9 +578,6 @@ set(plugin_list
   org.commontk.log
   org.commontk.log4qt
   org.commontk.metatype
-
-  # Misc
-  #org.commontk.slicermodule
   )
 
 foreach(_plugin ${plugin_list})  

+ 0 - 57
Plugins/org.commontk.slicermodule/CMakeLists.txt

@@ -1,57 +0,0 @@
-project(org_commontk_slicermodule)
-
-set(PLUGIN_export_directive "org_commontk_slicermodule_EXPORT")
-
-set(PLUGIN_SRCS
-  ctkSlicerModulePlugin.cpp
-  ctkSlicerModulePlugin_p.h
-  ctkSlicerModuleReader.cpp
-  ctkSlicerModuleReader.h
-  ctkSlicerModuleStringConverter.h
-  ctkSlicerModuleStringConverter.cpp
-)
-
-# Files which should be processed by Qts moc
-set(PLUGIN_MOC_SRCS
-  ctkSlicerModulePlugin_p.h
-  ctkSlicerModuleReader.h
-  ctkSlicerModuleStringConverter.h
-)
-
-# Qt Designer files which should be processed by Qts uic
-set(PLUGIN_UI_FORMS
-)
-
-# QRC Files which should be compiled into the plugin
-set(PLUGIN_resources
-  Resources/org_commontk_slicermodule.qrc
-)
-
-
-# Update CTK_BASE_LIBRARIES with QT libraries
-if(QT4_FOUND)
-  set(CTK_BASE_LIBRARIES ${CTK_BASE_LIBRARIES} ${QT_LIBRARIES} CACHE INTERNAL "CTK base libraries" FORCE)
-endif()
-
-#Compute the plugin dependencies
-ctkFunctionGetTargetLibraries(PLUGIN_target_libraries)
-
-ctkMacroBuildPlugin(
-  NAME ${PROJECT_NAME}
-  EXPORT_DIRECTIVE ${PLUGIN_export_directive}
-  SRCS ${PLUGIN_SRCS}
-  MOC_SRCS ${PLUGIN_MOC_SRCS}
-  UI_FORMS ${PLUGIN_UI_FORMS}
-  RESOURCES ${PLUGIN_resources}
-  TARGET_LIBRARIES ${PLUGIN_target_libraries}
-)
-
-set( QT_USE_QTXML ON )
-set( QT_USE_QTXMLPATTERNS ON )
-include(${QT_USE_FILE})
-target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES})
-
-# Testing
-if(BUILD_TESTING)
-  add_subdirectory(Testing)
-endif()

+ 0 - 146
Plugins/org.commontk.slicermodule/Resources/Xml/slicerModuleDescription.xsd

@@ -1,146 +0,0 @@
-<?xml version="1.0"?>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
-    <xsd:element name="executable">
-        <xsd:complexType>
-            <xsd:sequence>
-                <xsd:element name="category" type="xsd:string"/>
-                <xsd:element name="index" type="xsd:string"/>
-                <xsd:element name="title" type="xsd:string"/>
-                <xsd:element name="description" type="xsd:string"/>
-                <xsd:element name="version" type="xsd:string"/>
-                <xsd:element name="documentation-url" type="xsd:string"/>
-                <xsd:element name="license" type="xsd:string"/>
-                <xsd:element name="contributor" type="xsd:string"/>
-                <xsd:element name="acknowledgements" type="xsd:string"/>
-                <xsd:element name="parameters" type="parameters" maxOccurs="unbounded"/>
-            </xsd:sequence>
-        </xsd:complexType>
-    </xsd:element>
-
-    <xsd:complexType name="parameters">
-      <xsd:choice minOccurs="0" maxOccurs="unbounded">
-        <xsd:element name="label" type="xsd:string"/>
-        <xsd:element name="description" type="xsd:string"/>
-        <xsd:element name="integer" type="scalarType"/>
-        <xsd:element name="integer-vector" type="scalarType"/>
-        <xsd:element name="boolean" type="scalarType"/>
-        <xsd:element name="boolean-vector" type="scalarType"/>
-        <xsd:element name="float" type="scalarType"/>
-        <xsd:element name="float-vector" type="scalarType"/>
-        <xsd:element name="double" type="scalarType"/>
-        <xsd:element name="double-vector" type="scalarType"/>
-        <xsd:element name="string" type="paramType"/>
-        <xsd:element name="string-vector" type="paramType"/>
-        <xsd:element name="point" type="pointType"/>
-        <xsd:element name="point-vector" type="pointType"/>
-        <xsd:element name="region" type="pointType"/>
-        <xsd:element name="region-vector" type="pointType"/>
-        <xsd:element name="string-enumeration" type="enumerationType"/>
-        <xsd:element name="integer-enumeration" type="enumerationType"/>
-        <xsd:element name="float-enumeration" type="enumerationType"/>
-        <xsd:element name="double-enumeration" type="enumerationType"/>
-        <xsd:element name="file" type="indexedParamType"/>
-        <xsd:element name="directory" type="paramType"/>
-        <xsd:element name="transform" type="typedIndexParamType"/>
-        <xsd:element name="image" type="typedIndexParamType"/>
-        <xsd:element name="geometry" type="typedIndexParamType"/>
-        <xsd:element name="table" type="typedIndexParamType"/>
-        <xsd:element name="measurement" type="typedIndexParamType"/>
-      </xsd:choice>
-    </xsd:complexType>
-
-    <xsd:complexType name="paramType">    
-      <xsd:choice minOccurs="0" maxOccurs="unbounded">
-        <xsd:element name="name" type="xsd:string"/>
-        <xsd:element name="flag" type="flagType" />
-        <xsd:element name="longflag" type="flagType"/>
-        <xsd:element name="description" type="xsd:string"/>
-        <xsd:element name="label" type="xsd:string"/>
-        <xsd:element name="default" type="xsd:string"/>
-      </xsd:choice>
-      <xsd:attribute name="multiple" type="xsd:boolean"/>
-      <xsd:attribute name="hidden" type="xsd:boolean"/>
-    </xsd:complexType>
-    
-    <xsd:complexType name="scalarType" >
-      <xsd:complexContent>
-        <xsd:extension base="paramType">
-          <xsd:sequence>
-            <xsd:element name="constraints" type="constraintsType"  minOccurs="0" />
-          </xsd:sequence>
-        </xsd:extension>
-      </xsd:complexContent>
-    </xsd:complexType>
-
-    <xsd:complexType name="pointType" >
-      <xsd:complexContent>
-        <xsd:extension base="paramType">
-          <xsd:attribute name="coordinateSystem">
-            <xsd:simpleType>
-              <xsd:restriction base="xsd:string">
-                <xsd:enumeration value="RAS"/>
-                <xsd:enumeration value="IJK"/>
-              </xsd:restriction>
-            </xsd:simpleType>
-          </xsd:attribute>
-        </xsd:extension>
-      </xsd:complexContent>
-    </xsd:complexType>
-
-    <xsd:complexType name="enumerationType" >
-      <xsd:complexContent>
-        <xsd:extension base="paramType">
-          <xsd:sequence>
-            <xsd:element name="element" type="xsd:string"/>
-          </xsd:sequence>
-        </xsd:extension>
-      </xsd:complexContent>
-    </xsd:complexType>
-
-    <xsd:complexType name="indexedParamType" >
-      <xsd:all>
-        <xsd:element name="name" type="xsd:string"/>
-        <xsd:element name="label" type="xsd:string"/>
-        <xsd:element name="description" type="xsd:string"/>
-        <xsd:element name="channel" maxOccurs="1">
-          <xsd:simpleType>
-            <xsd:restriction base="xsd:string">
-              <xsd:enumeration value="input"/>
-              <xsd:enumeration value="output"/>
-            </xsd:restriction>
-          </xsd:simpleType>
-        </xsd:element>
-        <xsd:element name="index" type="xsd:nonNegativeInteger"/>
-      </xsd:all>
-      <xsd:attribute name="fileExtensions" type="xsd:string"/>
-    </xsd:complexType>
-
-    <xsd:complexType name="typedIndexParamType" >
-      <xsd:complexContent>
-        <xsd:extension base="indexedParamType">
-          <xsd:attribute name="reference" type="xsd:string"/>
-          <xsd:attribute name="type" type="xsd:string"/>
-          <xsd:attribute name="hidden" type="xsd:boolean"/>
-        </xsd:extension>
-      </xsd:complexContent>
-    </xsd:complexType>
-    
-    <xsd:complexType name="flagType">
-      <xsd:simpleContent>
-        <xsd:extension base="xsd:string">
-          <xsd:attribute name="alias" type="xsd:string"/>
-          <xsd:attribute name="deprecatedalias" type="xsd:string"/>
-        </xsd:extension>
-      </xsd:simpleContent>
-    </xsd:complexType>
-    
-    <xsd:complexType name="constraintsType">
-      <xsd:sequence>
-        <xsd:element name="minimum" type="xsd:double"/>
-        <xsd:element name="maximum" type="xsd:double"/>
-        <xsd:element name="step" type="xsd:double"/>
-      </xsd:sequence>
-    </xsd:complexType>
-
-</xsd:schema>

+ 0 - 5
Plugins/org.commontk.slicermodule/Resources/org_commontk_slicermodule.qrc

@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-  <qresource>
-    <file alias="slicerModuleDescription.xsd">Xml/slicerModuleDescription.xsd</file>
-  </qresource>
-</RCC>

+ 0 - 1
Plugins/org.commontk.slicermodule/Testing/CMakeLists.txt

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

+ 0 - 22
Plugins/org.commontk.slicermodule/Testing/Cpp/CMakeLists.txt

@@ -1,22 +0,0 @@
-set(KIT ${PROJECT_NAME})
-
-create_test_sourcelist(Tests ${KIT}CppTests.cpp
-  ctkSlicerModuleTest.cpp
-  )
-
-SET (TestsToRun ${Tests})
-REMOVE (TestsToRun ${KIT}CppTests.cpp)
-
-set(LIBRARY_NAME ${PROJECT_NAME})
-
-add_executable(${KIT}CppTests ${Tests})
-target_link_libraries(${KIT}CppTests ${LIBRARY_NAME} ${CTK_BASE_LIBRARIES})
-
-set(TEST_DATA ${${PROJECT_NAME}_SOURCE_DIR}/TestData)
-
-#
-# Add Tests
-#
-
-SIMPLE_TEST( ctkSlicerModuleTest ${TEST_DATA}/ParserTest1.xml )
-

+ 0 - 110
Plugins/org.commontk.slicermodule/Testing/Cpp/TestData/ParserTest1.xml

@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<executable>
-  <category>registration</category>
-  <title>NAMIC sample registration</title>
-  <description>Registers two images together using a rigid transform and MI</description>
-  <version>1.0</version>
-  <documentation-url></documentation-url>
-  <license></license>
-  <contributor>Daniel Blezek</contributor>
-
-  <parameters>
-    <label>Registration Parameters</label>
-    <description>Parameters used for registration</description>
-    <integer>
-      <name>HistogramBins</name>
-      <flag>-b</flag>
-      <longflag>--histogrambins</longflag>
-      <description>Number of histogram bins to use for Mattes Mutual Information</description>
-      <label>Histogram Bins</label>
-      <default>30</default>
-      <constraints>
-        <minimum>1</minimum>
-        <maximum>500</maximum>
-        <step>5</step>
-      </constraints>
-    </integer>
-
-    <integer>
-      <name>SpatialSamples</name>
-      <flag>-s</flag>
-      <longflag>--spatialsamples</longflag>
-      <description>Number of spatial samples to use in estimating Mattes Mutual Information</description>
-      <label>Spatial Samples</label>
-      <default>10000</default>
-      <constraints>
-        <minimum>1000</minimum>
-        <maximum>50000</maximum>
-        <step>1000</step>
-      </constraints>
-    </integer>
-
-    <boolean>
-      <name>InitializeTransform</name>
-      <flag>-u</flag>
-      <longflag>--noinitializetransform</longflag>
-      <description>Calculate initial transform</description>
-      <label>Initialize TransformSpatial Samples</label>
-      <default>false</default>
-    </boolean>
-
-    <integer-vector>
-      <name>Iterations</name>
-      <flag>-i</flag>
-      <longflag>--iterations</longflag>
-      <description>Comma separated list of iterations. Must have the same number of elements as learning rate</description>
-      <label>Iterations</label>
-      <default>100,100,100,200</default>
-    </integer-vector>
-
-    <float-vector>
-      <name>LearningRate</name>
-      <flag>-l</flag>
-      <longflag>--learningrate</longflag>
-      <description>Comma separated list of learning rates must have the same number of elements as iterations</description>
-      <label>Learning Rates</label>
-      <default>0.005,0.001,0.0005,0.0002</default>
-    </float-vector>
-    
-    <double>
-      <name>TranslationScale</name>
-      <longflag>--translationscale</longflag>
-      <flag>-t</flag>
-      <description>Relative scale of translations to rotations, i.e. a value of 100 means 10mm = 1 degree</description>
-      <label>Translation scaling</label>
-      <default>100.0</default>
-      <constraints>
-        <minimum>10.0</minimum>
-        <maximum>500.0</maximum>
-        <step>50.0</step>
-      </constraints>
-    </double>
-  </parameters>
-
-  <parameters>
-    <label>IO</label>
-    <description>Input/output parameters</description>
-    <file>
-      <name>FixedImage</name>
-      <label>Fixed Image</label>
-      <channel>input</channel>
-      <index>0</index>
-      <description>Fixed image to register to</description>
-    </file>
-    <file>
-      <name>MovingImage</name>
-      <label>Moving Image</label>
-      <channel>input</channel>
-      <index>1</index>
-      <description>Moving image</description>
-    </file>
-    <file>
-      <name>OutputImage</name>
-      <label>Output Volume</label>
-      <channel>output</channel>
-      <index>2</index>
-      <description>Resampled Moving Image</description>
-    </file>
-  </parameters>
-
-</executable>

+ 0 - 110
Plugins/org.commontk.slicermodule/Testing/Cpp/TestData/ParserTest2.xml

@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<executable>
-  <category>registration</category>
-  <title>NAMIC sample registration</title>
-  <description>Registers two images together using a rigid transform and MI</description>
-  <version>1.0</version>
-  <documentation-url></documentation-url>
-  <license></license>
-  <contributor>Daniel Blezek</contributor>
-
-  <parameters>
-    <label>Registration Parameters</label>
-    <description>Parameters used for registration</description>
-    <integer>
-      <name>HistogramBins</name>
-      <flag>-b</flag>
-      <longflag>--histogrambins</longflag>
-      <description>Number of histogram bins to use for Mattes Mutual Information</description>
-      <label>Histogram Bins</label>
-      <default>30</default>
-      <constraints>
-        <minimum>1</minimum>
-        <maximum>500</maximum>
-        <step>5</step>
-      </constraints>
-    </integer>
-
-    <integer>
-      <name>SpatialSamples</name>
-      <flag>-s</flag>
-      <longflag>--spatialsamples</longflag>
-      <description>Number of spatial samples to use in estimating Mattes Mutual Information</description>
-      <label>Spatial Samples</label>
-      <default>10000</default>
-      <constraints>
-        <minimum>1000</minimum>
-        <maximum>50000</maximum>
-        <step>1000</step>
-      </constraints>
-    </integer>
-
-    <boolean>
-      <name>InitializeTransform</name>
-      <flag>-u</flag>
-      <longflag>--noinitializetransform</longflag>
-      <description>Calculate initial transform</description>
-      <label>Initialize TransformSpatial Samples</label>
-      <default>false</default>
-    </boolean>
-
-    <integer-vector>
-      <name>Iterations</name>
-      <flag>-i</flag>
-      <longflag>--iterations</longflag>
-      <description>Comma separated list of iterations. Must have the same number of elements as learning rate</description>
-      <label>Iterations</label>
-      <default>100,100,100,200</default>
-    </integer-vector>
-
-    <float-vector>
-      <name>LearningRate</name>
-      <flag>-l</flag>
-      <longflag>--learningrate</longflag>
-      <description>Comma separated list of learning rates must have the same number of elements as iterations</description>
-      <label>Learning Rates</label>
-      <default>0.005,0.001,0.0005,0.0002</default>
-    </float-vector>
-    
-    <double>
-      <name>TranslationScale</name>
-      <longflag>--translationscale</longflag>
-      <flag>-t</flag>
-      <description>Relative scale of translations to rotations, i.e. a value of 100 means 10mm = 1 degree</description>
-      <label>Translation scaling</label>
-      <default>100.0</default>
-      <constraints>
-        <minimum>10.0</minimum>
-        <maximum>500.0</maximum>
-        <step>50.0</step>
-      </constraints>
-    </double>
-  </parameters>
-
-  <parameters>
-    <label>IO</label>
-    <description>Input/output parameters</description>
-    <image fileExtensions=".png,.nrrd">
-      <name>FixedImage</name>
-      <label>Fixed Image</label>
-      <channel>input</channel>
-      <index>0</index>
-      <description>Fixed image to register to</description>
-    </image>
-    <file fileExtensions=".txt,*.csv,*.html">
-      <name>MovingImage</name>
-      <label>Moving Image</label>
-      <channel>input</channel>
-      <index>1</index>
-      <description>Moving image</description>
-    </file>
-    <file fileExtensions="">
-      <name>OutputImage</name>
-      <label>Output Volume</label>
-      <channel>output</channel>
-      <index>2</index>
-      <description>Resampled Moving Image</description>
-    </file>
-  </parameters>
-
-</executable>

+ 0 - 146
Plugins/org.commontk.slicermodule/Testing/Cpp/ctkSlicerModuleTest.cpp

@@ -1,146 +0,0 @@
-/*=========================================================================
-
-  Library:   CTK
- 
-  Copyright (c) 2010  CISTIB - Universitat Pompeu Fabra
-
-  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 <QFile>
-
-// CTK includes
-#include "ctkModuleDescription.h"
-#include "ctkPluginFrameworkFactory.h"
-#include "ctkPluginFramework.h"
-#include "ctkPluginException.h"
-#include "ctkModuleDescriptionReader.h"
-#include "ctkModuleDescriptionConverterInterface.h"
-#include "ctkCommandLineParser.h"
-
-// STD includes
-#include <iostream>
-
-ctkModuleDescription ReadModuleDescription( ctkPluginContext* context, const QString &xmlFileName ) ;
-void BuildCommandLine( ctkPluginContext* context, const ctkModuleDescription& module ) ;
-
-
-//-----------------------------------------------------------------------------
-int ctkSlicerModuleTest(int argc, char * argv [] )
-{
-  QApplication app(argc, argv);
-  ctkCommandLineParser parser;
-  parser.addArgument("", "-F", QVariant::String);
-  bool ok = false;
-  QHash<QString, QVariant> parsedArgs = parser.parseArguments(argc, argv, &ok);
-  if (!ok)
-  {
-    std::cerr << qPrintable(parser.errorString()) << std::endl;
-    return EXIT_FAILURE;
-  }
-  QString xmlFileName = parsedArgs["-F"].toString();
-
-  ctkPluginFrameworkFactory fwFactory;
-  ctkPluginFramework* framework = fwFactory.getFramework();
-
-  try {
-    framework->init();
-  }
-  catch (const ctkPluginException& exc)
-  {
-    qCritical() << "Failed to initialize the plug-in framework:" << exc;
-    exit(1);
-  }
-
-
-#ifdef CMAKE_INTDIR
-  QString pluginPath = "/../plugins/" CMAKE_INTDIR "/";
-#else
-  QString pluginPath = "/plugins/";
-#endif
-
-  try
-  {
-    QString pluginLocation = "." + pluginPath + "liborg_commontk_slicermodule.dll";
-    ctkPlugin* plugin = framework->getPluginContext()->installPlugin(QUrl::fromLocalFile(pluginLocation));
-    plugin->start(ctkPlugin::START_TRANSIENT);
-
-    framework->start();
-
-    ctkModuleDescription module;
-    module = ReadModuleDescription( framework->getPluginContext(), xmlFileName );
-
-    BuildCommandLine( framework->getPluginContext(), module );
-
-  }
-  catch (const ctkPluginException& e)
-  {
-    qCritical() << e.what();
-  }
-
-  return EXIT_SUCCESS;
-}
-
-
-
-ctkModuleDescription ReadModuleDescription( 
-    ctkPluginContext* context, const QString &xmlFileName )
-{
-
-  ctkServiceReference* serviceRef;
-  serviceRef = context->getServiceReference( 
-    "ctkModuleDescriptionReaderInterface" );
-
-  ctkModuleDescriptionReader* reader;
-  reader = qobject_cast<ctkModuleDescriptionReader*>
-    (context->getService(serviceRef));
-
-
-  // Read file
-  QFile file( xmlFileName );
-  if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
-    {
-    std::cout << "XML file " << xmlFileName.toStdString( ) << " could not be opened." << std::endl;
-    exit(1);
-    }
-
-  // Parse XML file
-  reader->setInput( &file );
-  reader->update();
-  QTextStream stream(stdout);
-  stream << reader->moduleDescription( );
-
-  return reader->moduleDescription( );
-}
-
-void BuildCommandLine( ctkPluginContext* context, const ctkModuleDescription& module )
-{
-  ctkServiceReference* serviceRef;
-  serviceRef = context->getServiceReference( 
-    "ctkModuleDescriptionConverterInterface" );
-
-  ctkModuleDescriptionConverterInterface* converter;
-  converter = qobject_cast<ctkModuleDescriptionConverterInterface*>
-    (context->getService(serviceRef));
-
-  QStringList commandLineString;
-  converter->setModuleDescription( module );
-  converter->update();
-  commandLineString = converter->GetOutput().toStringList();
-  QTextStream stream(stdout);
-  stream << commandLineString;
-}
-

+ 0 - 79
Plugins/org.commontk.slicermodule/ctkSlicerModulePlugin.cpp

@@ -1,79 +0,0 @@
-/*=============================================================================
-
-  Library: CTK
-
-  Copyright (c) 2010 CISTIB - Universitat Pompeu Fabra
-
-  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
-
-  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.
-
-=============================================================================*/
-
-
-#include "ctkSlicerModulePlugin_p.h"
-#include "ctkSlicerModuleReader.h"
-#include "ctkSlicerModuleStringConverter.h"
-#include <QtPlugin>
-#include <QDebug>
-
-ctkSlicerModulePlugin* ctkSlicerModulePlugin::instance = 0;
-
-ctkSlicerModulePlugin::ctkSlicerModulePlugin()
-  : context(0)
-{
-}
-
-ctkSlicerModulePlugin::~ctkSlicerModulePlugin()
-{
-  
-}
-
-void ctkSlicerModulePlugin::start(ctkPluginContext* context)
-{
-  instance = this;
-  this->context = context;
-
-  this->reader = new ctkSlicerModuleReader( );
-  context->registerService(QStringList("ctkModuleDescriptionReaderInterface"),
-    this->reader);
-
-  this->stringConverter = new ctkSlicerModuleStringConverter( );
-  context->registerService(QStringList("ctkModuleDescriptionConverterInterface"),
-    this->stringConverter);
-
-  qDebug() << "Registered Slicer Module Description";
-}
-
-void ctkSlicerModulePlugin::stop(ctkPluginContext* context)
-{
-  delete this->reader;
-  this->reader = NULL;
-
-  delete this->stringConverter;
-  this->stringConverter = NULL;
-
-  Q_UNUSED(context)
-}
-
-ctkSlicerModulePlugin* ctkSlicerModulePlugin::getInstance()
-{
-  return instance;
-}
-
-ctkPluginContext* ctkSlicerModulePlugin::getPluginContext() const
-{
-  return context;
-}
-
-Q_EXPORT_PLUGIN2(org_commontk_slicermodule, ctkSlicerModulePlugin)
-
-

+ 0 - 59
Plugins/org.commontk.slicermodule/ctkSlicerModulePlugin_p.h

@@ -1,59 +0,0 @@
-/*=============================================================================
-
-  Library: CTK
-
-  Copyright (c) 2010 CISTIB - Universitat Pompeu Fabra
-
-  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
-
-  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 CTKSLICERMODULEPLUGIN_P_H
-#define CTKSLICERMODULEPLUGIN_P_H
-
-#include <ctkPluginActivator.h>
-
-class ctkModuleDescriptionReaderInterface;
-class ctkSlicerModuleStringConverter;
-
-class ctkSlicerModulePlugin :
-  public QObject, public ctkPluginActivator
-{
-  Q_OBJECT
-  Q_INTERFACES(ctkPluginActivator)
-
-public:
-
-  ctkSlicerModulePlugin();
-  ~ctkSlicerModulePlugin();
-
-  void start(ctkPluginContext* context);
-  void stop(ctkPluginContext* context);
-
-  static ctkSlicerModulePlugin* getInstance();
-
-  ctkPluginContext* getPluginContext() const;
-
-
-private:
-
-  static ctkSlicerModulePlugin* instance;
-  ctkPluginContext* context;
-  ctkModuleDescriptionReaderInterface* reader;
-  ctkSlicerModuleStringConverter* stringConverter;
-
-
-}; // ctkSlicerModulePlugin
-
-#endif // CTKSLICERMODULEPLUGIN_P_H

+ 0 - 617
Plugins/org.commontk.slicermodule/ctkSlicerModuleReader.cpp

@@ -1,617 +0,0 @@
-/*=============================================================================
-
-Library: CTK
-
-Copyright (c) 2010 Brigham and Women's Hospital (BWH) All Rights Reserved.
-
-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
-
-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 <QAbstractMessageHandler>
-#include <QDebug>
-#include <QXmlSchema>
-#include <QXmlSchemaValidator>
-#include <QVariant>
-
-// CTK includes
-#include "ctkSlicerModuleReader.h"
-
-// STD includes
-#include <stdexcept>
-
-class ctkDefaultMessageHandler : public QAbstractMessageHandler
-{
-public:
-  ctkDefaultMessageHandler(): QAbstractMessageHandler(0)
-  {
-  }
-
-  QString statusMessage() const
-  {
-  return m_description;
-  }
-
-  int line() const
-  {
-    return m_sourceLocation.line();
-  }
-
-  int column() const
-  {
-    return m_sourceLocation.column();
-  }
-
-protected:
-  virtual void handleMessage(QtMsgType type, const QString &description,
-                             const QUrl &identifier, const QSourceLocation &sourceLocation)
-  {
-    Q_UNUSED(type);
-    Q_UNUSED(identifier);
-
-    m_messageType = type;
-    m_description = description;
-    m_sourceLocation = sourceLocation;
-  }
-
-private:
-   QtMsgType m_messageType;
-   QString m_description;
-   QSourceLocation m_sourceLocation;
- };
- 
-// ----------------------------------------------------------------------------
-bool ctkSlicerModuleReader::validate()const
-{
-  ctkDefaultMessageHandler errorHandler;
-
-  QXmlSchema schema;
-  schema.setMessageHandler(&errorHandler);
-  schema.load(QUrl::fromLocalFile(":slicerModuleDescription.xsd"));
-  
-  bool res = schema.isValid();
-  if (!res)
-    {
-    QString error = errorHandler.statusMessage();
-    throw ctkRuntimeException( tr("Invalid Schema %1")
-      .arg(errorHandler.statusMessage()).toStdString() );
-    }
-
-  QXmlSchemaValidator validator(schema);
-  res = validator.validate(this->Device);
-
-  if (!res)
-    {
-    throw ctkRuntimeException( tr("Invalid XML(%1,%2):\n %3")
-      .arg(errorHandler.line())
-      .arg(errorHandler.column())
-      .arg(errorHandler.statusMessage()).toStdString());
-    }
-  this->Device->reset();
-  return res;
-}
-
-// ----------------------------------------------------------------------------
-void ctkSlicerModuleReader::update()
-{
-  // Verify the xml is correct
-  this->validate();
-
-  QXmlSimpleReader xmlReader;
-  QXmlInputSource *source = new QXmlInputSource(this->Device);
-  
-  ctkSlicerModuleHandler handler;
-  handler.setModuleDescription(&this->ModuleDescription);
-  xmlReader.setContentHandler(&handler);
-  xmlReader.setErrorHandler(&handler);
-
-  bool res = xmlReader.parse(source);
-
-  if (!res)
-    {
-    throw ctkRuntimeException( tr("Parse error %1")
-      .arg(handler.errorString()).toStdString() );
-    }
-}
-
-// ----------------------------------------------------------------------------
-ctkSlicerModuleHandler::ctkSlicerModuleHandler()
-{
-  this->ModuleDescription = 0;
-  this->State.CurrentParameter = 0;
-  this->State.CurrentGroup = 0;
-  this->State.InExecutable = 0;
-  this->State.InGroup = 0;
-  this->State.InParameter = 0;
-  this->ParamValidator = QRegExp("\\W");
-}
-
-// ----------------------------------------------------------------------------
-void ctkSlicerModuleHandler::setModuleDescription(ctkModuleDescription* moduleDescription)
-{
-  this->ModuleDescription = moduleDescription;
-}
-
-// ----------------------------------------------------------------------------
-ctkModuleDescription* ctkSlicerModuleHandler::moduleDescription()const
-{
-  return this->ModuleDescription;
-}
-// ----------------------------------------------------------------------------
-bool ctkSlicerModuleHandler::characters(const QString& ch)
-{
-  this->State.CurrentText = ch.trimmed();
-  return true;
-}
-
-// ----------------------------------------------------------------------------
-bool ctkSlicerModuleHandler::startElement(const QString& namespaceURI, const QString& localName,
-                                   const QString& name, const QXmlAttributes& atts)
-{
-  if (this->State.CurrentGroup == 0)
-    {
-    return this->startExecutableElement(namespaceURI, localName, name, atts);
-    }
-  else if (this->State.CurrentParameter == 0)
-    {
-    return this->startGroupElement(namespaceURI, localName, name, atts);
-    }
-  else
-    {
-    return this->startParameterElement(namespaceURI, localName, name, atts);
-    }
-  return false;
-}
-
-// ----------------------------------------------------------------------------
-bool ctkSlicerModuleHandler::endElement(const QString& namespaceURI,
-                                 const QString& localName,
-                                 const QString& qName)
-{
-  if (this->State.InParameter)
-    {
-    return this->endParameterElement(namespaceURI, localName, qName);
-    }
-  else if (this->State.InGroup)
-    {
-    return this->endGroupElement(namespaceURI, localName, qName);
-    }
-  else if (this->State.InExecutable)
-    {
-    return this->endExecutableElement(namespaceURI, localName, qName);
-    }
-  return false;
-}
-// ----------------------------------------------------------------------------
-bool ctkSlicerModuleHandler::startExecutableElement(const QString& namespaceURI,
-                                             const QString& localName,
-                                             const QString& name,
-                                             const QXmlAttributes& atts)
-{
-  Q_UNUSED(namespaceURI);
-  Q_UNUSED(localName);
-  ++this->State.InExecutable;
-  ctkModuleParameterGroup group;
-  if (name == "parameters")
-    {
-    if (!atts.value("advanced").isEmpty())
-      {
-      group["Advanced"] = QVariant(atts.value("advanced")).toBool() ? "true" : "false";
-      }
-    this->State.CurrentGroup = new ctkModuleParameterGroup(group);
-    }
-  return true;
-}
-
-// ----------------------------------------------------------------------------
-bool ctkSlicerModuleHandler::startGroupElement(const QString& namespaceURI,
-                                        const QString& localName,
-                                        const QString& name,
-                                        const QXmlAttributes& atts)
-{
-  Q_UNUSED(namespaceURI);
-  Q_UNUSED(localName);
-
-  ++this->State.InGroup;
-  if (name == "label" || name == "description")
-    {// not a parameter
-    return true;
-    }
-  ctkModuleParameter param;
-  param["Tag"] = name;
-  bool multiple = QVariant(atts.value("multiple")).toBool(); //empty (not found) is false
-  bool hidden = QVariant(atts.value("hidden")).toBool(); //empty (not found) is false
-  
-  if (name == "integer" || name == "integer-vector")
-    {
-    if (name == "integer-vector")
-      {
-      multiple = true;
-      }
-    param["Multiple"] = multiple ? "true" : "false";
-    param["CPPStyle"] = multiple ? "std::vector<int>" : "int";
-    param["ArgType"] = "int";
-    param["StringToType"] = "atoi";
-    }
-  else if (name == "float" || name == "float-vector")
-    {
-    if (name == "integer-vector")
-      {
-      multiple = true;
-      }
-    param["Multiple"] = multiple ? "true" : "false";
-    param["CPPStyle"] = multiple ? "std::vector<float>" : "float";
-    param["ArgType"] = "float";
-    param["StringToType"] = "atof";
-    }
-  else if (name == "double" || name == "double-vector")
-    {
-    if (name == "double-vector")
-      {
-      multiple = true;
-      }
-    param["Multiple"] = multiple ? "true" : "false";
-    param["CPPStyle"] = multiple ? "std::vector<double>" : "double";
-    param["ArgType"] = "double";
-    param["StringToType"] = "atof";
-    }
-  else if (name == "string")
-    {
-    if (name == "string-vector")
-      {
-      multiple = true;
-      }
-    param["Multiple"] = multiple ? "true" : "false";
-    param["CPPStyle"] = multiple ? "std::vector<std::string>" : "std::string";
-    param["ArgType"] = "std::string";
-    param["StringToType"] = "";
-    }
-  else if (name == "boolean")
-    {
-    if (name == "boolean-vector")
-      {
-      multiple = true;
-      }
-    param["Multiple"] = multiple ? "true" : "false";
-    param["CPPStyle"] = multiple ? "std::vector<bool>" : "bool";
-    param["ArgType"] = "bool";
-    param["StringToType"] = "";
-    param["Hidden"] = hidden ? "true" : "false";
-    }
-  else if (name == "point" || name == "point-vector" ||
-           name == "region" || name == "region-vector")
-    {
-    if (name == "point-vector" || name == "region-vector")
-      {
-      multiple = true;
-      }
-    param["Multiple"] = multiple ? "true" : "false";
-    param["CPPStyle"] = multiple ? "std::vector<std::vector<float> >" : "std::vector<float>";
-    param["ArgType"] = "float";
-    param["StringToType"] = "atof";
-    if (!atts.value("coordinateSystem").isEmpty())
-      {
-      param["CoordinateSystem"] = atts.value("coordinateSystem");
-      }
-    }
-  else if (name == "string-enumeration")
-    {
-    param["CPPStyle"] = "std::string";
-    }
-  else if (name == "integer-enumeration")
-    {
-    param["CPPStyle"] = "int";
-    }
-  else if (name == "float-enumeration")
-    {
-    param["CPPStyle"] = "float";
-    }
-  else if (name == "double-enumeration")
-    {
-    param["CPPStyle"] = "double";
-    }
-  else if (name == "file")
-    {
-    param["Multiple"] = multiple ? "true" : "false";
-    param["CPPType"] = multiple ? "std::vector<std::string>" : "std::string";
-    param["ArgType"] = "std::string";
-    param["Type"] = "scalar";
-    if (!atts.value("fileExtensions").isEmpty())
-      {
-      param["FileExtensionsAsString"] = atts.value("fileExtensions");
-      }
-    }
-  else if (name == "directory")
-    {
-    param["Multiple"] = multiple ? "true" : "false";
-    param["CPPStyle"] = multiple ? "std::vector<std::string>" : "std::string";
-    param["ArgType"] = "std::string";
-    }
-  else if (name == "transform")
-    {
-    param["Multiple"] = multiple ? "true" : "false";
-    param["CPPStyle"] = multiple ? "std::vector<std::string>" : "std::string";
-    param["ArgType"] = "std::string";
-    param["Type"] = atts.value("type").isEmpty() ? atts.value("type") : "unknown";
-    if (!atts.value("fileExtensions").isEmpty())
-      {
-      param["FileExtensionsAsString"] = atts.value("fileExtensions");
-      }
-    if (!atts.value("reference").isEmpty())
-      {
-      param["Reference"] = atts.value("reference");
-      }
-    }
-  else if (name == "image")
-    {
-    param["Multiple"] = multiple ? "true" : "false";
-    param["CPPStyle"] = multiple ? "std::vector<std::string>" : "std::string";
-    param["ArgType"] = "std::string";
-    param["Type"] = (!atts.value("type").isEmpty()) ? atts.value("type") : "scalar";
-    if (!atts.value("fileExtensions").isEmpty())
-      {
-      param["FileExtensionsAsString"] = atts.value("fileExtensions");
-      }
-    param["Hidden"] = hidden ? "true" : "false";
-    if (!atts.value("reference").isEmpty())
-      {
-      param["Reference"] = atts.value("reference");
-      }
-    }
-  else if (name == "geometry")
-    {
-    bool aggregate = QVariant(atts.value("aggregate")).toBool();
-    param["Multiple"] = multiple ? "true" : "false";
-    param["Aggregate"] = aggregate ? "true" : "false";
-    param["CPPType"] = (multiple && !aggregate) ? "std::vector<std::string>" : "std::string";
-    param["ArgType"] = "std::string";
-    param["Type"] = (!atts.value("type").isEmpty())? atts.value("type") : "scalar";
-    }
-  else if (name == "table")
-    {
-    param["Multiple"] = multiple ? "true" : "false";
-    param["CPPType"] = multiple ? "std::vector<std::string>" : "std::string";
-    param["ArgType"] = "std::string";
-    param["Type"] = (!atts.value("type").isEmpty())? atts.value("type") : "scalar";
-    if (!atts.value("reference").isEmpty())
-      {
-      param["Reference"] = atts.value("reference");
-      }
-    if (!atts.value("fileExtensions").isEmpty())
-      {
-      param["FileExtensionsAsString"] = atts.value("fileExtensions");
-      }
-    }
-  else if (name == "measurement")
-    {
-    param["Multiple"] = multiple ? "true" : "false";
-    param["CPPType"] = multiple ? "std::vector<std::string>" : "std::string";
-    param["ArgType"] = "std::string";
-    param["Type"] = (!atts.value("type").isEmpty())? atts.value("type") : "scalar";
-    param["Hidden"] = hidden ? "true" : "false";
-    if (!atts.value("reference").isEmpty())
-      {
-      param["Reference"] = atts.value("reference");
-      }
-    if (!atts.value("fileExtensions").isEmpty())
-      {
-      param["FileExtensionsAsString"] = atts.value("fileExtensions");
-      }
-    }
-  this->State.CurrentParameter = new ctkModuleParameter(param);
-  return true;
-}
-
-// ----------------------------------------------------------------------------
-bool ctkSlicerModuleHandler::startParameterElement(const QString& namespaceURI, const QString& localName,
-                                            const QString& name, const QXmlAttributes& atts)
-{
-  Q_UNUSED(namespaceURI);
-  Q_UNUSED(localName);
-
-  ++this->State.InParameter;
-  ctkModuleParameter& param = *this->State.CurrentParameter;
-  if (name == "flag")
-    {
-    if (!atts.value("alias").isEmpty())
-      {
-      param["FlagAliasesAsString"] = atts.value("alias");
-      }
-    if (!atts.value("deprecatedalias").isEmpty())
-      {
-      param["DeprecatedFlagAliasesAsString"] = atts.value("deprecatedalias");
-      }
-    }
-  else if (name == "longflag")
-    {
-    if (!atts.value("alias").isEmpty())
-      {
-      param["LongFlagAliasesAsString"] = atts.value("alias");
-      }
-    if (!atts.value("deprecatedalias").isEmpty())
-      {
-      param["DeprecatedLongFlagAliasesAsString"] = atts.value("deprecatedalias");
-      }
-    }
-  else if (name == "constraints")
-    {
-    param["Constraints"] = "true";
-    }
-  return true;
-}
-
-// ----------------------------------------------------------------------------
-bool ctkSlicerModuleHandler::endExecutableElement(const QString& namespaceURI,
-                                           const QString& localName,
-                                           const QString& name)
-{
-  Q_UNUSED(namespaceURI);
-  Q_UNUSED(localName);
-
-  --this->State.InExecutable;
-  ctkModuleDescription& module= *this->ModuleDescription;
-  if (name == "parameters")
-    {
-    Q_ASSERT(this->State.CurrentGroup);
-    this->ModuleDescription->addParameterGroup(this->State.CurrentGroup);
-    this->State.CurrentGroup = 0;
-    }
-  else if (name == "category")
-    {
-    module["Category"] = this->State.CurrentText;
-    }
-  else if (name == "index")
-    {
-    module["Index"] = this->State.CurrentText;
-    }
-  else if (name == "title")
-    {
-    module["Title"] = this->State.CurrentText;
-    }
-  else if (name == "version")
-    {
-    module["Version"] = this->State.CurrentText;
-    }
-  else if (name == "documentation-url")
-    {
-    module["DocumentationUrl"] = this->State.CurrentText;
-    }
-  else if (name == "license")
-    {
-    module["License"] = this->State.CurrentText;
-    }
-  else if (name == "acknowledgements")
-    {
-    module["License"] = this->State.CurrentText;
-    }
-  else if (name == "contributor")
-    {
-    module["Contributor"] = this->State.CurrentText;
-    }
-  else if (name == "location")
-    {
-    module["Location"] = this->State.CurrentText;
-    }
-  else if (name == "description")
-    {
-    module["Description"] = this->State.CurrentText.replace('\"','\'');
-    }
-  return true;
-}
-
-// ----------------------------------------------------------------------------
-bool ctkSlicerModuleHandler::endGroupElement(const QString& namespaceURI,
-                                      const QString& localName,
-                                      const QString& name)
-{
-  Q_UNUSED(namespaceURI);
-  Q_UNUSED(localName);
-
-  --this->State.InGroup;
-  Q_ASSERT(this->State.CurrentGroup);
-  ctkModuleParameterGroup& group = *this->State.CurrentGroup;
-  if (name == "label")
-    {
-    group["Label"] = this->State.CurrentText;
-    return true;
-    }
-  else if (name == "description")
-    {
-    group["Description"] = this->State.CurrentText.replace('\"', '\'');
-    return true;
-    }
-  Q_ASSERT(this->State.CurrentParameter);
-  this->State.CurrentGroup->addParameter(this->State.CurrentParameter);
-  this->State.CurrentParameter = 0;
-  return true;
-}
-
-// ----------------------------------------------------------------------------
-bool ctkSlicerModuleHandler::endParameterElement(const QString& namespaceURI, const QString& localName,
-                                          const QString& name)
-{
-  Q_UNUSED(namespaceURI);
-  Q_UNUSED(localName);
-
-  --this->State.InParameter;
-  bool res = true;
-  ctkModuleParameter& parameter = *this->State.CurrentParameter;
-  if (name == "flag")
-    {
-    QString flag = this->State.CurrentText;
-    flag.remove(0, flag.indexOf('-') + 1);
-    res = (flag.size() == 1);
-    if (!res)
-      {
-      qWarning() << "Invalid flag" << flag;
-      }
-    parameter["Flag"] = flag;
-    }
-  else if (name == "longflag")
-    {
-    QString flag = this->State.CurrentText;
-    flag.remove(0, flag.indexOf("--") + 2);
-    res = (flag.size() != 0 && this->ParamValidator.indexIn(flag) == -1);
-    if (!res)
-      {
-      qWarning() << "Invalid flag" << flag;
-      }
-    parameter["LongFlag"] = flag;
-    parameter["Name"] = parameter.value("Name", flag);
-    }
-  else if (name == "name")
-    {
-    QString paramName = this->State.CurrentText;
-    if (this->ParamValidator.indexIn(paramName) != -1)
-      {
-      res = false;
-      qWarning() << "Invalid name" << paramName;
-      }
-    parameter["Name"] = paramName;
-    }
-  else if (name == "label")
-    {
-    parameter["Label"] = this->State.CurrentText;
-    }
-  else if (name == "element")
-    {
-    parameter.insertMulti("Element", this->State.CurrentText);
-    }
-  else if (name == "default")
-    {
-    parameter["Default"] = this->State.CurrentText;
-    }
-  else if (name == "channel")
-    {
-    parameter["Channel"] = this->State.CurrentText;
-    }
-  else if (name == "index")
-    {
-    // TODO make sure Flag and LongFlag are empty
-    parameter["Index"] = this->State.CurrentText;
-    }
-  else if (name == "minimum")
-    {
-    parameter["Minimum"] = this->State.CurrentText;
-    }
-  else if (name == "maximum")
-    {
-    parameter["Maximum"] = this->State.CurrentText;
-    }
-  else if (name == "step")
-    {
-    parameter["Step"] = this->State.CurrentText;
-    }
-  return res;
-}

+ 0 - 96
Plugins/org.commontk.slicermodule/ctkSlicerModuleReader.h

@@ -1,96 +0,0 @@
-/*=============================================================================
-
-  Library: CTK
-
-  Copyright (c) 2010 Brigham and Women's Hospital (BWH) All Rights Reserved.
-
-  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
-
-  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 __ctkSlicerModuleReader_h
-#define __ctkSlicerModuleReader_h
-
-// Qt includes
-#include <QRegExp>
-#include <QStack>
-#include <QXmlAttributes>
-#include <QXmlDefaultHandler>
-
-// CTK includes
-#include "ctkModuleDescriptionReader.h"
-
-#include <org_commontk_slicermodule_Export.h>
-
-/**
- * Reader of Slicer Module XML description
- * Freely inspired from 
- * Slicer/Libs/SlicerExecutionModel/ModuleDescriptionParser/ModuleDescriptionParser.cxx
- */
-class org_commontk_slicermodule_EXPORT ctkSlicerModuleReader : public ctkModuleDescriptionReader
-{
-  Q_OBJECT
-public:
-  virtual void update();
-  bool validate()const; 
-};
-
-/**
- * Utility class to parse the Slicer Module XML descriptions using the
- * SAX interface.
- */
-class ctkSlicerModuleHandler: public QXmlDefaultHandler
-{
-public:
-  ctkSlicerModuleHandler();
-  bool characters(const QString& ch);
-  virtual bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName);
-  virtual bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts );
-  
-  void setModuleDescription(ctkModuleDescription* moduleDescription);
-  ctkModuleDescription* moduleDescription()const;
-
-protected:
-
-  bool startExecutableElement(const QString& namespaceURI, const QString& localName,
-                              const QString& name, const QXmlAttributes& atts);
-
-  bool startGroupElement(const QString& namespaceURI, const QString& localName,
-                         const QString& name, const QXmlAttributes& atts);
-
-  bool startParameterElement(const QString& namespaceURI, const QString& localName,
-                             const QString& name, const QXmlAttributes& atts);
-
-  bool endExecutableElement(const QString& namespaceURI, const QString& localName,
-                            const QString& name);
-
-  bool endGroupElement(const QString& namespaceURI, const QString& localName,
-                       const QString& name);
-
-  bool endParameterElement(const QString& namespaceURI, const QString& localName,
-                           const QString& name);
-                            
-  ctkModuleDescription* ModuleDescription;
-  struct ParserState{
-    ctkModuleParameter*      CurrentParameter;
-    ctkModuleParameterGroup* CurrentGroup;
-    QString                  CurrentText;
-    int                      InExecutable;
-    int                      InGroup;
-    int                      InParameter;
-  };
-  ParserState State;
-  QRegExp     ParamValidator;
-};
-
-#endif

+ 0 - 158
Plugins/org.commontk.slicermodule/ctkSlicerModuleStringConverter.cpp

@@ -1,158 +0,0 @@
-/*=============================================================================
-
-Library: CTK
-
-Copyright (c) 2010 CISTIB - Universtitat Pompeu Fabra
-
-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
-
-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.
-
-=============================================================================*/
-
-#include "ctkSlicerModuleStringConverter.h"
-#include <QVector>
-
-
-void ctkSlicerModuleStringConverter::update()
-{
-  SetTarget( );
-
-  SetAllParameters( );
-}
-
-const QVariant ctkSlicerModuleStringConverter::GetOutput()
-{
-  return this->CommandLineAsString;
-}
-
-void ctkSlicerModuleStringConverter::SetAllParameters()
-{
-  foreach( const ctkModuleParameterGroup* itGroup, this->ModuleDescription.parameterGroups())
-  {
-    foreach( const ctkModuleParameter* itParam, itGroup->parameters())
-    {
-      SetParameterValue( *itParam );
-    }
-  }
-}
-
-void ctkSlicerModuleStringConverter::SetParameterValue( const ctkModuleParameter &param )
-{
-  QString prefix;
-  QString flag;
-  bool hasFlag = false;
-
-  if ( param["LongFlag"] != "")
-  {
-    prefix = "--";
-    flag = param["LongFlag"];
-    hasFlag = true;
-  }
-  else if (param["Flag"] != "")
-  {
-    prefix = "-";
-    flag = param["Flag"];
-    hasFlag = true;
-  }
-
-
-  if (hasFlag)
-  {
-    if (   param["Tag"] != "boolean"
-      && param["Tag"] != "file" 
-      && param["Tag"] != "directory"
-      && param["Tag"] != "string"
-      && param["Tag"] != "integer-vector"
-      && param["Tag"] != "float-vector"
-      && param["Tag"] != "double-vector"
-      && param["Tag"] != "string-vector"
-      && param["Tag"] != "image"
-      && param["Tag"] != "point"
-      && param["Tag"] != "region"
-      && param["Tag"] != "transform"
-      && param["Tag"] != "geometry"
-      && param["Tag"] != "table"
-      && param["Tag"] != "measurement")
-    {
-      // simple parameter, write flag and value
-      this->CommandLineAsString.push_back(prefix + flag);
-      this->CommandLineAsString.push_back(param["Default"]);
-    }
-    else if (param["Tag"] == "boolean" && param["Default"] == "true")
-    {
-      this->CommandLineAsString.push_back(prefix + flag);
-    }
-    else if (param["Tag"] == "file" 
-      || param["Tag"] == "directory"
-      || param["Tag"] == "string"
-      || param["Tag"] == "integer-vector"
-      || param["Tag"] == "float-vector"
-      || param["Tag"] == "double-vector"
-      || param["Tag"] == "string-vector")
-    {
-      // Only write out the flag if value is not empty
-      if ( param["Default"] != "")
-      {
-        this->CommandLineAsString.push_back(prefix + flag);
-        this->CommandLineAsString.push_back( param["Default"] );
-      }
-    }
-    // data passed as parameter
-    else if ( param["Tag"] == "image" 
-      || param["Tag"] == "geometry"
-      || param["Tag"] == "transform" 
-      || param["Tag"] == "table" 
-      || param["Tag"] == "measurement" )
-    {
-      if ( param["Default"] != "")
-      {
-        this->CommandLineAsString.push_back(prefix + flag);
-        this->CommandLineAsString.push_back(param["Default"]);
-      }
-    }
-    else if ( param["Tag"] == "region" )
-    {
-      this->CommandLineAsString.push_back(prefix + flag);
-      this->CommandLineAsString.push_back( param["Default"] );
-    }
-    else if ( param["Tag"] == "point" )
-    {
-      QStringList points = param["Default"].split( ";");
-      foreach ( const QString &it, points )
-      {
-        this->CommandLineAsString.push_back(prefix + flag);
-        this->CommandLineAsString.push_back( it );
-      }
-    }
-
-  }
-
-  // If index is not empty -> It's a command line argument arg0, arg1, ... without flag prefix
-  if ( param["Index"] != "")
-  {
-    this->CommandLineAsString.push_back( param["Default"] );
-  }
-}
-
-void ctkSlicerModuleStringConverter::SetTarget()
-{
-  this->CommandLineAsString.clear();
-
-  if (!this->ModuleDescription["Location"].isEmpty() && 
-    this->ModuleDescription["Location"] != this->ModuleDescription["Target"])
-  {
-    this->CommandLineAsString.push_back(this->ModuleDescription["Location"]);
-  }
-  this->CommandLineAsString.push_back( this->ModuleDescription["Target"] );
-}
-
-

+ 0 - 65
Plugins/org.commontk.slicermodule/ctkSlicerModuleStringConverter.h

@@ -1,65 +0,0 @@
-/*=============================================================================
-
-  Library: CTK
-
-  Copyright (c) 2010 CISTIB - Universtitat Pompeu Fabra
-
-  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
-
-  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 __ctkSlicerModuleStringConverter_h
-#define __ctkSlicerModuleStringConverter_h
-
-#include <string>
-
-#include "ctkModuleDescriptionConverter.h"
-
-class ModuleDescription;
-class ModuleParameterGroup;
-
-
-/**
- * Convert Slicer Module description to command line string QStringList
- *
- */
-class ctkSlicerModuleStringConverter : public ctkModuleDescriptionConverter
-{
-  Q_OBJECT
-public:
-  ctkSlicerModuleStringConverter() {};
-  ~ctkSlicerModuleStringConverter() {};
-
-  ///
-  void update( );
-
-  ///
-  virtual const QVariant GetOutput( );
-
-protected:
-
-  //!
-  void SetAllParameters();
-
-  //!
-  void SetParameterValue( const ctkModuleParameter &param );
-
-  ///
-  void SetTarget();
-
-protected:
-
-  QStringList CommandLineAsString;
-};
-
-#endif

+ 0 - 10
Plugins/org.commontk.slicermodule/target_libraries.cmake

@@ -1,10 +0,0 @@
-# See CMake/ctkMacroGetTargetLibraries.cmake
-#
-# This file should list the libraries required to build the current CTK plugin.
-# For specifying required plugins, see the manifest_headers.cmake file.
-#
-
-set(target_libraries
-  CTKPluginFramework
-  CTKModuleDescription
-)