[Insight-developers] add template parameters to optimizer base class

Luis Ibanez luis.ibanez at kitware.com
Sat Apr 23 16:59:44 EDT 2011


Hi Michel,

Please make sure that they all have the default template
argument that will make them backwards compatible.


     Luis


---------------------------------
On Fri, Apr 22, 2011 at 5:07 PM, M Stauffer (V) <mstauff at verizon.net> wrote:
> Hi,
>
> Templating the optimizers over a parameter ValueType requires that
> transforms have parameters of the same type, which requires templating
> TransformBase over parameter value type as well. This is easy enough to
> propgate, since we can use the TScalarType, over which Transform and
> derived classes are templated, to pass to TransformBase for the
> parameter ValueType template parameter.
>
> However, this effects TransformIO and related classes, which use
> TransformBase pointers to hold their transform lists. For now I'll just
> have these template TransformBase over double, w/out templating the IO
> classes themselves. And since Norman is overhauling the TransformIO
> method, this should be taken care of there.
>
> Does this sound reasonable?
>
> Cheers,
> Michael
>
>>-----Original Message-----
>>From: insight-developers-bounces at itk.org
>>[mailto:insight-developers-bounces at itk.org] On Behalf Of
>>Johnson, Hans J
>>Sent: Wednesday, March 30, 2011 5:22 PM
>>To: Luis Ibanez; brian avants; Gaëtan Lehmann
>>Cc: ITK
>>Subject: Re: [Insight-developers] add template parameters to
>>optimizer base class
>>
>>Luis,
>>
>>I would vote for this and propose that the wrapping only use the double
>>precision version for backwards compatibility.
>>
>>Hans
>>
>>--
>>Hans J. Johnson, Ph.D.
>>hans-johnson at uiowa.edu
>>Assistant Professor of Psychiatry
>>University of Iowa Carver College of Medicine
>>W278 GH, 200 Hawkins Drive
>>
>>Iowa City, Iowa 52242
>>Phone:  319-353-8587
>>
>>
>>
>>
>>
>>
>>
>>-----Original Message-----
>>From: Luis Ibanez <luis.ibanez at kitware.com>
>>Date: Wed, 30 Mar 2011 17:17:33 -0400
>>To: brian avants <stnava at gmail.com>, Gaëtan Lehmann
>><gaetan.lehmann at jouy.inra.fr>
>>Cc: ITK <insight-developers at itk.org>
>>Subject: Re: [Insight-developers] add template parameters to optimizer
>>base class
>>
>>Hi Brian,
>>
>>We should check with Gaetan on the implications
>>that this new template parameter may have in the Wrapping...
>>
>>
>>       Luis
>>
>>
>>---------------------------------------------------------------
>>------------
>>-------------
>>On Tue, Mar 29, 2011 at 5:19 PM, brian avants <stnava at gmail.com> wrote:
>>> hi everyone
>>>
>>> itkCostFunction defines the following:
>>>
>>> class ITK_EXPORT CostFunction:public Object
>>> {
>>> public:
>>>
>>> < snip >
>>>
>>>  /**  ParametersType typedef.
>>>   *  It defines a position in the optimization search space. */
>>>  typedef double                       ParametersValueType;
>>>  typedef Array< ParametersValueType > ParametersType;
>>>
>>> ....
>>>
>>> what we'd like to do is define ParametersValueType via a template
>>>parameter
>>> such that we can use float type.
>>>
>>> the motivation is to allow us to have Derivatives/Parameters that are
>>> float deformation fields or float BSpline parameter images that are
>>> then memory mapped to Parameter/DerivativeType arrays.
>>>
>>> does anyone have any objection?   we'd have to make changes
>>to all the
>>> derived classes but these changes should be backward compatible
>>> because the default template parameter for ParametersValueType would
>>> be double ( as it currently is ).
>>>
>>> brian
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://kitware.com/products/protraining.html
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-developers
>>>
>>_______________________________________________
>>Powered by www.kitware.com
>>
>>Visit other Kitware open-source projects at
>>http://www.kitware.com/opensource/opensource.html
>>
>>Kitware offers ITK Training Courses, for more information visit:
>>http://kitware.com/products/protraining.html
>>
>>Please keep messages on-topic and check the ITK FAQ at:
>>http://www.itk.org/Wiki/ITK_FAQ
>>
>>Follow this link to subscribe/unsubscribe:
>>http://www.itk.org/mailman/listinfo/insight-developers
>>
>>
>>
>>________________________________
>>Notice: This UI Health Care e-mail (including attachments) is
>>covered by the Electronic Communications Privacy Act, 18
>>U.S.C. 2510-2521, is confidential and may be legally
>>privileged.  If you are not the intended recipient, you are
>>hereby notified that any retention, dissemination,
>>distribution, or copying of this communication is strictly
>>prohibited.  Please reply to the sender that you have received
>>the message in error, then delete it.  Thank you.
>>________________________________
>>_______________________________________________
>>Powered by www.kitware.com
>>
>>Visit other Kitware open-source projects at
>>http://www.kitware.com/opensource/opensource.html
>>
>>Kitware offers ITK Training Courses, for more information visit:
>>http://kitware.com/products/protraining.html
>>
>>Please keep messages on-topic and check the ITK FAQ at:
>>http://www.itk.org/Wiki/ITK_FAQ
>>
>>Follow this link to subscribe/unsubscribe:
>>http://www.itk.org/mailman/listinfo/insight-developers
>
>


More information about the Insight-developers mailing list