Skip to content

Commit

Permalink
ENH: Decrease distance threshold.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntustison committed Jul 3, 2015
1 parent 44e60e6 commit 063291c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Examples/antsAI.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ typename TTransform::Pointer GetTransformFromFeatureMatching( typename TImage::P
unsigned int radiusValue = 20;
RealType gradientSigma = 1.0;
RealType maxRadiusDifferenceAllowed = 0.25;
RealType distancePreservationThreshold = 0.02;
RealType distancePreservationThreshold = 0.1;
RealType minimumNumberOfNeighborhoodNodes = 3;

RealType minScale = std::pow( 1.0, 1.0 );
Expand Down Expand Up @@ -855,6 +855,7 @@ int antsAI( itk::ants::CommandLineParser *parser )
}
else // RigidTransform or SimilarityTransform
{

typename LandmarkRigidTransformType::Pointer initialRigidTransform =
GetTransformFromFeatureMatching<ImageType, LandmarkRigidTransformType>( fixedImage, movingImage, numberOfBlobsToExtract, numberOfBlobsToMatch );

Expand Down Expand Up @@ -1007,20 +1008,23 @@ int antsAI( itk::ants::CommandLineParser *parser )
if( strcmp( transform.c_str(), "affine" ) == 0 )
{
typename AffineTransformType::Pointer bestAffineTransform = AffineTransformType::New();
bestAffineTransform->SetCenter( initialTransform->GetCenter() );
bestAffineTransform->SetMatrix( initialTransform->GetMatrix() );
bestAffineTransform->SetOffset( initialTransform->GetOffset() );
transformWriter->SetInput( bestAffineTransform );
}
else if( strcmp( transform.c_str(), "rigid" ) == 0 )
{
typename RigidTransformType::Pointer bestRigidTransform = RigidTransformType::New();
bestRigidTransform->SetCenter( initialTransform->GetCenter() );
bestRigidTransform->SetMatrix( initialTransform->GetMatrix() );
bestRigidTransform->SetOffset( initialTransform->GetOffset() );
transformWriter->SetInput( bestRigidTransform );
}
else if( strcmp( transform.c_str(), "similarity" ) == 0 )
{
typename SimilarityTransformType::Pointer bestSimilarityTransform = SimilarityTransformType::New();
bestSimilarityTransform->SetCenter( initialTransform->GetCenter() );
bestSimilarityTransform->SetMatrix( initialTransform->GetMatrix() );
bestSimilarityTransform->SetOffset( initialTransform->GetOffset() );
transformWriter->SetInput( bestSimilarityTransform );
Expand Down Expand Up @@ -1281,8 +1285,8 @@ int antsAI( itk::ants::CommandLineParser *parser )
{
affineSearchTransform->SetIdentity();
affineSearchTransform->SetCenter( initialTransform->GetCenter() );
affineSearchTransform->SetOffset( initialTransform->GetOffset() );
affineSearchTransform->SetMatrix( initialTransform->GetMatrix() );
affineSearchTransform->SetOffset( initialTransform->GetOffset() );
affineSearchTransform->Rotate2D( angle1, 1 );

if( strcmp( transform.c_str(), "affine" ) == 0 )
Expand All @@ -1294,17 +1298,17 @@ int antsAI( itk::ants::CommandLineParser *parser )
{
rigidSearchTransform->SetIdentity();
rigidSearchTransform->SetCenter( initialTransform->GetCenter() );
rigidSearchTransform->SetOffset( initialTransform->GetOffset() );
rigidSearchTransform->SetMatrix( affineSearchTransform->GetMatrix() );
rigidSearchTransform->SetOffset( initialTransform->GetOffset() );

parametersList.push_back( rigidSearchTransform->GetParameters() );
}
else if( strcmp( transform.c_str(), "similarity" ) == 0 )
{
similaritySearchTransform->SetIdentity();
similaritySearchTransform->SetCenter( initialTransform->GetCenter() );
similaritySearchTransform->SetOffset( initialTransform->GetOffset() );
similaritySearchTransform->SetMatrix( affineSearchTransform->GetMatrix() );
similaritySearchTransform->SetOffset( initialTransform->GetOffset() );
similaritySearchTransform->SetScale( bestScale );

similaritySearchTransform->SetScale( bestScale );
Expand Down

0 comments on commit 063291c

Please sign in to comment.