[ITK] [ITK-dev] ITK API Change (was ITKApps failing after recent commit)

Bill Lorensen bill.lorensen at gmail.com
Tue May 26 14:57:13 EDT 2015


I'll take a stab at a patch.


On Tue, May 26, 2015 at 1:26 PM, Bradley Lowekamp
<blowekamp at mail.nih.gov> wrote:
> Bill,
>
> I am OK reverting the implementation of the itkEvenMacro.
>
> But I think we can keep the separated definition of the ITK classes and the current implementation of itkEventMacroDeclaration, and itkEventMacroDefinition.
>
> Brad
>
> On May 26, 2015, at 12:01 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>
>> Brad,
>>
>> In an application, by separating the declaration (in a .h file) from
>> the definition (in a .cxx file) solves the problem. But this is a PITA
>> for an application that currently uses itkEventMacro. Upsetting
>> customers is not moving forward.
>>
>>
>> On Tue, May 26, 2015 at 11:58 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>> Brad,
>>>
>>> That is not the problem. The old macro duplicated implementations in
>>> each file that included a common .h file. The new api changes that.
>>> But, is it important. I think not. The old, less elegant form, worked.
>>>
>>>
>>> On Tue, May 26, 2015 at 11:44 AM, Bradley Lowekamp
>>> <blowekamp at mail.nih.gov> wrote:
>>>>
>>>> Lets try to keep moving forward.
>>>>
>>>> The itkEventMacro is not really used in ITK. It should not be hard to revert it to the old behavior.
>>>>
>>>> All that is likely needed is to improve the usage of the ITKEvent_EXPORT define [1]. It looks like the re-write of these macros was only intended for internal ITK usage as it's defined an ITKCommom_EXPORT.
>>>>
>>>> Brad
>>>>
>>>>
>>>>
>>>> [1] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkEventObject.h#L108
>>>>
>>>> On May 26, 2015, at 11:37 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>>>
>>>>> I agree. I will soon have a patch to the ITKApps that works for both
>>>>> versions of ITK. This will illustrate how much work is required to
>>>>> support both API's. The current ITK makes itkEventMacro dangerous and
>>>>> worthless.
>>>>>
>>>>> On Tue, May 26, 2015 at 11:31 AM, Matt McCormick
>>>>> <matt.mccormick at kitware.com> wrote:
>>>>>> Hi Bill,
>>>>>>
>>>>>> Thanks for bringing attention to this.  If we cannot find a way for
>>>>>> external Event code to work without modification, I thing we should
>>>>>> revert the change before we release 4.8.
>>>>>>
>>>>>> 2 cents,
>>>>>> Matt
>>>>>>
>>>>>> On Tue, May 26, 2015 at 11:26 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>>>>>> itkEventMacro no longer works the way it used to. Applications that used
>>>>>>> itkEventMacro(myEvent, itk::UserEvent);
>>>>>>> must break up the statement into two statements and two files:
>>>>>>> in the .h file
>>>>>>> itkEventMacroDeclaration(myEvent,itk::UserEvent);
>>>>>>> in the .cxx file
>>>>>>> itkEventMacroDefinition(myEvent,itk::UserEvent);
>>>>>>>
>>>>>>> The problems occurs when an application has multiple source files that
>>>>>>> include the file with itkEventMacro. Duplicate symbols are created
>>>>>>> now. Prior to the API-break this was fine.
>>>>>>>
>>>>>>> Application code that uses itkEventMacro that wants to support ITK
>>>>>>> pre-the-API-break and post-the-API-break will need further statements.
>>>>>>>
>>>>>>> I am working on getting the ITKApps to work with both pre and post
>>>>>>> API-break versions.
>>>>>>>
>>>>>>> The unintended consequences of this API break are troublesome.
>>>>>>>
>>>>>>> On Mon, May 25, 2015 at 3:10 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>>>>>>> itksnap also has issues with the API change. I'll try to make a small
>>>>>>>> example that illustrates the problem.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, May 25, 2015 at 12:08 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>>>>>>>> Looks to me that the API for itkEventMacro has changed. This is bad.
>>>>>>>>> In ITKApps there are several definitions like this. How must these be
>>>>>>>>> changed?
>>>>>>>>>
>>>>>>>>> namespace fltk {
>>>>>>>>>
>>>>>>>>> /**
>>>>>>>>> *  List of the events expected in this domain
>>>>>>>>> */
>>>>>>>>> itkEventMacro( RedrawEvent,            itk::UserEvent );
>>>>>>>>> itkEventMacro( GlDrawEvent,            itk::UserEvent );
>>>>>>>>> itkEventMacro( VolumeReslicedEvent,    itk::UserEvent );
>>>>>>>>> itkEventMacro( ClippingPlaneEvent,     itk::UserEvent );
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> } // end namespace fltk
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, May 25, 2015 at 11:59 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>>>>>>>>> Since this topic was merged, ITKApps failk to build. I narrowed it
>>>>>>>>>> down using git commit.
>>>>>>>>>>
>>>>>>>>>> http://review.source.kitware.com/#/c/19729/
>>>>>>>>>>
>>>>>>>>>> Here is the failing dashboard entry:
>>>>>>>>>> https://open.cdash.org/viewBuildError.php?buildid=3828894
>>>>>>>>>>
>>>>>>>>>> I'll take a lot to see if I can fix it.
>>>>>>>>>>
>>>>>>>>>> Bill
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Unpaid intern in BillsBasement at noware dot com
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Unpaid intern in BillsBasement at noware dot com
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Unpaid intern in BillsBasement at noware dot com
>>>>>>> _______________________________________________
>>>>>>> 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.php
>>>>>>>
>>>>>>> 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://public.kitware.com/mailman/listinfo/insight-developers
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Unpaid intern in BillsBasement at noware dot com
>>>>> _______________________________________________
>>>>> 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.php
>>>>>
>>>>> 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://public.kitware.com/mailman/listinfo/insight-developers
>>>>> _______________________________________________
>>>>> Community mailing list
>>>>> Community at itk.org
>>>>> http://public.kitware.com/mailman/listinfo/community
>>>>
>>>
>>>
>>>
>>> --
>>> Unpaid intern in BillsBasement at noware dot com
>>
>>
>>
>> --
>> Unpaid intern in BillsBasement at noware dot com
>



-- 
Unpaid intern in BillsBasement at noware dot com
_______________________________________________
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.php

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://public.kitware.com/mailman/listinfo/insight-developers


More information about the Community mailing list