Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Support of VectorImage as template parameters for WarpImageFilter #8

Conversation

jmichel-otb
Copy link
Contributor

This patch relates to issue #2895 ( https://issues.itk.org/jira/browse/ITK-2895#comment-27056 )

It is a straigthforward port of OTB patch provided by Julien Malik on his github page (see first comment)

Patch summary:

  • In itkWarpImageFilter.h:
    • Replace HasNumericTraits concept checking on TInputImage::PixelType by checking on TInputImage::InternalPixelType, since HasNumericTraits will fail with VariableLengthVector as PixelType
  • In itkWarpImageFilter.txx:
    • Changed instanciation of m_EdgePaddingValue member to avoid calling NumericTraits< PixelType >::Zero, which does not exist for VariableLengthVector
    • Add further initialization of m_EdgePaddingValue in BeforeThreadedGenerateData, so that it will generate a VariableLenghtVector of appropriate length if needed
    • Avoid calling DisplacementType::Dimension and use the GetLength method from NumericTraits instead, which will support both static and dynamic (VariableLengthVector) length
  • In itkWarpImageFilterTest.cxx:
    • Added a simple test for template instanciation of WarpImageFilter using VectorImage for all three template parameters

Change-Id: I44fb183dd6a684a23312446b2bc2d62e7f8eff7b

This patch relates to issue InsightSoftwareConsortium#2895 ( https://issues.itk.org/jira/browse/ITK-2895#comment-27056 )

It is a straigthforward port of OTB patch provided by Julien Malik on his github page (see first comment)

Patch summary:
- In itkWarpImageFilter.h:
  - Replace HasNumericTraits concept checking on TInputImage::PixelType by checking on TInputImage::InternalPixelType, since HasNumericTraits will fail with VariableLengthVector as PixelType

- In itkWarpImageFilter.txx:
  - Changed instanciation of m_EdgePaddingValue member to avoid calling NumericTraits< PixelType >::Zero, which does not exist for VariableLengthVector
  - Add further initialization of m_EdgePaddingValue in BeforeThreadedGenerateData, so that it will generate a VariableLenghtVector of appropriate length if needed
  - Avoid calling DisplacementType::Dimension and use the GetLength method from NumericTraits instead, which will support both static and dynamic (VariableLengthVector) length

- In itkWarpImageFilterTest.cxx:
  - Added a simple test for template instanciation of WarpImageFilter using VectorImage for all three template parameters

Change-Id: I44fb183dd6a684a23312446b2bc2d62e7f8eff7b
@jmichel-otb
Copy link
Contributor Author

Note that I initially planned to push this patch to gerrit, but I am behind a firewall and did not manage to get http push working, though I carefully followed http://www.itk.org/Wiki/ITK/Git/Account#Gerrit :
Fetching gerrit master
Pushing to gerrit
Password for 'http://jmichel-otb@review.source.kitware.com':
remote: Unauthorized
fatal: Authentication failed for 'http://jmichel-otb@review.source.kitware.com/p/ITK/'

I am quite sure this worked for me in the past (I have 3 merged patches and 1 abandonned logged in gerrit already).

@thewtex
Copy link
Member

thewtex commented Oct 27, 2015

Uploaded to Gerrit here:

http://review.source.kitware.com/#/c/20310/

@thewtex thewtex closed this Oct 27, 2015
HastingsGreer pushed a commit to HastingsGreer/ITK that referenced this pull request Feb 11, 2019
ENH: Refactored SpatialObjectPoints and its derivatives
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants