From: Vivien Delmon Date: Thu, 21 Apr 2011 13:51:46 +0000 (+0200) Subject: Bug: debugging code not totally commented X-Git-Tag: v1.2.0~23 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=dad5855771b7655a9a6cdd51947e17128f24af3b;p=clitk.git Bug: debugging code not totally commented Comment debugging that leads to segfault when no mask is used with generic metric. --- 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;