Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch 'develop' into master #13

Merged
merged 6 commits into from
May 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
language: cpp

env:
global:
HOME_DIR=${TRAVIS_BUILD_DIR}/..
ELASTIX_SOURCE_DIR=${TRAVIS_BUILD_DIR}
ELASTIX_BUILD_DIR=${HOME_DIR}/elastix-build
ITK_URL=https://github.com/InsightSoftwareConsortium/ITK
ITK_SOURCE_DIR=${HOME_DIR}/ITK-source
ITK_BUILD_DIR=${HOME_DIR}/ITK-build
OMP_NUM_THREADS=2

cache:
directories:
- ${ITK_SOURCE_DIR}
- ${ITK_BUILD_DIR}

matrix:
include:
- os: linux
dist: trusty
sudo: required
compiler: clang
- os: linux
dist: trusty
sudo: required
compiler: gcc
- os: osx
compiler: clang
- os: osx
compiler: gcc

before_script:
- mkdir -p ${ELASTIX_BUILD_DIR}

script:
- if [[ ! -e ${ITK_BUILD_DIR}/ITKConfig.cmake ]]; then
rm -rf ${ITK_SOURCE_DIR} {ITK_BUILD_DIR} &&
git clone ${ITK_URL} ${ITK_SOURCE_DIR} &&
cd ${ITK_SOURCE_DIR} &&
git checkout v4.11.1 &&
mkdir -p ${ITK_BUILD_DIR} &&
cd ${ITK_BUILD_DIR} &&
cmake -DBUILD_EXAMPLES=OFF -DITK_BUILD_DEFAULT_MODULES:BOOL=OFF -DITKGroup_IO:BOOL=ON -DModule_ITKDistanceMap:BOOL=ON -DModule_ITKImageFusion:BOOL=ON -DModule_ITKLabelMap:BOOL:=ON -DModule_ITKMathematicalMorphology:BOOL=ON -DModule_ITKOptimizers:BOOL=ON -DModule_ITKOptimizersv4:BOOL=ON -DModule_ITKRegistrationCommon:BOOL=ON -DModule_ITKVideoIO:BOOL=ON-DCMAKE_BUILD_TYPE=Release ${ITK_SOURCE_DIR} &&
make --jobs=4 &&
touch ${HOME}/built_cache; fi
- if [[ ! -e ${HOME_DIR}/built_cache ]]; then
cd ${ELASTIX_BUILD_DIR} &&
cmake -DITK_DIR=${ITK_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release ${ELASTIX_SOURCE_DIR} &&
make --jobs=4 &&
ctest --jobs=4; fi
1 change: 1 addition & 0 deletions src/Common/CostFunctions/itkAdvancedImageToImageMetric.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ AdvancedImageToImageMetric< TFixedImage, TMovingImage >

/** Threading related variables. */
this->m_UseMetricSingleThreaded = true;
this->m_UseMultiThread = false;
this->m_Threader->SetUseThreadPool( false ); // setting to true makes elastix hang
// at a WaitForSingleMethodThread()

Expand Down
7 changes: 7 additions & 0 deletions src/Common/itkImageMaskSpatialObject2.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ ImageMaskSpatialObject2< TDimension >
ImagePointer image = this->GetImage();
PixelType outsideValue = NumericTraits< PixelType >::Zero;

// Initialize index and size in case image only consists of background values.
for( unsigned int axis = 0; axis < ImageType::ImageDimension; ++axis )
{
index[ axis ] = 0;
size[ axis ] = 0;
}

/** For 3D a smart implementation existed in the ITK already. */
if( ImageType::ImageDimension == 3 )
{
Expand Down
8 changes: 5 additions & 3 deletions src/Core/Main/elastixlib.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ namespace elastix

ELASTIX::ELASTIX() :
m_ResultImage( 0 )
{} // end Constructor
{
} // end Constructor


/**
Expand Down Expand Up @@ -135,7 +136,8 @@ ELASTIX::RegisterImages(
bool performLogging,
bool performCout,
ImagePointer fixedMask,
ImagePointer movingMask )
ImagePointer movingMask,
ObjectPointer transform)
{
/** Some typedef's. */
typedef elx::ElastixMain ElastixMainType;
Expand All @@ -159,7 +161,7 @@ ELASTIX::RegisterImages(
/** Some declarations and initialisations. */
ElastixMainVectorType elastices;

ObjectPointer transform = 0;
//ObjectPointer transform = 0;
DataObjectContainerPointer fixedImageContainer = 0;
DataObjectContainerPointer movingImageContainer = 0;
DataObjectContainerPointer fixedMaskContainer = 0;
Expand Down
8 changes: 7 additions & 1 deletion src/Core/Main/elastixlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <itkDataObject.h>
#include "itkParameterFileParser.h"
#include "elxMacro.h"
#include "elxElastixMain.h"


/********************************************************************************
* *
Expand All @@ -47,6 +49,9 @@ class ELASTIXLIB_API ELASTIX
typedef itk::ParameterFileParser::ParameterMapType ParameterMapType;
typedef std::vector< itk::ParameterFileParser::ParameterMapType > ParameterMapListType;

//typedefs for ObjectPointer
typedef elastix::ElastixMain::ObjectPointer ObjectPointer;

/**
* Constructor and destructor
*/
Expand Down Expand Up @@ -94,7 +99,8 @@ class ELASTIXLIB_API ELASTIX
bool performLogging,
bool performCout,
ImagePointer fixedMask = 0,
ImagePointer movingMask = 0 );
ImagePointer movingMask = 0,
ObjectPointer transform = 0);

/** Getter for result image. */
ImagePointer GetResultImage( void );
Expand Down