[Insight-users] Inheriting fields from the BSplineDeformableTransform ?

Luis Ibanez luis.ibanez at kitware.com
Tue Feb 23 17:16:18 EST 2010


Hi Motes,

Making InsideValidRegion() protected, should be enough
for what you want to do.

Adding method to the "public" interface should be the last
option to consider.


     Regards,

            Luis


-----------------------------------------------------------------------------
On Mon, Feb 22, 2010 at 12:25 PM, motes motes <mort.motes at gmail.com> wrote:
> Ok thanks for the tip! But how would you suggest to create a Get on
> the private InsideValidRegion()  function or should it simply be
> changed to public?
>
>
>
>
> On Mon, Feb 22, 2010 at 6:16 PM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>> Motes,
>>
>> I agree with Gaetan, that will be the most productive way to go.
>>
>> Please note, as you make modifications for the patch,
>> that member variables must indeed be private, and it is only
>> the Get methods (and eventually the Set methods) that should
>> be made protected.
>>
>> Adding the Get methods is almost trivial, or at least, it is a lot
>> easier than duplicating the code, and maintaining the duplicated
>> code for the next ten years....   :-)
>>
>>
>>
>>  Regards,
>>
>>
>>          Luis
>>
>>
>> --------------------------------------------------------------------------------------
>> 2010/2/21 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>:
>>>
>>> Le 21 févr. 10 à 15:22, motes motes a écrit :
>>>
>>>> Ok it seems that BSplineDeformableTransform is not designed to be
>>>> extended.
>>>>
>>>> 1) Not possible to extend InsideValidRegion() since its private.
>>>> 2) Not possible to access the private fields:
>>>>
>>>>    bool          m_SplineOrderOdd;
>>>>    SizeType      m_SupportSize;
>>>>
>>>> no GetMacro.
>>>>
>>>> Currently the best solution as I see it is to extend itkTransform
>>>> instead and copy everything from BSplineDeformableTransform to the
>>>> subclass. Not a very optimal approach though (a lot of already
>>>> existing code is duplicated).
>>>>
>>>> A better alternative would be to change the private visibility of the
>>>> fields in the BSplineDeformableTransform to 'protected'. Any comments
>>>> on this suggestion?
>>>>
>>>>
>>>
>>> Hi Motes,
>>>
>>> I would suggest to modify BSplineDeformableTransform to fit your needs in
>>> your local copy of ITK, and to provide a patch that can be reviewed.
>>>
>>> Regards,
>>>
>>> Gaëtan
>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Sun, Feb 21, 2010 at 2:35 PM, motes motes <mort.motes at gmail.com> wrote:
>>>>>
>>>>> Ah of course thanks! But inside a function in my subclass I need to do:
>>>>>
>>>>>  bool inside = this->InsideValidRegion( index );
>>>>>
>>>>> Now the InsideValidRegion function is also declared as private. There
>>>>> is the following macro:
>>>>>
>>>>>  /** Return the region of the grid wholly within the support region */
>>>>>  itkGetConstReferenceMacro( ValidRegion, RegionType );
>>>>>
>>>>>
>>>>> but that gives me the whole region and not a bool. I assume that I
>>>>> need to copy this function to my subclass to make it work?
>>>>>
>>>> _____________________________________
>>>> 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://www.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-users
>>>
>>> --
>>> Gaëtan Lehmann
>>> Biologie du Développement et de la Reproduction
>>> INRA de Jouy-en-Josas (France)
>>> tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
>>> http://voxel.jouy.inra.fr  http://www.itk.org
>>> http://www.mandriva.org  http://www.bepo.fr
>>>
>>>
>>> _____________________________________
>>> 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://www.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-users
>>>
>>>
>>
>


More information about the Insight-users mailing list