From dad5855771b7655a9a6cdd51947e17128f24af3b Mon Sep 17 00:00:00 2001 From: Vivien Delmon Date: Thu, 21 Apr 2011 15:51:46 +0200 Subject: [PATCH] Bug: debugging code not totally commented Comment debugging that leads to segfault when no mask is used with generic metric. --- registration/clitkGenericMetric.txx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/registration/clitkGenericMetric.txx b/registration/clitkGenericMetric.txx index d57d3c2..6f10e72 100644 --- a/registration/clitkGenericMetric.txx +++ b/registration/clitkGenericMetric.txx @@ -256,16 +256,16 @@ GenericMetric::GetMetricPointer( } - typedef itk::ImageMaskSpatialObject ImageMaskSpatialObjectType; - typename ImageMaskSpatialObjectType::ConstPointer mask = dynamic_cast(m_FixedImageMask.GetPointer()); - - typedef typename ImageMaskSpatialObjectType::RegionType ImageMaskRegionType; - ImageMaskRegionType mask_region = mask->GetAxisAlignedBoundingBoxRegion(); - + //typedef itk::ImageMaskSpatialObject ImageMaskSpatialObjectType; + //typename ImageMaskSpatialObjectType::ConstPointer mask = dynamic_cast(m_FixedImageMask.GetPointer()); + + //typedef typename ImageMaskSpatialObjectType::RegionType ImageMaskRegionType; + //ImageMaskRegionType mask_region = mask->GetAxisAlignedBoundingBoxRegion(); + // Common properties - if( m_FixedImageMask.IsNotNull() ) + if( m_FixedImageMask.IsNotNull() ) m_Metric->SetFixedImageMask(m_FixedImageMask); - + m_Metric->SetFixedImageRegion(m_FixedImageRegion); //m_Metric->SetFixedImageRegion(mask_region); @@ -359,7 +359,7 @@ GenericMetric::GetMetricPointer( //RandomIterator randIter( m_FixedImage, mask_region ); if (m_Verbose) std::cout << "Search region " << m_FixedImageRegion << std::endl; - if (m_Verbose) std::cout << "Mask search region " << mask_region << std::endl; + //if (m_Verbose) std::cout << "Mask search region " << mask_region << std::endl; // Randomly sample the image short att = 1; -- 2.47.1