Skip to content

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

Closed
jmichel-otb wants to merge 1 commit intoInsightSoftwareConsortium:masterfrom
jmichel-otb:WarpImageFilter-VectorImage-support
Closed

ENH: Support of VectorImage as template parameters for WarpImageFilter#8
jmichel-otb wants to merge 1 commit intoInsightSoftwareConsortium:masterfrom
jmichel-otb:WarpImageFilter-VectorImage-support

Conversation

@jmichel-otb
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
hjmjohnson pushed a commit that referenced this pull request Apr 25, 2026
DOC: Update FFT class names
hjmjohnson added a commit that referenced this pull request Apr 28, 2026
Fix test failure related to issue #7 

Verified with problematic data set. Converted MGZ to nifti and back again.  read all files into slicer and confirmed that reading and writing appears to work in all combinations.
hjmjohnson pushed a commit that referenced this pull request Apr 30, 2026
…licSection

COMP: Move ITK_DISALLOW_COPY_AND_ASSIGN calls to public section.
hjmjohnson pushed a commit that referenced this pull request May 5, 2026
COMP: Address SetInput override virtual warning.
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.

2 participants