]> Creatis software - clitk.git/commitdiff
Bug: debugging code not totally commented
authorVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Thu, 21 Apr 2011 13:51:46 +0000 (15:51 +0200)
committerVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Thu, 21 Apr 2011 13:51:46 +0000 (15:51 +0200)
Comment debugging that leads to segfault when no mask is used with
generic metric.

registration/clitkGenericMetric.txx

index d57d3c24c4b3793feb0db38afdb1bff0bed6f0b5..6f10e72a1ee1e04744927727c70dbfe31b800056 100644 (file)
@@ -256,16 +256,16 @@ GenericMetric<args_info_type,FixedImageType, MovingImageType>::GetMetricPointer(
   }
 
 
-  typedef itk::ImageMaskSpatialObject<itkGetStaticConstMacro(FixedImageDimension)> ImageMaskSpatialObjectType;
-  typename ImageMaskSpatialObjectType::ConstPointer mask = dynamic_cast<const ImageMaskSpatialObjectType*>(m_FixedImageMask.GetPointer());
-  
-  typedef typename ImageMaskSpatialObjectType::RegionType ImageMaskRegionType;
-  ImageMaskRegionType mask_region = mask->GetAxisAlignedBoundingBoxRegion();
-  
+  //typedef itk::ImageMaskSpatialObject<itkGetStaticConstMacro(FixedImageDimension)> ImageMaskSpatialObjectType;
+  //typename ImageMaskSpatialObjectType::ConstPointer mask = dynamic_cast<const ImageMaskSpatialObjectType*>(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<args_info_type,FixedImageType, MovingImageType>::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;