[Insight-users] memory allocation for gradient (Rupert Brooks)

Lars Nygard lnygard at yahoo.com
Thu Jun 28 12:48:09 EDT 2007


Hi Rupert,

Thanks for the reply. Ive already experimented with the ComputeGradient
method. If I set this one false a program works which explores the metric,
but in a registration program I get the same 'ol error.
However I find the meansquare method to be very slow in comparison with
mutualinformation metric. The paper is interesting. If I get further with this
issue Ill lett you know.
regards,
Lars Nygard 


   1. memory allocation for gradient (Rupert Brooks)


----------------------------------------------------------------------

Message: 1
Date: Wed, 27 Jun 2007 10:10:16 -0400
From: "Rupert Brooks" <rupe.brooks at gmail.com>
Subject: [Insight-users] memory allocation for gradient
To: insight-users at itk.org
Message-ID:
    <a6cc33f0706270710u44e6aa79w33d862850008b884 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

hi Lars,

I know the memory issue you mean, and i've been fiddling with this a
bit.  Someday my fiddling might even make it to the Insight journal,
but not particularly soon, so i will give you what hints i can right
now.

If you want to tackle changing the metric, i recommend taking a close
look at MattesMutualInformationImageToImageMetric, and imitating that
approach.  They use two memory saving approaches - they either compute
the gradient on the fly using a finite difference calculator, or they
get the gradient from the BSpline interpolator, if that is the
interpolator type.  The method ComputeGradient(...) is probably the
thing to look at.  Basically they are trading time for space in either
case, so you can expect these methods to run a bit slower than
precomputing the gradient.

Once you're in there messing with the code, you may want to make it
operate on a random subset of pixels.  There was a paper in the
Insight Journal, by Marius Staring, on this topic.
http://hdl.handle.net/1926/190

Good Luck,

Rupert B.

> Message: 6
> Date: Wed, 20 Jun 2007 06:43:04 -0700 (PDT)
> From: Lars Nygard <lnygard at yahoo.com>
> Subject: [Insight-users] Re: Insight-users Digest, Vol 38, Issue 42
> To: insight-users at itk.org
> Message-ID: <195132.39146.qm at web50205.mail.re2.yahoo.com>
> Content-Type: text/plain; charset=iso-8859-1

> Hi,
> Im having similar problems. Ive already said this some time ago.
> I get a failed allocation memory error when registering with metrics that
> need to compute the gradient image (such as meansquares).
> Today I also got an memory error using the Multi Resolution registration
> method. It's at exact the same place so Im suspecting this has the same
> cause (that is computing the gradient), although Im not sure
> Luis suggested to change the way the gradient is computed, So using
> GradientMagnitudeFilter instead of RecurssiveGradientFilter.
> Im a bit hesitant to start changing ITK base classes, Im quite positive this
> task will take me at least some days if not several weeks.
> If anybody has done this Id be interested to hear.
> regards,
> lars

-- 
--------------------------------------------------------------
Rupert Brooks
McGill Centre for Intelligent Machines (www.cim.mcgill.ca)
Ph.D Program in Intelligent Systems
http://www.cyberus.ca/~rbrooks


      
_________________________________________________________
Alt i én. Få Yahoo! Mail med adressekartotek, kalender og
notisblokk. http://no.mail.yahoo.com


More information about the Insight-users mailing list