Commit bde4dd67 authored by jcfr's avatar jcfr
Browse files

COMP: Split EMSegment in multiple libraries to be used by the QtPort

There are now 4 additionnal libraries:
 - EMSegmentAlgorithm (depends on VTK)
 - EMSegmentMRML (depends on MRML, ITK, EMSegmentAlgorithm, vtkSlicerVolumeLogic, SliceBaseLogic)
 - EMSegmentGraph (depends on VTK)
 - EMSegmentRegistration (depends on vtkITK)

Doing so allow to build these libraries also if Slicer3_USE_KWWIDGETS is OFF.

Note also that vtkEMSegmentMRMLManager has been moved into EMSegmentMRML library

git-svn-id: http://svn.slicer.org/Slicer4/trunk@14245 3bd1e089-480b-0410-8dfb-8563597acbee
parent 68feb41d
......@@ -656,6 +656,19 @@ IF (Slicer3_USE_KWWIDGETS)
endif(Slicer3_BUILD_CLI)
endif(Slicer3_BUILD_MODULES)
ENDIF (Slicer3_USE_KWWIDGETS)
#-----------------------------------------------------------------------------
# Module EMSegment libraries
# The EMSegment{Registration,Graph,Algorithm,MRML} libraries are built from the top-level
# CMakeLists.txt. Doing so allow to build these libraries also if Slicer3_USE_KWWIDGETS is OFF
if(Slicer3_BUILD_MODULES)
ADD_SUBDIRECTORY(Modules/EMSegment/Algorithm)
ADD_SUBDIRECTORY(Modules/EMSegment/MRML)
ADD_SUBDIRECTORY(Modules/EMSegment/Registration)
ADD_SUBDIRECTORY(Modules/EMSegment/Graph)
endif()
#-----------------------------------------------------------------------------
# Qt Loadable Modules
#
......
project(EMSegmentAlgorithm)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
# --------------------------------------------------------------------------
# Find Slicer3
if(NOT Slicer3_SOURCE_DIR)
find_package(Slicer3 REQUIRED)
include(${Slicer3_USE_FILE})
slicer3_set_default_install_prefix_for_external_projects()
endif(NOT Slicer3_SOURCE_DIR)
# --------------------------------------------------------------------------
# Include dirs
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/vtkEMSegmentAlgorithmConfigure.h.in
${CMAKE_CURRENT_BINARY_DIR}/vtkEMSegmentAlgorithmConfigure.h
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
file(GLOB headers
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/*.txx"
)
install(FILES
${headers}
"${CMAKE_CURRENT_BINARY_DIR}/vtkEMSegmentAlgorithmConfigure.h"
DESTINATION ${Slicer3_INSTALL_MODULES_INCLUDE_DIR}/${PROJECT_NAME} COMPONENT Development
)
# --------------------------------------------------------------------------
# Sources
set(KIT_SRCS
EMLocalInterface.cxx
EMLocalRegistrationCostFunction.cxx
EMLocalShapeCostFunction.cxx
vtkDataDef.cxx
vtkFileOps.cxx
vtkImageEMGeneral.cxx
vtkImageEMGenericClass.cxx
vtkImageEMLocalClass.cxx
vtkImageEMLocalGenericClass.cxx
vtkImageEMLocalSegmenter.cxx
vtkImageEMLocalSuperClass.cxx
vtkSimonParameterReaderWriter.cxx
vtkTimeDef.cxx
vtkImageMeanIntensityNormalization.cxx
# Not used in current implementation---used in slicer2 modules
# vtkImageEMAtlasClass.cxx
# vtkImageEMAtlasSegmenter.cxx
# vtkImageEMAtlasSuperClass.cxx
# vtkImageEMMarkov.cxx
)
set_source_files_properties(
# Algorithm sources (temporary exclusion)
EMLocalInterface.cxx
EMLocalRegistrationCostFunction.cxx
EMLocalShapeCostFunction.cxx
vtkDataDef.cxx
vtkFileOps.cxx
vtkSimonParameterReaderWriter.cxx
vtkTimeDef.cxx
vtkImageMeanIntensityNormalization.cxx
WRAP_EXCLUDE
)
# --------------------------------------------------------------------------
# Wrapping
include("${VTK_CMAKE_DIR}/vtkWrapTcl.cmake")
vtk_wrap_tcl3(${PROJECT_NAME}
KIT_TCL_SRCS
"${KIT_SRCS}" "")
# --------------------------------------------------------------------------
# Build and install the library
set(lib_name ${PROJECT_NAME})
add_library(${lib_name}
${KIT_SRCS}
${KIT_TCL_SRCS}
)
slicer3_set_modules_output_path(${lib_name})
target_link_libraries(${lib_name}
#${MRML_LIBRARIES}
)
# Apply user-defined properties to the library target.
IF(Slicer3_LIBRARY_PROPERTIES)
SET_TARGET_PROPERTIES(${lib_name} PROPERTIES
${Slicer3_LIBRARY_PROPERTIES}
)
ENDIF(Slicer3_LIBRARY_PROPERTIES)
slicer3_install_modules(${lib_name})
# --------------------------------------------------------------------------
# Testing
if(BUILD_TESTING)
# ADD_SUBDIRECTORY(Testing)
endif(BUILD_TESTING)
# --------------------------------------------------------------------------
# Install the testing data
#install(DIRECTORY
# Testing/TestData
# DESTINATION ${Slicer3_INSTALL_MODULES_SHARE_DIR}/${PROJECT_NAME}/Testing COMPONENT Development
# PATTERN ".svn" EXCLUDE
# )
......@@ -26,7 +26,7 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#ifndef _EMLOCALINTERFACE_H_INCLUDED
#define _EMLOCALINTERFACE_H_INCLUDED 1
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include "vtkMultiThreader.h"
// Defines the maximum number of threads used throughout this program.
......@@ -65,7 +65,7 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
// Hierachy / SuperClass specific parameters
//--------------------------------------------------------------------
//BTX
class VTK_EMSEGMENT_EXPORT EMLocal_Hierarchical_Class_Parameters {
class VTK_EMSEGMENT_ALGORITHM_EXPORT EMLocal_Hierarchical_Class_Parameters {
public:
int NumClasses;
int NumTotalTypeCLASS;
......
......@@ -27,7 +27,7 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include "assert.h"
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include "vtkMultiThreader.h"
#include "vtkImageEMGenericClass.h"
#include "EMLocalInterface.h"
......@@ -106,7 +106,7 @@ class EMLocalRegistrationCostFunction_ROI {
// ROI Related Structure
// Main Class
// --------------------------------------
class VTK_EMSEGMENT_EXPORT EMLocalRegistrationCostFunction {
class VTK_EMSEGMENT_ALGORITHM_EXPORT EMLocalRegistrationCostFunction {
public:
// -----------------------------------------------
// Core Functions
......
......@@ -25,7 +25,7 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#ifndef _EMLOCALSHAPECOSTFUNCTION_H_INCLUDED
#define _EMLOCALSHAPECOSTFUNCTION_H_INCLUDED 1
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include "EMLocalInterface.h"
#include "vtkMultiThreader.h"
......@@ -49,7 +49,7 @@ typedef struct {
} EMLocalShapeCostFunction_IterationSpecificVariables;
class VTK_EMSEGMENT_EXPORT EMLocalShapeCostFunction {
class VTK_EMSEGMENT_ALGORITHM_EXPORT EMLocalShapeCostFunction {
public:
// ------------------------
// Core Functions
......
......@@ -25,7 +25,7 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#ifndef _ITKEMLOCALREOPTIMIZATION_H_INCLUDED
#define _ITKEMLOCALREOPTIMIZATION_H_INCLUDED 1
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include "itkSingleValuedCostFunction.h"
#include "EMLocalRegistrationCostFunction.h"
#include "EMLocalShapeCostFunction.h"
......@@ -47,7 +47,7 @@ namespace itk
*
* \ingroup RegistrationMetrics
*/
class VTK_EMSEGMENT_EXPORT EMLocalCostFunctionWrapper : public SingleValuedCostFunction
class VTK_EMSEGMENT_ALGORITHM_EXPORT EMLocalCostFunctionWrapper : public SingleValuedCostFunction
{
public:
......
......@@ -15,7 +15,7 @@
#define __vtkDataDef_h
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include "vtkObject.h"
#include "assert.h"
// #include "ostream.h"
......@@ -56,7 +56,7 @@ typedef struct {
/// ----------------------------------------------------------------------------------------------/
/// Kilian turn around dimension so it is y,x,z like in matlab !
class VTK_EMSEGMENT_EXPORT EMVolume {
class VTK_EMSEGMENT_ALGORITHM_EXPORT EMVolume {
public:
//static EMVolume *New() {return (new vtkDataDef);}
EMVolume(){this->Data = NULL;this->MaxX = this->MaxY = this->MaxZ = this->MaxXY = this->MaxXYZ = 0;}
......@@ -226,7 +226,7 @@ protected :
/// ----------------------------------------------------------------------------------------------/
/// It is a 5 dimensional Volume where m[t1][t2][z][y][x] t1>= t2 is only defined
/// Lower Traingular matrix - or a symmetric matrix where you only save the lower triangle
class VTK_EMSEGMENT_EXPORT EMTriVolume {
class VTK_EMSEGMENT_ALGORITHM_EXPORT EMTriVolume {
protected :
EMVolume **TriVolume;
int Dim;
......@@ -340,7 +340,7 @@ void EraseDataFile(char *FileName) {
/// ----------------------------------------------------------------------------------------------
/// Dummy class
/// ----------------------------------------------------------------------------------------------/
class VTK_EMSEGMENT_EXPORT vtkDataDef {
class VTK_EMSEGMENT_ALGORITHM_EXPORT vtkDataDef {
public:
static vtkDataDef *New() {return (new vtkDataDef);}
protected:
......
#include "vtkEMSegmentAlgorithmWin32Header.h"
/*
* Here is where system computed values get stored.
* These values should only change when the target compile platform changes.
*/
#include "vtkSlicerConfigure.h"
#cmakedefine BUILD_SHARED_LIBS
#ifndef BUILD_SHARED_LIBS
#define VTKSLICER_STATIC
#endif
#ifndef __vtkEMSegmentAlgorithmWin32Header_h
#define __vtkEMSegmentAlgorithmWin32Header_h
#include <vtkEMSegmentAlgorithmConfigure.h>
#if defined(WIN32) && !defined(VTKSLICER_STATIC)
#if defined(EMSegmentAlgorithm_EXPORTS)
#define VTK_EMSEGMENT_ALGORITHM_EXPORT __declspec( dllexport )
#else
#define VTK_EMSEGMENT_ALGORITHM_EXPORT __declspec( dllimport )
#endif
#else
#define VTK_EMSEGMENT_ALGORITHM_EXPORT
#endif
#endif
......@@ -15,9 +15,9 @@
#define __vtkFileOps_h
#include "vtkObject.h"
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
class VTK_EMSEGMENT_EXPORT vtkFileOps { //; prevent man page generation
class VTK_EMSEGMENT_ALGORITHM_EXPORT vtkFileOps { //; prevent man page generation
public:
static vtkFileOps *New() {return (new vtkFileOps);}
......
......@@ -15,12 +15,12 @@
#ifndef __vtkImageEMAtlasClass_h
#define __vtkImageEMAtlasClass_h
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include "vtkImageEMGenericClass.h"
//!!!bcd!!!#include "vtkSlicer.h"
class VTK_EMSEGMENT_EXPORT vtkImageEMAtlasClass : public vtkImageEMGenericClass
class VTK_EMSEGMENT_ALGORITHM_EXPORT vtkImageEMAtlasClass : public vtkImageEMGenericClass
{
public:
// -----------------------------------------------------
......
......@@ -18,7 +18,7 @@
#define __vtkImageEMAtlasSegmenter_h
#include "vtkImageEMGeneral.h"
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include "vtkImageData.h"
#include "vtkImageEMAtlasSuperClass.h"
......@@ -57,7 +57,7 @@ typedef struct {
} EMAtlas_MF_Approximation_Work_Private;
//ETX
class VTK_EMSEGMENT_EXPORT vtkImageEMAtlasSegmenter : public vtkImageEMGeneral
class VTK_EMSEGMENT_ALGORITHM_EXPORT vtkImageEMAtlasSegmenter : public vtkImageEMGeneral
{
public:
// -----------------------------------------------------
......
......@@ -15,12 +15,12 @@
#ifndef __vtkImageEMAtlasSuperClass_h
#define __vtkImageEMAtlasSuperClass_h
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include "vtkImageEMAtlasClass.h"
//!!!bcd!!!#include "vtkSlicer.h"
class VTK_EMSEGMENT_EXPORT vtkImageEMAtlasSuperClass : public vtkImageEMGenericClass
class VTK_EMSEGMENT_ALGORITHM_EXPORT vtkImageEMAtlasSuperClass : public vtkImageEMGenericClass
{
public:
// -----------------------------------------------------
......
......@@ -24,7 +24,7 @@
// ------------------------------------
#ifndef __vtkImageEMGeneral_h
#define __vtkImageEMGeneral_h
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include <math.h>
#include <cmath>
#include "vtkMath.h"
......@@ -94,7 +94,7 @@
//ETX
class VTK_EMSEGMENT_EXPORT vtkImageEMGeneral : public vtkImageMultipleInputFilter
class VTK_EMSEGMENT_ALGORITHM_EXPORT vtkImageEMGeneral : public vtkImageMultipleInputFilter
{
public:
// -------------------------------
......
......@@ -20,7 +20,7 @@
#ifndef __vtkImageEMGenericClass_h
#define __vtkImageEMGenericClass_h
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include <iostream>
#include "vtkImageMultipleInputFilter.h"
#include "vtkImageData.h"
......@@ -39,7 +39,7 @@ enum classType {CLASS, SUPERCLASS};
//BTX
// Class for capturing different protocols throughout the segmentation process
class VTK_EMSEGMENT_EXPORT ProtocolMessages {
class VTK_EMSEGMENT_ALGORITHM_EXPORT ProtocolMessages {
public:
int GetFlag() {return this->Flag;}
char* GetMessages();
......@@ -122,7 +122,7 @@ private:
//ETX
class VTK_EMSEGMENT_EXPORT vtkImageEMGenericClass : public vtkImageMultipleInputFilter
class VTK_EMSEGMENT_ALGORITHM_EXPORT vtkImageEMGenericClass : public vtkImageMultipleInputFilter
{
public:
// -----------------------------------------------------
......
......@@ -15,14 +15,14 @@
#ifndef __vtkImageEMLocalClass_h
#define __vtkImageEMLocalClass_h
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include "vtkImageEMLocalGenericClass.h"
#include "assert.h"
#define EMSEGMENT_NUM_OF_QUALITY_MEASURE 1
class VTK_EMSEGMENT_EXPORT vtkImageEMLocalClass : public vtkImageEMLocalGenericClass
class VTK_EMSEGMENT_ALGORITHM_EXPORT vtkImageEMLocalClass : public vtkImageEMLocalGenericClass
{
public:
// -----------------------------------------------------
......
......@@ -24,7 +24,7 @@
#ifndef __vtkImageEMLocalGenericClass_h
#define __vtkImageEMLocalGenericClass_h
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include "vtkImageEMGenericClass.h"
#include "vtkImageData.h"
#include "vtkOStreamWrapper.h"
......@@ -32,7 +32,7 @@
// Do you want to run the code with all the print outs (set 1) or not (0)
#define EMVERBOSE 0
class VTK_EMSEGMENT_EXPORT vtkImageEMLocalGenericClass : public vtkImageEMGenericClass
class VTK_EMSEGMENT_ALGORITHM_EXPORT vtkImageEMLocalGenericClass : public vtkImageEMGenericClass
{
public:
// -----------------------------------------------------
......
......@@ -17,7 +17,7 @@
#ifndef __vtkImageEMLocalSegmenter_h
#define __vtkImageEMLocalSegmenter_h
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include "vtkImageEMGeneral.h"
#include "vtkImageEMLocalSuperClass.h"
......@@ -29,7 +29,7 @@
// Class Definition
//--------------------------------------------------------------------
//ETX
class VTK_EMSEGMENT_EXPORT vtkImageEMLocalSegmenter : public vtkImageEMGeneral
class VTK_EMSEGMENT_ALGORITHM_EXPORT vtkImageEMLocalSegmenter : public vtkImageEMGeneral
{
public:
// -----------------------------------------------------
......
......@@ -15,12 +15,12 @@
#ifndef __vtkImageEMLocalSuperClass_h
#define __vtkImageEMLocalSuperClass_h
#include "vtkEMSegment.h"
#include "vtkEMSegmentAlgorithm.h"
#include "vtkImageEMLocalClass.h"
#include "EMLocalInterface.h"
class VTK_EMSEGMENT_EXPORT vtkImageEMLocalSuperClass : public vtkImageEMLocalGenericClass
class VTK_EMSEGMENT_ALGORITHM_EXPORT vtkImageEMLocalSuperClass : public vtkImageEMLocalGenericClass
{
public:
// -----------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment