From 0584a2224f924b5e89ba39c173f9a2c53d95b9cb Mon Sep 17 00:00:00 2001
From: torsten_at_home <torsten_at_home@42a5c34f-2066-0410-bec5-ba365beb4995>
Date: Fri, 20 Jul 2012 04:04:00 +0000
Subject: [PATCH] FIX: fall back to lower-level allocation API, as convenience
 functions not available in less-than-most-recent FFTW
 version

git-svn-id: https://www.nitrc.org/svn/cmtk/trunk@4458 42a5c34f-2066-0410-bec5-ba365beb4995
---
 .../cmtkSphereDetectionBipolarMatchedFilterFFT.cxx         |    4 ++--
 ...mtkSphereDetectionNormalizedBipolarMatchedFilterFFT.cxx |   12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libs/Segmentation/cmtkSphereDetectionBipolarMatchedFilterFFT.cxx b/libs/Segmentation/cmtkSphereDetectionBipolarMatchedFilterFFT.cxx
index dc8d9ff..9469cda 100644
--- a/libs/Segmentation/cmtkSphereDetectionBipolarMatchedFilterFFT.cxx
+++ b/libs/Segmentation/cmtkSphereDetectionBipolarMatchedFilterFFT.cxx
@@ -35,8 +35,8 @@ cmtk::SphereDetectionBipolarMatchedFilterFFT::SphereDetectionBipolarMatchedFilte
       m_ImageDims( image.m_Dims ),
       m_PixelSize( image.m_Delta )
 {
-  this->m_ImageFT = fftw_alloc_complex( this->m_NumberOfPixels );
-  this->m_FilterFT = fftw_alloc_complex( this->m_NumberOfPixels );
+  this->m_ImageFT = static_cast<fftw_complex*>( fftw_malloc( sizeof( fftw_complex ) * this->m_NumberOfPixels ) );
+  this->m_FilterFT = static_cast<fftw_complex*>( fftw_malloc( sizeof( fftw_complex ) * this->m_NumberOfPixels ) );
 
   this->m_PlanFilter = fftw_plan_dft_3d( this->m_ImageDims[2], this->m_ImageDims[1], this->m_ImageDims[0], this->m_FilterFT, this->m_FilterFT, FFTW_FORWARD, FFTW_ESTIMATE );
   this->m_PlanBackward = fftw_plan_dft_3d( this->m_ImageDims[2], this->m_ImageDims[1], this->m_ImageDims[0], this->m_FilterFT, this->m_FilterFT, FFTW_BACKWARD, FFTW_ESTIMATE );
diff --git a/libs/Segmentation/cmtkSphereDetectionNormalizedBipolarMatchedFilterFFT.cxx b/libs/Segmentation/cmtkSphereDetectionNormalizedBipolarMatchedFilterFFT.cxx
index 63f101f..3322d65 100644
--- a/libs/Segmentation/cmtkSphereDetectionNormalizedBipolarMatchedFilterFFT.cxx
+++ b/libs/Segmentation/cmtkSphereDetectionNormalizedBipolarMatchedFilterFFT.cxx
@@ -37,13 +37,13 @@ cmtk::SphereDetectionNormalizedBipolarMatchedFilterFFT::SphereDetectionNormalize
       m_SphereRadius( 0 ),
       m_MarginWidth( -1 )
 {
-  this->m_ImageFT = fftw_alloc_complex( this->m_NumberOfPixels );
-  this->m_ImageSquareFT = fftw_alloc_complex( this->m_NumberOfPixels );
+  this->m_ImageFT = static_cast<fftw_complex*>( fftw_malloc( sizeof( fftw_complex ) * this->m_NumberOfPixels ) );
+  this->m_ImageSquareFT = static_cast<fftw_complex*>( fftw_malloc( sizeof( fftw_complex ) * this->m_NumberOfPixels ) );
 
-  this->m_FilterFT = fftw_alloc_complex( this->m_NumberOfPixels );
-  this->m_FilterSquareFT = fftw_alloc_complex( this->m_NumberOfPixels );
-  this->m_FilterMaskFT = fftw_alloc_complex( this->m_NumberOfPixels );
-  this->m_FilterMaskFT2 = fftw_alloc_complex( this->m_NumberOfPixels );
+  this->m_FilterFT = static_cast<fftw_complex*>( fftw_malloc( sizeof( fftw_complex ) * this->m_NumberOfPixels ) );
+  this->m_FilterSquareFT = static_cast<fftw_complex*>( fftw_malloc( sizeof( fftw_complex ) * this->m_NumberOfPixels ) );
+  this->m_FilterMaskFT = static_cast<fftw_complex*>( fftw_malloc( sizeof( fftw_complex ) * this->m_NumberOfPixels ) );
+  this->m_FilterMaskFT2 = static_cast<fftw_complex*>( fftw_malloc( sizeof( fftw_complex ) * this->m_NumberOfPixels ) );
 
   this->m_PlanFilter = fftw_plan_dft_3d( this->m_ImageDims[2], this->m_ImageDims[1], this->m_ImageDims[0], this->m_FilterFT, this->m_FilterFT, FFTW_FORWARD, FFTW_ESTIMATE );
   this->m_PlanFilterSquare = fftw_plan_dft_3d( this->m_ImageDims[2], this->m_ImageDims[1], this->m_ImageDims[0], this->m_FilterSquareFT, this->m_FilterSquareFT, FFTW_FORWARD, FFTW_ESTIMATE );
-- 
1.7.10.4

