Commit b08af252 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

ITK: update ITK to 3.16.0 with otb patches

parent e03626ee
......@@ -111,7 +111,6 @@ BUILD_EXAMPLES:BOOL=@BUILD_EXAMPLES@
ITK_USE_PATENTED:BOOL=@ITK_USE_PATENTED@
ITK_USE_REVIEW:BOOL=@ITK_USE_REVIEW@
ITK_USE_REVIEW_STATISTICS:BOOL=@ITK_USE_REVIEW_STATISTICS@
ITK_USE_PORTABLE_ROUND:BOOL=@ITK_USE_PORTABLE_ROUND@
ITK_USE_REGION_VALIDATION_IN_ITERATORS:BOOL=@ITK_USE_REGION_VALIDATION_IN_ITERATORS@
ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY:BOOL=@ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY@
ITK_USE_CONCEPT_CHECKING:BOOL=@ITK_USE_CONCEPT_CHECKING@
......
......@@ -47,7 +47,7 @@ ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" MATCHES "^2\\.4$")
#-----------------------------------------------------------------------------
# ITK version number. An even minor number corresponds to releases.
SET(ITK_VERSION_MAJOR "3")
SET(ITK_VERSION_MINOR "14")
SET(ITK_VERSION_MINOR "16")
SET(ITK_VERSION_PATCH "0")
# Version string should not include patch level. The major.minor is
......@@ -197,7 +197,7 @@ IF(ITK_USE_OPTIMIZED_REGISTRATION_METHODS)
MESSAGE(FATAL_ERROR "ITK_USE_REVIEW is currently OFF but it should be ON if you want to use the experimental optimized registration methods.")
ENDIF(NOT ITK_USE_REVIEW)
# Warn the user about the implications of turning optimized registration methods ON
SET(msg "Attention: You have chosen to enable the use of Optimizer Registration Methods.")
SET(msg "Attention: You have chosen to enable the use of Optimized Registration Methods.")
SET(msg "${msg} These methods add multi-threading capabilities to several image metrics")
SET(msg "${msg} as well as some Transforms and Interpolators. In order to take full advantage")
SET(msg "${msg} of these new features you will have to also add some new calls to these components.")
......@@ -261,21 +261,8 @@ MARK_AS_ADVANCED(ITK_USE_ORIENTED_IMAGE_DIRECTION)
#-----------------------------------------------------------------------------
# ITK turn on the correct usage of centered-pixel coordinates.
OPTION(ITK_USE_PORTABLE_ROUND "Turn on round implementation that works in multiple-platforms." OFF)
MARK_AS_ADVANCED(ITK_USE_PORTABLE_ROUND)
#-----------------------------------------------------------------------------
# ITK turn on the correct usage of centered-pixel coordinates.
OPTION(ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY "Turn on correct usage of centered-pixel coordinates." OFF)
OPTION(ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY "Turn on correct usage of centered-pixel coordinates." ON)
MARK_AS_ADVANCED(ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY)
IF(ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY)
MESSAGE("Attention: You enabled ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY This feature has not been fully tested and validated.")
IF(NOT ITK_USE_PORTABLE_ROUND)
MESSAGE(FATAL_ERROR "ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY is currently ON but ITK_USE_PORTABLE_ROUND is OFF, you should enable the portable round")
ENDIF(NOT ITK_USE_PORTABLE_ROUND)
ENDIF(ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY)
#-----------------------------------------------------------------------------
# ITK turn on the correct usage of centered-pixel coordinates.
......@@ -303,13 +290,41 @@ MARK_AS_ADVANCED(ITK_USE_DEPRECATED_LEVELSET_INTERPOLATION)
# ITK_INSTALL_NO_DOCUMENTATION - do not install documentation files
IF(NOT ITK_INSTALL_BIN_DIR)
# Solaris: unlike libraries, 64 bit executables should be installed in "bin${sun64}" only
# if the 32 version is installed in "bin/sparcv7" or "bin/i86", and a isaexec
# is copied in "bin" with the name of the executable, so the system can choose the best
# executable. If only a 32 or 64 bit version is available, the executable should go in
# bin. So it seems better to let the packagers deal with that.
# Ref: http://docs.sun.com/app/docs/doc/816-5138/dev-env-13?a=view
SET(ITK_INSTALL_BIN_DIR "/bin")
ENDIF(NOT ITK_INSTALL_BIN_DIR)
IF(NOT ITK_INSTALL_LIB_DIR)
# 64 bit libraries are not installed in the same directories on solaris
# Ref: http://docs.sun.com/app/docs/doc/816-5138/6mba6ua5m?a=view
SET(sun64 )
IF(CMAKE_SYSTEM MATCHES "SunOS.*" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
EXEC_PROGRAM("uname"
ARGS "-p"
OUTPUT_VARIABLE sunproc
)
IF("${sunproc}" STREQUAL "sparc")
SET(sun64 "/sparcv9")
ENDIF("${sunproc}" STREQUAL "sparc")
IF("${sunproc}" STREQUAL "i386")
SET(sun64 "/amd64")
ENDIF("${sunproc}" STREQUAL "i386")
IF("${sun64}" STREQUAL "")
# sun64 is not set - solaris has been ported to a new architecture?
MESSAGE("Warning: Unknown processor '${sunproc}'. The libraries may not be installed in the right place.")
ENDIF("${sun64}" STREQUAL "")
ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
# OTB Modifications
# SET(ITK_INSTALL_LIB_DIR "/lib/InsightToolkit")
SET(ITK_INSTALL_LIB_DIR "/lib/otb")
# SET(ITK_INSTALL_LIB_DIR "/lib/InsightToolkit${sun64}")
SET(ITK_INSTALL_LIB_DIR "/lib/otb${sun64}")
ENDIF(NOT ITK_INSTALL_LIB_DIR)
IF(NOT ITK_INSTALL_DATA_DIR)
......@@ -410,12 +425,30 @@ INCLUDE(${ITK_SOURCE_DIR}/Wrapping/itkWrapSetup.cmake)
IF(WIN32)
# Some libraries (e.g. vxl libs) have no dllexport markup, so we can
# build full shared libraries only with the GNU toolchain.
IF(CMAKE_COMPILER_IS_GNUCXX)
# CMake adds --enable-all-exports on Cygwin (since Cygwin is
# supposed to be UNIX-like), but we need to add it explicitly for
# a native windows build with the MinGW tools.
IF(MINGW)
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS
"-shared -Wl,--export-all-symbols -Wl,--enable-auto-import")
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS
"-shared -Wl,--export-all-symbols -Wl,--enable-auto-import")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-auto-import")
ENDIF(MINGW)
IF(CYGWIN)
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-auto-import")
ENDIF(CYGWIN)
ELSE(CMAKE_COMPILER_IS_GNUCXX)
IF(BUILD_SHARED_LIBS)
SET(ITK_COMMON_BUILD_TYPE "SHARED")
ELSE(BUILD_SHARED_LIBS)
SET(ITK_COMMON_BUILD_TYPE "STATIC")
ENDIF(BUILD_SHARED_LIBS)
SET(BUILD_SHARED_LIBS OFF)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(WIN32)
# OTB Modifications
......@@ -477,9 +510,9 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
SET(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -ftemplate-depth-50 -Wall")
INCLUDE(${ITK_SOURCE_DIR}/CMake/itkCheckCXXAcceptsFlags.cmake)
itkCHECK_CXX_ACCEPTS_FLAGS("-Wno-deprecated" CXX_HAS_DEPRECATED_FLAG)
IF(CXX_HAS_DEPRECATED_FLAG)
IF(CXX_HAS_DEPRECATED_FLAG)
SET(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -Wno-deprecated")
ENDIF(CXX_HAS_DEPRECATED_FLAG)
ENDIF(CXX_HAS_DEPRECATED_FLAG)
IF(APPLE)
# -no-cpp-precomp and -Wno-long-double were compiler flags present
# only in Apple's gcc and not in the FSF gcc. The flags are obsolete
......@@ -500,7 +533,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
MARK_AS_ADVANCED(ITK_USE_64BITS_APPLE_TRUNCATION_WARNING)
ENDIF(APPLE)
# gcc must have -msse2 option to enable sse2 support
IF(VNL_CONFIG_ENABLE_SSE2 OR VNL_CONFIG_ENABLE_SSE2_ROUNDING)
SET(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -msse2")
......@@ -519,6 +552,14 @@ IF(UNIX)
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(UNIX)
#
# This line is required for gcc 4.3.3, since ITK uses deprecated header files
# by default.
#
INCLUDE(TestForANSIStreamHeaders)
IF(BORLAND)
SET(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -w- -whid -waus -wpar")
SET(ITK_REQUIRED_C_FLAGS "${ITK_REQUIRED_C_FLAGS} -w- -whid -waus -wpar")
......@@ -736,6 +777,14 @@ FIND_PATH(ITK_OSIRIX_DATA_ROOT CEREBRIX
MARK_AS_ADVANCED(ITK_OSIRIX_DATA_ROOT)
#-----------------------------------------------------------------------------
# Configure the default ITK_VISIBLEHUMAN_DATA_ROOT for the location of Data from the Visible Human Project
# When this data is available, additional Examples are enabled.
FIND_PATH(ITK_VISIBLEHUMAN_DATA_ROOT Male/Fullcolor/fullbody
DOC "Directory with data taken from http://www.nlm.nih.gov/research/visible/getting_data.html")
MARK_AS_ADVANCED(ITK_VISIBLEHUMAN_DATA_ROOT)
#-----------------------------------------------------------------------------
# This flag is used in particular, to enable some tests that require large memory to run.
# This probably can be discovered at configuration time by CMake. (Check with CMake developers).
......@@ -865,3 +914,4 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
ENDIF("${COMP_OPTION}" STREQUAL "-ffloat-store")
ENDFOREACH(COMP_OPTION)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
set(CTEST_PROJECT_NAME "Insight")
set(CTEST_PROJECT_NAME "ITK")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
set(CTEST_DROP_METHOD "http")
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkBinaryMask3DMeshSource.h,v $
Language: C++
Date: $Date: 2009-04-23 03:53:34 $
Version: $Revision: 1.18 $
Date: $Date: 2009-06-28 19:17:37 $
Version: $Revision: 1.19 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -67,13 +67,7 @@ namespace itk
* \par INPUT
* The input should be a 3D binary image.
*
*
* */
#ifndef ITK_EXPLICIT_INSTANTIATION
//This is already explicitly defined when ITK_EXPLICIT_INSTANTIATION is used.
template class Image<unsigned short,3>;
#endif
*/
template <class TInputImage, class TOutputMesh>
class ITK_EXPORT BinaryMask3DMeshSource : public ImageToMeshFilter< TInputImage, TOutputMesh >
{
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkBioCellularAggregate.txx,v $
Language: C++
Date: $Date: 2008-02-01 13:10:27 $
Version: $Revision: 1.9 $
Date: $Date: 2009-06-14 19:55:37 $
Version: $Revision: 1.10 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -405,6 +405,7 @@ CellularAggregate<NSpaceDimension>
CellsConstIterator end = m_Mesh->GetPointData()->End();
PointType position;
position.Fill(0);
while( cellIt != end )
{
......@@ -442,6 +443,7 @@ CellularAggregate<NSpaceDimension>
BioCellType * cell1 = cell1It.Value();
PointType position1;
position1.Fill(0);
m_Mesh->GetPoint( cell1Id, &position1 );
const double rA = cell1->GetRadius();
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkCurvatureFlowFunction.txx,v $
Language: C++
Date: $Date: 2008-10-23 16:26:55 $
Version: $Revision: 1.19 $
Date: $Date: 2009-07-30 11:57:13 $
Version: $Revision: 1.20 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -84,9 +84,9 @@ CurvatureFlowFunction<TImage>
::ComputeUpdate(const NeighborhoodType &it, void * itkNotUsed(gd),
const FloatOffsetType& itkNotUsed(offset))
{
PixelType firstderiv[ImageDimension];
PixelType secderiv[ImageDimension];
PixelType crossderiv[ImageDimension][ImageDimension];
PixelRealType firstderiv[ImageDimension];
PixelRealType secderiv[ImageDimension];
PixelRealType crossderiv[ImageDimension][ImageDimension];
unsigned long center;
unsigned long stride[ImageDimension];
unsigned int i,j;
......@@ -102,7 +102,7 @@ CurvatureFlowFunction<TImage>
stride[i] = it.GetStride( (unsigned long) i );
}
PixelType magnitudeSqr = 0.0;
PixelRealType magnitudeSqr = 0.0;
for( i = 0; i < ImageDimension; i++ )
{
......@@ -136,8 +136,8 @@ CurvatureFlowFunction<TImage>
}
// compute the update value = mean curvature * magnitude
PixelType update = 0.0;
PixelType temp;
PixelRealType update = 0.0;
PixelRealType temp;
// accumulate dx^2 * (dyy + dzz) terms
for( i = 0; i < ImageDimension; i++ )
......@@ -170,7 +170,7 @@ CurvatureFlowFunction<TImage>
globalData->m_MaxChange =
vnl_math_max( globalData->m_MaxChange, vnl_math_abs(update) );
#endif
return update;
return static_cast<PixelType>(update);
}
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkCurvatureRegistrationFilter.txx,v $
Language: C++
Date: $Date: 2008-10-23 16:15:23 $
Version: $Revision: 1.5 $
Date: $Date: 2009-08-08 12:32:43 $
Version: $Revision: 1.6 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -215,6 +215,8 @@ void
CurvatureRegistrationFilter<TFixedImage,TMovingImage,TDeformationField,TImageForceFunction>
::ApplyUpdate(TimeStepType dt)
{
// unused dt parameter
(void) dt;
DeformationFieldPointer update = this->GetUpdateBuffer();
ImageRegionConstIterator<DeformationFieldType> itInDeformation;
......@@ -247,9 +249,9 @@ CurvatureRegistrationFilter<TFixedImage,TMovingImage,TDeformationField,TImageFor
// extract l-th component of deformation field.
itInDeformation.GoToBegin();
itInUpdate.GoToBegin();
for ( size_t offset = 0; (offset < numberOfPixels) && !itInDeformation.IsAtEnd() && !itInUpdate.IsAtEnd(); ++offset )
for ( size_t offset1 = 0; (offset1 < numberOfPixels) && !itInDeformation.IsAtEnd() && !itInUpdate.IsAtEnd(); ++offset1 )
{
this->m_DeformationFieldComponentImage[offset] = this->m_TimeStep * itInUpdate.Value()[l] + itInDeformation.Value()[l];
this->m_DeformationFieldComponentImage[offset1] = this->m_TimeStep * itInUpdate.Value()[l] + itInDeformation.Value()[l];
++itInUpdate;
++itInDeformation;
}
......@@ -279,9 +281,9 @@ CurvatureRegistrationFilter<TFixedImage,TMovingImage,TDeformationField,TImageFor
// update deformation field
itOutDeformation.GoToBegin();
for ( size_t offset = 0; (offset < numberOfPixels) && ! itOutDeformation.IsAtEnd(); ++offset )
for ( size_t offset1 = 0; (offset1 < numberOfPixels) && ! itOutDeformation.IsAtEnd(); ++offset1 )
{
itOutDeformation.Value()[l] = this->m_DeformationFieldComponentImage[offset] * normFactorDCT;
itOutDeformation.Value()[l] = this->m_DeformationFieldComponentImage[offset1] * normFactorDCT;
++itOutDeformation;
}
}
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkDeformableSimplexMesh3DGradientConstraintForceFilter.h,v $
Language: C++
Date: $Date: 2009-05-12 17:26:20 $
Version: $Revision: 1.7 $
Date: $Date: 2009-08-16 13:33:47 $
Version: $Revision: 1.8 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -124,7 +124,8 @@ public:
typedef Image<float, 3> OriginalImageType;
typedef typename OriginalImageType::IndexType OriginalImageIndexType;
typedef typename OriginalImageIndexType::IndexValueType ImageIndexValueType;
typedef typename OriginalImageType::Pointer OriginalImagePointer;
typedef typename OriginalImageType::ConstPointer OriginalImagePointer;
/** control the range of search for Bresenham at normal line */
itkSetMacro(Range, int);
itkGetConstMacro(Range, int);
......@@ -143,7 +144,7 @@ public:
/**
* Set Original image
*/
itkSetMacro(Image, OriginalImagePointer);
itkSetConstObjectMacro( Image, OriginalImageType );
protected:
DeformableSimplexMesh3DGradientConstraintForceFilter();
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkFEMRegistrationFilter.txx,v $
Language: C++
Date: $Date: 2009-04-05 23:09:18 $
Version: $Revision: 1.58 $
Date: $Date: 2009-06-15 22:11:29 $
Version: $Revision: 1.59 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -1775,6 +1775,7 @@ void FEMRegistrationFilter<TMovingImage,TFixedImage>::MultiResSolve()
SolverType SSS;
typename FixedImageType::SizeType nextLevelSize;
nextLevelSize.Fill( 0 );
typename FixedImageType::SizeType lastLevelSize;
if (m_Maxiters[m_CurrentLevel] > 0)
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkFastMarchingUpwindGradientImageFilter.h,v $
Language: C++
Date: $Date: 2007-04-20 11:52:27 $
Version: $Revision: 1.7 $
Date: $Date: 2009-07-29 10:31:53 $
Version: $Revision: 1.8 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -164,7 +164,10 @@ public:
/** Get the number of targets. */
itkGetConstReferenceMacro( NumberOfTargets, long );
/** Get the arrival time corresponding to the last reached target. */
/** Get the arrival time corresponding to the last reached target.
* If TargetReachedMode is set to NoTargets, TargetValue contains
* the last (aka largest) Eikonal solution value generated.
*/
itkGetConstReferenceMacro( TargetValue, double );
enum
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkFastMarchingUpwindGradientImageFilter.txx,v $
Language: C++
Date: $Date: 2007-04-25 15:59:57 $
Version: $Revision: 1.10 $
Date: $Date: 2009-07-29 10:31:53 $
Version: $Revision: 1.11 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -235,6 +235,10 @@ FastMarchingUpwindGradientImageFilter<TLevelSet,TSpeedImage>
}
}
}
else
{
m_TargetValue = static_cast<double>(output->GetPixel(index));
}
}
/**
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkImageKmeansModelEstimator.txx,v $
Language: C++
Date: $Date: 2009-05-02 05:43:54 $
Version: $Revision: 1.14 $
Date: $Date: 2009-09-03 21:11:20 $
Version: $Revision: 1.15 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -559,14 +559,14 @@ ImageKmeansModelEstimator<TInputImage, TMembershipFunction>
// normalize the distortions
*distortion /= ( double ) totalNumVecsInInput;
delete [] tempVec;
// check for bizarre errors
if ( *distortion < 0.0 )
{
itkExceptionMacro(<<"Computational overflow");
}
delete [] tempVec;
}// End nearest_neighbor_search_basic
//-----------------------------------------------------------------
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkImageToImageMetric.h,v $
Language: C++
Date: $Date: 2007-11-12 20:00:37 $
Version: $Revision: 1.25 $
Date: $Date: 2009-08-20 09:08:41 $
Version: $Revision: 1.26 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -131,13 +131,16 @@ public:
this mask will be considered for the computation of the metric */
typedef SpatialObject< itkGetStaticConstMacro(FixedImageDimension) >
FixedImageMaskType;
typedef typename FixedImageMaskType::Pointer FixedImageMaskPointer;
typedef typename FixedImageMaskType::Pointer FixedImageMaskPointer;
typedef typename FixedImageMaskType::ConstPointer FixedImageMaskConstPointer;
/** Type for the mask of the moving image. Only pixels that are "inside"
this mask will be considered for the computation of the metric */
typedef SpatialObject< itkGetStaticConstMacro(MovingImageDimension) >
MovingImageMaskType;
typedef typename MovingImageMaskType::Pointer MovingImageMaskPointer;
typedef typename MovingImageMaskType::Pointer MovingImageMaskPointer;
typedef typename MovingImageMaskType::ConstPointer MovingImageMaskConstPointer;
/** Type of the measure. */
......@@ -184,10 +187,22 @@ public:
/** Set/Get the moving image mask. */
itkSetObjectMacro( MovingImageMask, MovingImageMaskType );
#ifdef ITK_LEGACY_REMOVE
itkSetConstObjectMacro( MovingImageMask, MovingImageMaskType );
#else
virtual void SetMovingImageMask( const MovingImageMaskType* mask )
{ this->SetMovingImageMask(const_cast<MovingImageMaskType*>(mask)); }
#endif
itkGetConstObjectMacro( MovingImageMask, MovingImageMaskType );
/** Set/Get the fixed image mask. */
itkSetObjectMacro( FixedImageMask, FixedImageMaskType );
#ifdef ITK_LEGACY_REMOVE
itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
#else
virtual void SetFixedImageMask( const FixedImageMaskType* mask )
{ this->SetFixedImageMask(const_cast<FixedImageMaskType*>(mask)); }
#endif
itkGetConstObjectMacro( FixedImageMask, FixedImageMaskType );
/** Set/Get gradient computation. */
......@@ -228,8 +243,13 @@ protected:
bool m_ComputeGradient;
GradientImagePointer m_GradientImage;
#ifdef ITK_LEGACY_REMOVE
FixedImageMaskConstPointer m_FixedImageMask;
MovingImageMaskConstPointer m_MovingImageMask;
#else
mutable FixedImageMaskPointer m_FixedImageMask;
mutable MovingImageMaskPointer m_MovingImageMask;
#endif
private:
ImageToImageMetric(const Self&); //purposely not implemented
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkLevelSetMotionRegistrationFilter.h,v $
Language: C++
Date: $Date: 2009-01-24 20:02:58 $
Version: $Revision: 1.4 $
Date: $Date: 2009-06-14 12:30:08 $
Version: $Revision: 1.5 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -77,7 +77,7 @@ namespace itk {
* \warning This filter assumes that the fixed image type, moving image type
* and deformation field type all have the same number of dimensions.
*
* \cite B.C. Vemuri, J. Ye, Y. Chen, C.M. Leonard. "Image
* Ref: B.C. Vemuri, J. Ye, Y. Chen, C.M. Leonard. "Image
* registration via level-set motion: applications to atlas-based
* segmentation". Medical Image Analysis. Vol. 7. pp. 1-20. 2003.
*
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkMRFImageFilter.txx,v $
Language: C++
Date: $Date: 2009-05-26 23:45:01 $
Version: $Revision: 1.67 $
Date: $Date: 2009-06-16 07:58:47 $
Version: $Revision: 1.68 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -456,15 +456,9 @@ MRFImageFilter<TInputImage, TClassifiedImage>
totalNumberOfPixelsInInputImage *= static_cast<int>(inputImageSize[ i ]);
}
#ifdef ITK_USE_PORTABLE_ROUND
int maxNumPixelError =
static_cast<int>( Math::Round( m_ErrorTolerance *
m_TotalNumberOfValidPixelsInOutputImage) );
#else
int maxNumPixelError =
static_cast<int> ( vnl_math_rnd (m_ErrorTolerance *
m_TotalNumberOfValidPixelsInOutputImage) );
#endif
m_NumberOfIterations = 0;
do
......
......@@ -3,8 +3,8 @@
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkMattesMutualInformationImageToImageMetric.txx,v $
Language: C++
Date: $Date: 2009-01-24 20:02:59 $
Version: $Revision: 1.61 $
Date: $Date: 2009-08-25 11:48:26 $
Version: $Revision: 1.63 $
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
......@@ -732,7 +732,7 @@ MattesMutualInformationImageToImageMetric<TFixedImage,TMovingImage>
sampleOk, movingImageValue );
++nFixedImageSamples;
if( sampleOk )
{
......@@ -807,17 +807,19 @@ MattesMutualInformationImageToImageMetric<TFixedImage,TMovingImage>
} //end if-block check sampleOk
} // end iterating over fixed image spatial sample container for loop
itkDebugMacro( "Ratio of voxels mapping into moving image buffer: "
<< nSamples << " / " << m_NumberOfSpatialSamples
itkDebugMacro( "Ratio of voxels mapping into moving image buffer: "
<< nSamples << " / " << m_NumberOfSpatialSamples
<< std::endl );
if( nSamples < m_NumberOfSpatialSamples / 4 )
if( nSamples < m_NumberOfSpatialSamples / 16 )
{
itkExceptionMacro( "Too many samples map outside moving image buffer: "
<< nSamples << " / " << m_NumberOfSpatialSamples
<< std::endl );
}
this->m_NumberOfPixelsCounted = nSamples;
/**
* Normalize the PDFs, compute moving image marginal PDF
......@@ -1003,9 +1005,10 @@ MattesMutualInformationImageToImageMetric<TFixedImage,TMovingImage>
bool sampleOk;
double movingImageValue;
this->TransformPoint( nFixedImageSamples, parameters, mappedPoint,
sampleOk, movingImageValue );
if( sampleOk )