Skip to content

Commit

Permalink
ENH: Update ITK/ANTS/BRAINSFitSyn to follow new multi-metric API.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmjohnson committed Nov 30, 2012
1 parent bc6a350 commit fd55ae6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
22 changes: 16 additions & 6 deletions BRAINSCommonLib/BRAINSFitSyN.h
Expand Up @@ -10,10 +10,11 @@ typedef SyNRegistrationHelperType::CompositeTransformType CompositeTransformTyp

template <class FixedImageType, class MovingimageType>
typename CompositeTransformType::Pointer
simpleSynReg( typename FixedImageType::Pointer & fixedImage,
typename MovingimageType::Pointer & movingImage,
simpleSynReg( typename FixedImageType::Pointer & infixedImage,
typename MovingimageType::Pointer & inmovingImage,
typename CompositeTransformType::Pointer compositeInitialTransform )
{

typename SyNRegistrationHelperType::Pointer regHelper = SyNRegistrationHelperType::New();
{
const float lowerQuantile = 0.0;
Expand Down Expand Up @@ -85,13 +86,22 @@ simpleSynReg( typename FixedImageType::Pointer & fixedImage,
const std::string whichMetric = "cc";
typename SyNRegistrationHelperType::MetricEnumeration curMetric = regHelper->StringToMetricType(whichMetric);
const double weighting = 1.0;
typename SyNRegistrationHelperType::SamplingStrategy samplingStrategy = SyNRegistrationHelperType::none; // none
const unsigned int bins = 32; // bins
typename SyNRegistrationHelperType::SamplingStrategy samplingStrategy = SyNRegistrationHelperType::none;
const int bins = 32;
const unsigned int radius = 4;
const double samplingPercentage = 1.0;

regHelper->AddMetric(curMetric, fixedImage, movingImage, weighting, samplingStrategy, bins, radius,
samplingPercentage);
const unsigned int stageID=0;
typename itk::CastImageFilter<FixedImageType,ImageType>::Pointer fixedCaster=itk::CastImageFilter<FixedImageType,ImageType>::New();
fixedCaster->SetInput( infixedImage );
fixedCaster->Update();
typename ImageType::Pointer dblFixedImage=fixedCaster->GetOutput();
typename itk::CastImageFilter<MovingimageType,ImageType>::Pointer movingCaster=itk::CastImageFilter<FixedImageType,ImageType>::New();
movingCaster->SetInput( inmovingImage );
movingCaster->Update();
typename ImageType::Pointer dblMovingImage=movingCaster->GetOutput();
regHelper->AddMetric(curMetric, dblFixedImage, dblMovingImage, stageID, weighting, samplingStrategy, bins, radius,
samplingPercentage);
}
{
// --transform "SyN[0.33,3.0,0.0]"
Expand Down
2 changes: 1 addition & 1 deletion SuperBuild/External_ANTS.cmake
Expand Up @@ -7,7 +7,7 @@ set(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED 1)

set(proj ANTS)
set(${proj}_GIT_REPOSITORY "git://github.com/BRAINSia/ANTS.git")
set(${proj}_GIT_TAG "da474e7a3628a293b94b0558820e734dedc60c07")
set(${proj}_GIT_TAG "920b729ebcb0d149364224d5b54df7b34a21137d")

set(${proj}_DEPENDENCIES ${ITK_EXTERNAL_NAME} SlicerExecutionModel)

Expand Down
2 changes: 1 addition & 1 deletion SuperBuild/External_ITKv4.cmake
Expand Up @@ -79,7 +79,7 @@ if(NOT DEFINED ${extProjName}_DIR AND NOT ${USE_SYSTEM_${extProjName}})
)
### --- End Project specific additions
set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
set(${proj}_GIT_TAG 1b8e751f199db7c5bbbe3503c5a7c2be455eb57a) #2012-11-07 NRRD install
set(${proj}_GIT_TAG ff3a73976588b3a277b9d596de047e0ae5fcbe01) #2012-11-30 NRRD install
ExternalProject_Add(${proj}
GIT_REPOSITORY ${${proj}_REPOSITORY}
GIT_TAG ${${proj}_GIT_TAG}
Expand Down

0 comments on commit fd55ae6

Please sign in to comment.