如何解决使用 OpenCLFixedGenericImagePyramid 时的 Elastix 错误
在编译正确的 ITK (5.1.1) 和 OpenCL 之后,我终于能够使用 OpenCL 功能编译 Elastix。但是,当我使用在配置文件中启用 OpenCL 功能的图像和掩码运行 Elastix 时,它会失败并显示以下错误
Initialization of AdvancedMattesMutualInformation metric took: 0 ms.
Time spent in resolution 0 (ITK initialization and iterating): 0.001 s.
Stopping condition: Error in metric.
itk::ExceptionObject (0x7fcc68001540)
Location: "ElastixTemplate - Run()"
File: /home/fuzie/Documents/Speciale/code/elastix-build/InsightToolkit-5.1.1/Modules/Core/Common/include/itkImageConstIterator.h
Line: 210
Description: itk::ERROR: Region ImageRegion (0x7ffdc32ad8b0)
Dimension: 2
Index: [-9223372036854775808,29]
Size: [4,2]
is outside of buffered region ImageRegion (0x55794bfad4d0)
Dimension: 2
Index: [0,0]
Size: [32,32]
Error occurred during actual registration.
Errors occurred!
当我纯粹在 CPU 上运行它时,它工作得很好。 我使用的参数如下
// ********** Image Types
(FixedInternalImagePixelType "float")
(FixedImageDimension 3)
(MovingInternalImagePixelType "float")
(MovingImageDimension 3)
(UseBinaryFormatForTransformationParameters "false")
// ********** Components
(Registration "MultiResolutionRegistration")
// // CPU - pyramids
// (FixedImagePyramid "FixedSmoothingImagePyramid")
// (MovingImagePyramid "MovingSmoothingImagePyramid")
// GPU pyramids
(FixedImagePyramid "OpenCLFixedGenericImagePyramid")
(MovingImagePyramid "OpenCLMovingGenericImagePyramid")
(OpenCLFixedGenericImagePyramidUseOpenCL "true")
(OpenCLMovingGenericImagePyramidUseOpenCL "true")
(Interpolator "BSplineInterpolator")
(Metric "AdvancedMattesMutualInformation")
(Optimizer "StandardGradientDescent")
(ResampleInterpolator "FinalBSplineInterpolator")
(Transform "BSplineTransform")
(UseDirectionCosines "false")
// ********** Pyramid
// Total number of resolutions
(NumberOfResolutions 8)
// default schedule: isotropic upsampling with factor 2
// ********** Transform
(FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0)
(GridSpacingSchedule 16.0 16.0 16.0 16.0 8.0 4.0 2.0 1.0)
(HowToCombineTransforms "Compose")
// ********** Optimizer
// Maximum number of iterations in each resolution level:
(MaximumNumberOfIterations 1000)
//SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha
(SP_a 10000.0)
//SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha
(SP_alpha 0.602)
//SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha
(SP_A 50.0)
// ********** Metric
//Number of grey level bins in each resolution level:
(NumberOfHistogramBins 32)
(FixedLimitRangeRatio 0.0)
(MovingLimitRangeRatio 0.0)
(FixedKernelBSplineOrder 1)
(MovingKernelBSplineOrder 3)
// ********** Several
(WriteTransformParametersEachIteration "false")
(WriteTransformParametersEachResolution "false")
(WriteResultImageAfterEachResolution "false")
(WriteResultImage "false")
(ShowExactMetricValue "false")
(ErodeMask "false")
// ********** ImageSampler
//Number of spatial samples used to compute the mutual information in each resolution level:
(ImageSampler "RandomSparseMask")
(NumberOfSpatialSamples 2000)
(NewSamplesEveryIteration "true")
(UseRandomSampleRegion "false")
// ********** Interpolator and Resampler
//Order of B-Spline interpolation used in each resolution level:
(BSplineInterpolationOrder 1)
//Order of B-Spline interpolation used for applying the final deformation:
(FinalBSplineInterpolationOrder 3)
//Default pixel value for pixels that come from outside the picture:
(DefaultPixelValue -1000)
// Resampler specific
// (Resampler "DefaultResampler")
(Resampler "OpenCLResampler")
(OpenCLResamplerUseOpenCL "true")
(ResultImageFormat "nii")
(ResultImagePixelType "float")
(CompressResultImage "true")
知道如何解决这个问题吗?
最好的问候 雅各布
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。