Commit 981934f9 authored by hjohnson's avatar hjohnson
Browse files

COMP: Syncronized with BRAINS3 build suite so that maintenance will be...

COMP:  Syncronized with BRAINS3 build suite so that maintenance will be easier.  STYLE:  Improved command line documentation in Slicer3.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@12944 3bd1e089-480b-0410-8dfb-8563597acbee
parent 13d5fdb5
......@@ -38,7 +38,6 @@ include(${BRAINS_CMAKE_HELPER_DIR}/IJMacros.txt)
###
configure_file(${BRAINSDemonWarp_SOURCE_DIR}/CTestCustom.ctest ${BRAINSDemonWarp_BINARY_DIR}/CTestCustom.ctest COPYONLY)
#add_subdirectory(Example)
include(${BRAINS_CMAKE_HELPER_DIR}/CMakeBRAINS3BuildMacros.cmake)
###
......@@ -59,15 +58,7 @@ if(BRAINS_BUILD) ## ONLY BUILD FOR BACKWARDS COMPATIBILITY IN BRAINS ENVIRONMENT
endif(BRAINS_BUILD) ## ONLY BUILD FOR BACKWARDS COMPATIBILITY IN BRAINS ENVIRONMENT
### Add the Testing Subdirectory.
#add_subdirectory(TestingBRAINSDemonWarp)
if (Slicer3_SOURCE_DIR)
# install each target in the production area (where it would appear in an
# installation) and install each target in the developer area (for running
# from a build)
set(TARGETS
VBRAINSDemonWarp
BRAINSDemonWarp
)
slicer3_install_plugins(${TARGETS})
endif (Slicer3_SOURCE_DIR)
if(NOT Slicer3_SOURCE_DIR)
add_subdirectory(TestingBRAINSDemonWarp)
add_subdirectory(Example)
endif(NOT Slicer3_SOURCE_DIR)
<?xml version="1.0" encoding="utf-8" ?>
<executable>
<category>Registration</category>
<title>VectorBRAINSDemonWarpn</title>
<title>BRAINSVectorDemonWarping</title>
<description>
This program finds a deformation field to warp a moving image onto a fixed image. The images must be of the same signal kind, and contain an image of the same kind of object. This program uses the Thirion Demons warp software in ITK, the Insight Toolkit.
</description>
<version>0.1.0.$Revision: 1.4 $(alpha)</version>
<version>1.0</version>
<documentation-url></documentation-url>
<license>https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt </license>
<contributor>This tool was developed by Hans Johnson and Greg Harris.</contributor>
<contributor>This tool was developed by Hans Johnson, Greg Harris, and YongQaing Zhao.</contributor>
<parameters>
<label>Input Image Files</label>
......
......@@ -170,21 +170,6 @@
<default></default>
</image>
<image type="label">
<name>outputFixedVolumeROI</name>
<longflag>--outputFixedVolumeROI</longflag>
<label>Fixed Image Volume automatically found ROI</label>
<description>The ROI automatically found in fixed image.</description>
<channel>output</channel>
</image>
<image type="label">
<name>outputMovingVolumeROI</name>
<longflag>--outputMovingVolumeROI</longflag>
<label>Moving Image Volume automatically found ROI</label>
<description>The ROI automatically found in moving image.</description>
<channel>output</channel>
</image>
<string-enumeration>
<name>outputVolumePixelType</name>
......@@ -240,10 +225,26 @@
<element>ROI</element>
</string-enumeration>
<image type="label">
<name>outputFixedVolumeROI</name>
<longflag>--outputFixedVolumeROI</longflag>
<label>Output Fixed Mask (ROIAUTO only)</label>
<description>The ROI automatically found in fixed image.</description>
<channel>output</channel>
</image>
<image type="label">
<name>outputMovingVolumeROI</name>
<longflag>--outputMovingVolumeROI</longflag>
<label>Output Moving Mask (ROIAUTO only)</label>
<description>The ROI automatically found in moving image.</description>
<channel>output</channel>
</image>
<image type="label">
<name>fixedBinaryVolume</name>
<longflag>--fixedBinaryVolume</longflag>
<label>Fixed Mask</label>
<label>Input Fixed Mask (ROI only)</label>
<description>Fixed Image binary mask volume.</description>
<default></default>
<channel>input</channel>
......@@ -252,7 +253,7 @@
<image type="label">
<name>movingBinaryVolume</name>
<longflag>--movingBinaryVolume</longflag>
<label>Moving Mask</label>
<label>Input Moving Mask (ROI only)</label>
<description>Moving Image binary mask volume.</description>
<default></default>
<channel>input</channel>
......
......@@ -32,35 +32,20 @@ include(${BRAINSCommonLib_USE_FILE})
include(${BRAINS_CMAKE_HELPER_DIR}/CMakeBRAINS3BuildMacros.cmake)
#SETOPTIONALDEBUGIMAGEVIEWER()
# No need to add with nothing to compile. add_subdirectory(BRAINSFit_Common)
include(${BRAINS_CMAKE_HELPER_DIR}/IJMacros.txt)
###
set(ALLBRAINSFIT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/BRAINSFitPrimary.cxx)
add_library(BRAINSFITCOMMONLIB ${ALLBRAINSFIT_SOURCE} BRAINSFitPrimaryCLP.h)
target_link_libraries(BRAINSFITCOMMONLIB BRAINSCommonLib ITKIO ITKAlgorithms ${OPTIONAL_DEBUG_LINK_LIBRARIES})
set(CLP BRAINSFit)
set(${CLP}_SOURCE BRAINSFit.cxx )
CONFIGUREBRAINSORSLICERPROPERTIES(${CLP} BRAINSFitPrimary.xml "${${CLP}_SOURCE}" BRAINSFITCOMMONLIB)
target_link_libraries( ${CLP} BRAINSFITCOMMONLIB BRAINSCommonLib ITKIO ITKAlgorithms ${OPTIONAL_DEBUG_LINK_LIBRARIES})
#if(BUILD_TESTING)
# add_subdirectory(TestData)
#endif()
if (Slicer3_SOURCE_DIR)
# install each target in the production area (where it would appear in an
# installation) and install each target in the developer area (for running
# from a build)
set(TARGETS
BRAINSFit
BRAINSFITCOMMONLIB
)
slicer3_install_plugins(${TARGETS})
endif (Slicer3_SOURCE_DIR)
set(${CLP}_SOURCE BRAINSFit.cxx BRAINSFitPrimary.cxx)
CONFIGUREBRAINSORSLICERPROPERTIES(${CLP} BRAINSFitPrimary.xml "${${CLP}_SOURCE}" "")
target_link_libraries( ${CLP} BRAINSCommonLib ITKIO ITKAlgorithms ${OPTIONAL_DEBUG_LINK_LIBRARIES})
if(NOT Slicer3_SOURCE_DIR)
if(BUILD_TESTING)
add_subdirectory(TestData)
endif(BUILD_TESTING)
endif(NOT Slicer3_SOURCE_DIR)
include(InstallRequiredSystemLibraries)
......
scm svn
svnpath https://www.nitrc.org/svn/brainsroiauto/trunk
name BRAINSROIAuto
cmakeproject BRAINSROIAuto
svnusername slicerbot
svnpassword slicer
#
# list dependencies
# - these should be names of other modules that have .s3ext files
# - the dependencies will be built first
# homepage
homepage http://www.nitrc.org/projects/brainsroiauto/
# match category in the xml description of the module (where it shows up in Modules menu)
category Segmentation
# give people an idea what to expect from this code
# - is it just a test or something you stand beind?
status Development
# One line description of what the module does
description BRAINSROIAuto is a tool that helps to identify the bask of the head.
......@@ -22,14 +22,14 @@
<image type="label">
<name>outputROIMaskVolume</name>
<longflag>--outputROIMaskVolume</longflag>
<label>Output Volume</label>
<description>The ROI automatically found in the input image.</description>
<label>Output Mask</label>
<description>The ROI automatically found from the input image.</description>
<channel>output</channel>
</image>
<image>
<name>outputClippedVolumeROI</name>
<longflag>--outputClippedVolumeROI</longflag>
<label>Moving Image Volume automatically found ROI</label>
<label>Output Image Clipped by ROI</label>
<description>The inputVolume clipped to the region of the brain mask.</description>
<channel>output</channel>
</image>
......
#include <itkImage.h>
#include <itkImageRegionIterator.h>
#include "itkIO.h"
int
main(int argc, char **argv)
{
typedef itk::Image<char,3> ImageType;
typedef itk::ImageRegionIterator<ImageType> IteratorType;
if(argc != 3)
{
std::cerr << "Missing filename arguments" << std::endl;
return -1;
}
std::string file1(argv[1]);
std::string file2(argv[2]);
ImageType::Pointer im1(itkUtil::ReadImage<ImageType>(file1)),
im2(itkUtil::ReadImage<ImageType>(file2));
double totpixels(0);
double samepixels(0);
double setPixels1(0);
double setPixels2(0);
for(IteratorType it1(im1,im1->GetLargestPossibleRegion()),
it2(im2,im2->GetLargestPossibleRegion());
!it1.IsAtEnd() && !it2.IsAtEnd(); ++it1, ++it2,totpixels++)
{
if(it1.Value() != 0)
{
setPixels1++;
}
if(it2.Value() != 0)
{
setPixels2++;
}
if(it1.Value() == it2.Value())
{
samepixels++;
}
}
double voldiff = fabs(setPixels1-setPixels2) /
((setPixels1 + setPixels2)/2.0);
double limit = samepixels/totpixels;
std::cerr
<< (totpixels - samepixels)
<< " out of "
<< totpixels
<< " differ."
<< std::endl
<< file1 << " volume is "
<< setPixels1 << std::endl
<< file2 << " volume is "
<< setPixels2 << std::endl
<< "Pixel match "
<< (limit * 100)
<< "%" << std::endl
<< "Volume difference is "
<< (voldiff*100)
<< "%" << std::endl;
if(limit < 0.93 || voldiff > 0.04)
{
return 1;
}
return 0;
}
......@@ -41,45 +41,8 @@ set(${CLP}_SOURCE BRAINSROIAuto.cxx )
CONFIGUREBRAINSORSLICERPROPERTIES(${CLP} BRAINSROIAuto.xml "${${CLP}_SOURCE}" "")
target_link_libraries( ${CLP} BRAINSCommonLib ITKIO ITKAlgorithms ${OPTIONAL_DEBUG_LINK_LIBRARIES})
if (Slicer3_SOURCE_DIR)
# install each target in the production area (where it would appear in an
# installation) and install each target in the developer area (for running
# from a build)
set(TARGETS
BRAINSROIAuto
)
slicer3_install_plugins(${TARGETS})
endif (Slicer3_SOURCE_DIR)
if(BRAINS_BUILD)
set(TESTING_BINARY_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
else(BRAINS_BUILD)
set(TESTING_BINARY_DIR ${BRAINSROIAuto_BINARY_DIR}/bin)
endif(BRAINS_BUILD)
add_executable(BRATestImage TestImage.cxx)
target_link_libraries(BRATestImage
${ITK_LIBRARIES}
)
set_target_properties(BRATestImage PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BRAINSROIAuto_BINARY_DIR})
add_executable(BRATestCompare BRATestCompare.cxx)
target_link_libraries(BRATestCompare
${ITK_LIBRARIES}
)
set_target_properties(BRATestCompare PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BRAINSROIAuto_BINARY_DIR})
add_test(BRATestImage BRATestImage
${BRAINSROIAuto_BINARY_DIR}/sphere.nii.gz
${BRAINSROIAuto_BINARY_DIR}eneratedMaskSphere.nii.gz
)
add_test(RunBRAINSROIAuto ${TESTING_BINARY_DIR}/BRAINSROIAuto
--inputVolume ${BRAINSROIAuto_BINARY_DIR}/sphere.nii.gz
--outputClippedVolumeROI ${BRAINSROIAuto_BINARY_DIR}/clippedSphere.nii.gz
--outputROIMaskVolume ${BRAINSROIAuto_BINARY_DIR}/maskSphere.nii.gz)
add_test(CompareMasks BRATestCompare
${BRAINSROIAuto_BINARY_DIR}eneratedMaskSphere.nii.gz
${BRAINSROIAuto_BINARY_DIR}/maskSphere.nii.gz)
if(BUILD_TESTING)
if(NOT Slicer3_SOURCE_DIR)
add_subdirectory(Testing)
endif(NOT Slicer3_SOURCE_DIR)
endif(BUILD_TESTING)
#include <itkIO.h>
#include <itkSphereSpatialFunction.h>
#include <itkImageRegionIterator.h>
#include <vnl/vnl_random.h>
#if !defined(_WIN32)
#include <unistd.h>
#else
#include <process.h>
inline int getpid()
{
return _getpid();
}
#endif
unsigned int imageDim(32);
int main( int, char * argv[] )
{
typedef itk::Image<unsigned char,3> ImageType;
ImageType::RegionType region;
ImageType::RegionType::IndexType index;
index[0] = index[1] = index[2] = 0;
region.SetIndex(index);
ImageType::RegionType::SizeType size;
size[0] = imageDim;
size[1] = imageDim;
size[2] = imageDim;
region.SetSize(size);
ImageType::SpacingType spacing;
spacing[0] =
spacing[1] =
spacing[2] = 1.0;
ImageType::Pointer theImage = ImageType::New();
theImage->SetRegions(region);
theImage->SetSpacing(spacing);
ImageType::Pointer theMaskImage = ImageType::New();
theMaskImage->SetRegions(region);
theMaskImage->SetSpacing(spacing);
ImageType::PointType origin;
origin[0] =
origin[1] =
origin[2] = 0.0;
ImageType::DirectionType direction;
for(unsigned i = 0; i < 3; i++)
{
for(unsigned j = 0; j < 3; j++)
{
direction[i][j] = i == j ? 1.0 : 0.0;
}
}
theImage->SetDirection(direction);
theImage->SetOrigin(origin);
theMaskImage->SetDirection(direction);
theMaskImage->SetOrigin(origin);
vnl_random randgen;
randgen.reseed(getpid());
//
// theImage->FillBuffer(0);
// fill buffer with low level noise
itk::ImageRegionIterator<ImageType>
it(theImage,theImage->GetLargestPossibleRegion());
for(it.GoToBegin(); !it.IsAtEnd(); ++it)
{
it.Set(static_cast<ImageType::PixelType>(randgen.lrand32(16)));
}
theMaskImage->FillBuffer(0);
typedef itk::Point<double,3> PointType;
typedef itk::SphereSpatialFunction<3,PointType> SphereFunctionType;
PointType pt;
SphereFunctionType::Pointer sphereFunc = SphereFunctionType::New();
sphereFunc->SetRadius(static_cast<double>(imageDim)/4.0);
pt[0] = pt[1] = pt[2] = static_cast<double>(imageDim)/2.0;
sphereFunc->SetCenter(pt);
for(unsigned i = 0; i < imageDim; i++)
{
index[0] = i;
pt[0] = static_cast<double>(i);
for(unsigned j = 0; j < imageDim; j++)
{
index[1] = j;
pt[1] = static_cast<double>(j);
for(unsigned k = 0; k < imageDim; k++)
{
pt[2] = static_cast<double>(k);
index[2] = k;
if(sphereFunc->Evaluate(pt))
{
theImage->SetPixel(index,
static_cast<ImageType::PixelType>
(randgen.lrand32(32,255)));
theMaskImage->SetPixel(index,255);
}
}
}
}
std::string filename(argv[1]);
itkUtil::WriteImage<ImageType>(theImage,filename);
std::string maskFilename(argv[2]);
itkUtil::WriteImage<ImageType>(theMaskImage,maskFilename);
exit(0);
}
......@@ -47,15 +47,6 @@ set(CLP BRAINSResample)
set(${CLP}_SOURCE BRAINSResample.cxx BRAINSResamplePrimary.cxx)
CONFIGUREBRAINSORSLICERPROPERTIES(${CLP} BRAINSResamplePrimary.xml "${${CLP}_SOURCE}" "")
if (Slicer3_SOURCE_DIR)
# install each target in the production area (where it would appear in an
# installation) and install each target in the developer area (for running
# from a build)
set(TARGETS
BRAINSResample
)
slicer3_install_plugins(${TARGETS})
endif (Slicer3_SOURCE_DIR)
if(BRAINS_BUILD) ## ONLY BUILD FOR BACKWARDS COMPATIBILITY IN BRAINS ENVIRONMENT
set(CLP BRAINSResampleCLP) ## NOTE: This is completely redundant, but is needed to support all the old scripts that use the original name
......@@ -65,4 +56,8 @@ if(BRAINS_BUILD) ## ONLY BUILD FOR BACKWARDS COMPATIBILITY IN BRAINS ENVIRONMENT
endif(BRAINS_BUILD) ## ONLY BUILD FOR BACKWARDS COMPATIBILITY IN BRAINS ENVIRONMENT
### Add the Testing Subdirectory.
#add_subdirectory(TestingBRAINSResample)
if(BUILD_TESTING)
if(NOT Slicer3_SOURCE_DIR)
add_subdirectory(TestingBRAINSResample)
endif(NOT Slicer3_SOURCE_DIR)
endif(BUILD_TESTING)
......@@ -46,79 +46,6 @@ if { [catch \"close \$fp\" res] } {
DESTINATION bin/Modules PERMISSIONS WORLD_EXECUTE)
endmacro(BRAINSGENERATEMODULESCRIPT)
## A macro to create executables for Slicer or BRAINS3
if(NOT CONFIGUREBRAINSORSLICERPROPERTIES)
macro(CONFIGUREBRAINSORSLICERPROPERTIES PROGNAME PROGCLI PROGSOURCES EXTRA_LIBS)
find_package(GenerateCLP NO_MODULE REQUIRED)
include(${GenerateCLP_USE_FILE})
get_filename_component(TMP_FILENAME ${PROGCLI} NAME_WE)
set(PROGCLI_HEADER "${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h")
set(CLP_SOURCES ${PROGSOURCES})
if(EXISTS ${BRAINS_CMAKE_HELPER_DIR}/BRAINSLogo.h)
GENERATECLP(CLP_SOURCES ${PROGCLI} ${BRAINS_CMAKE_HELPER_DIR}/BRAINSLogo.h)
else()
GENERATECLP(CLP_SOURCES ${PROGCLI} )
endif()
ADD_EXECUTABLE( ${PROGNAME} ${CLP_SOURCES} ${PROGCLI_HEADER})
target_link_libraries (${PROGNAME} BRAINSCommonLib ITKAlgorithms ITKIO ITKBasicFilters ${OPTIONAL_DEBUG_LINK_LIBRARIES} ${EXTRA_LIBS} )
if (Slicer3_SOURCE_DIR)
slicer3_set_plugins_output_path(${PROGNAME})
add_library(${PROGNAME}Lib SHARED ${CLP_SOURCES} ${PROGCLI_HEADER})
slicer3_set_plugins_output_path(${PROGNAME}Lib)
set_target_properties (${PROGNAME}Lib PROPERTIES COMPILE_FLAGS "-Dmain=ModuleEntryPoint")
target_link_libraries (${PROGNAME}Lib BRAINSCommonLib ITKAlgorithms ITKIO ITKBasicFilters ${OPTIONAL_DEBUG_LINK_LIBRARIES} ${EXTRA_LIBS} )
set(TARGETS ${PROGNAME}Lib ${PROGNAME})
slicer3_install_plugins(${TARGETS})
else (Slicer3_SOURCE_DIR)
IF(BRAINS_BUILD)
BRAINSGENERATEMODULESCRIPT(${PROGNAME})
ENDIF(BRAINS_BUILD)
INSTALL(TARGETS ${PROGNAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
endif (Slicer3_SOURCE_DIR)
endmacro(CONFIGUREBRAINSORSLICERPROPERTIES PROGNAME PROGCLI PROGSOURCES)
endif(NOT CONFIGUREBRAINSORSLICERPROPERTIES)
if(0)
#-----------------------------------------------------------------------------
# Get and build BRAINSCommonLib
if(NOT FINDORBUILD_COMMON_BRAINSCOMMONLIB)
macro(FINDORBUILD_COMMON_BRAINSCOMMONLIB)
IF(NOT COMMON_BRAINSCOMMONLIB_BINARY_DIR)
set(proj BRAINSCommonLibExternal)
ExternalProject_Add(${proj}
SVN_REPOSITORY "https://www.nitrc.org/svn/brains/BRAINSCommonLib/trunk"
SOURCE_DIR BRAINSCommonLib
BINARY_DIR BRAINSCommonLib-build
CMAKE_GENERATOR ${gen}
CMAKE_ARGS
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_EXAMPLES:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-DBUILD_TESTING:BOOL=${BUILD_TESTING}
-DCMAKE_SKIP_RPATH:BOOL=ON
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-DITK_DIR:PATH=${ITK_DIR}
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
)
SET(COMMON_BRAINSCOMMONLIB_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/BRAINSCommonLib)
SET(COMMON_BRAINSCOMMONLIB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/BRAINSCommonLib-build)
ENDIF(NOT COMMON_BRAINSCOMMONLIB_BINARY_DIR)
endmacro(FINDORBUILD_COMMON_BRAINSCOMMONLIB)
endif(NOT FINDORBUILD_COMMON_BRAINSCOMMONLIB)
endif(0)
#-----------------------------------------------------------------------------
# Build the optional DEBUGIMAGEVIEWER
......@@ -145,3 +72,58 @@ endif( USE_DEBUG_IMAGE_VIEWER )
endmacro(SETOPTIONALDEBUGIMAGEVIEWER)
endif(NOT SETOPTIONALDEBUGIMAGEVIEWER)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
## A macro to create executables for Slicer or BRAINS3
if(NOT CONFIGUREBRAINSORSLICERPROPERTIES)
macro(CONFIGUREBRAINSORSLICERPROPERTIES PROGNAME PROGCLI PROGSOURCES EXTRA_LIBS)
find_package(GenerateCLP NO_MODULE REQUIRED)
include(${GenerateCLP_USE_FILE})
get_filename_component(TMP_FILENAME ${PROGCLI} NAME_WE)
set(PROGCLI_HEADER "${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h")
set(CLP_SOURCES ${PROGSOURCES})
if(EXISTS ${BRAINS_CMAKE_HELPER_DIR}/BRAINSLogo.h)
GENERATECLP(CLP_SOURCES ${PROGCLI} ${BRAINS_CMAKE_HELPER_DIR}/BRAINSLogo.h)
else()
GENERATECLP(CLP_SOURCES ${PROGCLI} )
endif()
add_executable( ${PROGNAME} ${CLP_SOURCES} ${PROGCLI_HEADER})
target_link_libraries (${PROGNAME} BRAINSCommonLib ITKAlgorithms ITKIO ITKBasicFilters ${OPTIONAL_DEBUG_LINK_LIBRARIES} ${EXTRA_LIBS} )
if (Slicer3_SOURCE_DIR)
### If building as part of the Slicer3_SOURCE_DIR, then only build the shared object, and not the command line program.
add_library(${PROGNAME}Lib SHARED ${CLP_SOURCES} ${PROGCLI_HEADER})
set_target_properties (${PROGNAME}Lib PROPERTIES COMPILE_FLAGS "-Dmain=ModuleEntryPoint")
slicer3_set_plugins_output_path(${PROGNAME}Lib)
target_link_libraries (${PROGNAME}Lib BRAINSCommonLib ITKAlgorithms ITKIO ITKBasicFilters ${OPTIONAL_DEBUG_LINK_LIBRARIES} ${EXTRA_LIBS} )
# install each target in the production area (where it would appear in an
# installation) and install each target in the developer area (for running
# from a build)
slicer3_set_plugins_output_path(${PROGNAME})
set(TARGETS ${PROGNAME}Lib ${PROGNAME})
slicer3_install_plugins(${TARGETS})
else (Slicer3_SOURCE_DIR)
### If building outside of Slicer3, then only build the command line executable.
IF(BRAINS_BUILD)
BRAINSGENERATEMODULESCRIPT(${PROGNAME})
ENDIF(BRAINS_BUILD)
INSTALL(TARGETS ${PROGNAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
endif (Slicer3_SOURCE_DIR)
endmacro(CONFIGUREBRAINSORSLICERPROPERTIES PROGNAME PROGCLI PROGSOURCES)
endif(NOT CONFIGUREBRAINSORSLICERPROPERTIES)