From: Romulo Pinho Date: Mon, 30 May 2011 12:48:16 +0000 (+0200) Subject: debugging messages X-Git-Tag: v1.3.0~331 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1c36198476c52684f55d4b6e4d30241d3a4c2e68;p=clitk.git debugging messages --- diff --git a/registration/clitkGenericMetric.txx b/registration/clitkGenericMetric.txx index 6f10e72..b5df490 100644 --- a/registration/clitkGenericMetric.txx +++ b/registration/clitkGenericMetric.txx @@ -256,11 +256,15 @@ GenericMetric::GetMetricPointer( } - //typedef itk::ImageMaskSpatialObject ImageMaskSpatialObjectType; - //typename ImageMaskSpatialObjectType::ConstPointer mask = dynamic_cast(m_FixedImageMask.GetPointer()); + typedef itk::ImageMaskSpatialObject ImageMaskSpatialObjectType; + typename ImageMaskSpatialObjectType::ConstPointer mask = NULL; + if (m_FixedImageMask.IsNotNull()) + mask = dynamic_cast(m_FixedImageMask.GetPointer()); - //typedef typename ImageMaskSpatialObjectType::RegionType ImageMaskRegionType; - //ImageMaskRegionType mask_region = mask->GetAxisAlignedBoundingBoxRegion(); + typedef typename ImageMaskSpatialObjectType::RegionType ImageMaskRegionType; + ImageMaskRegionType mask_region; + if (mask.IsNotNull()) + mask_region = mask->GetAxisAlignedBoundingBoxRegion(); // Common properties if( m_FixedImageMask.IsNotNull() ) @@ -300,7 +304,7 @@ GenericMetric::GetMetricPointer( // Calculate the number const unsigned int totalNumberOfPixels = m_FixedImageRegion.GetNumberOfPixels(); - //const unsigned int totalNumberOfPixels = mask_region.GetNumberOfPixels(); + const unsigned int totalNumberOfMaskPixels = mask_region.GetNumberOfPixels(); const unsigned int numberOfDemandedPixels = static_cast< unsigned int >( (double) totalNumberOfPixels *m_ArgsInfo.samples_arg ); // -------------------------------------------------- @@ -359,7 +363,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; @@ -427,6 +431,7 @@ GenericMetric::GetMetricPointer( if (m_Verbose) std::cout<<"A fraction of "<