[elastix] BendingEnergyPenalty speed

Stefan Klein s.klein at erasmusmc.nl
Fri Jan 27 09:45:50 CET 2012

Hi Brecht,
How many samples are you using now?
It's indeed possible to use a different sampler for the bending energy 
than for the first similarity metric. Simply put something like:

(ImageSampler "Random" "Random" )

to specify a different number of samples for both:
(ImageSampler0NumberOfSpatialSamples 10000)
(ImageSampler1NumberOfSpatialSamples 1000)

Kind regards,

On 27-1-2012 9:40, M.Staring at lumc.nl wrote:
> Dear Brecht,
> Those penalty terms are indeed slow; there has not been made 
> performance improvements, and I also suspect no one over here has time 
> or incentive to work on that. The penalty term also depends on the 
> previous (initial) transform and does computations on that. So, the 
> more initial transforms, the slower it is. If that is the case you may 
> want to group those transform in a single transform. Two affine 
> transforms can for example be perfectly grouped into a single affine 
> transform, and two B-spline transforms can be approximated by a single 
> B-spline.
> Mathematically, it may be a bit dangerous to evaluate part of the cost 
> function on other (less) samples, adding more noise to that part of 
> the cost function. Practically, it may work, but I have never tried 
> that. So, I would just try it out and check what you get.
> Regards,
> Marius
> *From:*elastix-bounces at bigr.nl [mailto:elastix-bounces at bigr.nl] *On 
> Behalf Of *Brecht Heyde
> *Sent:* donderdag 26 januari 2012 11:03
> *To:* elastix at bigr.nl
> *Cc:* 'Brecht Heyde'
> *Subject:* [elastix] BendingEnergyPenalty speed
> Dear Marius, dear Stefan and elastix users,
> As is also mentioned in the elastix user's guide, the current 
> computational cost for the TransformBendingEnergyPenalty is quite 
> substantial, especially for large 3D datasets. I started looking into 
> the code and since all second order derivatives are all calculated 
> analytically from the underlying B-splines, I started wondering where 
> the bottleneck of the evaluation of this penalty might be.
> Have any performance improvements for this class been made lately? 
> Would it make sense to evaluate it in less points to speed up the 
> process (so attach another RegularGridSampler for example?) Has anyone 
> thought of other solutions?
> Best regards,
> Brecht Heyde
> _______________________________________________
> elastix mailing list
> elastix at bigr.nl
> http://lists.bigr.nl/mailman/listinfo/elastix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bigr.nl/pipermail/elastix/attachments/20120127/775abc48/attachment.html>

More information about the Elastix mailing list