Skip to content

STYLE: Use itkGetConstMacro for getting 1D FFT direction#2806

Merged
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom
tbirdso:1d-fft-const-macro
Oct 13, 2021
Merged

STYLE: Use itkGetConstMacro for getting 1D FFT direction#2806
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom
tbirdso:1d-fft-const-macro

Conversation

@tbirdso
Copy link
Copy Markdown
Contributor

@tbirdso tbirdso commented Oct 12, 2021

Prompted by discussion in #2805.

PR Checklist

Refer to the ITK Software Guide for
further development details if necessary.

@github-actions github-actions Bot added area:Filtering Issues affecting the Filtering module type:Performance Improvement in terms of compilation or execution time labels Oct 12, 2021
@jhlegarreta
Copy link
Copy Markdown
Member

jhlegarreta commented Oct 12, 2021

A deprecation cycle is needed, isn't it? Or else we assume that it is closer to an undesired behavior, bug and no such cycle applies? Tagging @N-Dekker.

@N-Dekker
Copy link
Copy Markdown
Contributor

@jhlegarreta

A deprecation cycle is needed

Do you really think so? A Get member function defined by itkGetConstMacro supports getting a value from a const object, as well as from a non-const object.

@jhlegarreta
Copy link
Copy Markdown
Member

Do you really think so?

Not sure.

Copy link
Copy Markdown
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code which used ITKUltrasound would need to be updated. The prinicipally involved persons, @thewtex and @tbirdso, should decide whether they want to update it now or later. If they want to update now, deprecation cycle is not needed because this code was just introduced in ITK proper and a release with it has not been made yet.

@tbirdso
Copy link
Copy Markdown
Contributor Author

tbirdso commented Oct 12, 2021

@dzenanz Sorry, I'm not sure what is being asked. Is the question in regards to updating code in the ITKUltrasound module that may be using GetDirection from these 1D FFT filters as a non-const member and therefore breaking the new API? Or is it concern for consumers in ITK proper? It doesn't look like GetDirection is referenced in 1D FFT tests other than the standard ITK_EXERCISE_BASIC_OBJECT_METHODS macro.

@dzenanz
Copy link
Copy Markdown
Member

dzenanz commented Oct 12, 2021

I meant application code which used 1D FFTs from ITKUltrasound. That will need to be updated.

@tbirdso
Copy link
Copy Markdown
Contributor Author

tbirdso commented Oct 12, 2021

Thanks. Maybe @thewtex can weigh in the merit of the change + applications potentially affected?

@jhlegarreta jhlegarreta requested a review from seanm October 12, 2021 18:06
@jhlegarreta
Copy link
Copy Markdown
Member

deprecation cycle is not needed because this code was just introduced in ITK proper and a release with it has not been made yet.

Very true. Thanks @dzenanz 👌 !!

@N-Dekker
Copy link
Copy Markdown
Contributor

I meant application code which used 1D FFTs from ITKUltrasound. That will need to be updated.

This pull request does not break any existing filter.GetDirection() call, as far as I can see. itkGetConstMacro(Direction, unsigned int) supports getting the direction from both a const and a non-const filter. It would only break user code that does override GetDirection(). But in general, a Get function that just yields the value of a data member is rarely overridden.

My two cents. 😃

@N-Dekker
Copy link
Copy Markdown
Contributor

@tbirdso By the way, why did you use the "PERF" prefix? I wouldn't directly expect a significant performance improvement when switching from itkGetMacro to itkGetConstMacro, looking at https://github.com/InsightSoftwareConsortium/ITK/blob/v5.3rc01/Modules/Core/Common/include/itkMacro.h#L964-L974 So I think I would use the "STYLE" prefix instead.

@thewtex
Copy link
Copy Markdown
Member

thewtex commented Oct 13, 2021

To clarify, @jhlegarreta is right to keep an eye on backwards compatibility, but these classes are being introduced in ITK from the ITKUltrasound module in ITK 5.3 (still in the RC stage), so no deprecation is needed. Also, as @N-Dekker , there should be not be changes required in client code. @tbirdso thanks for the follow-up on this. Please reclassify the patch as STYLE as @N-Dekker suggests, and it should be ready to go!

@tbirdso tbirdso force-pushed the 1d-fft-const-macro branch from 34c4bfb to 0bf6ee3 Compare October 13, 2021 13:22
@tbirdso tbirdso changed the title PERF: Use itkGetConstMacro for getting 1D FFT direction STYLE: Use itkGetConstMacro for getting 1D FFT direction Oct 13, 2021
@tbirdso
Copy link
Copy Markdown
Contributor Author

tbirdso commented Oct 13, 2021

Fixed. Thanks everyone for the discussion on this!

@hjmjohnson hjmjohnson merged commit d88c631 into InsightSoftwareConsortium:master Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Filtering Issues affecting the Filtering module type:Performance Improvement in terms of compilation or execution time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants