# Contact: Matt McCormick <matt.mccormick@kitware.com>
itk_fetch_module(BridgeNumPy
  "This module contains wrapper code to convert ITK Image's to
  NumPy array's and back.  For example:

    import itk
    ImageType = itk.Image[itk.F, 2]
    image = ImageType.New()
    array = itk.PyBuffer[ImageType].GetArrayFromImage(image)
    image = itk.PyBuffer[ImageType].GetImageFromArray(array)

  It also enables conversion of a VNL vector or matrix into a NumPy array and
  back. For example:

    import itk
    v = itk.vnl_vector[itk.F]()
    v.set_size(2)
    arr = itk.PyVnl[itk.F].GetArrayFromVnlVector(v)
    v = itk.PyVnl[itk.F].GetVnlVectorFromArray(arr)

  See http://insight-journal.org/browse/publication/85
      https://hdl.handle.net/1926/188"
  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKBridgeNumPy.git
  GIT_TAG ab8df8c1c8494416d5c8471382413c49c9163d9b
  )

# Contact: Matt McCormick <matt.mccormick@kitware.com>
itk_fetch_module(BridgeNumPy
  "This module contains wrapper code to convert ITK Image's to
  NumPy array's and back.  For example:

    import itk
    ImageType = itk.Image[itk.F, 2]
    image = ImageType.New()
    array = itk.PyBuffer[ImageType].GetArrayFromImage(image)
    image = itk.PyBuffer[ImageType].GetImageFromArray(array)

  It also enables conversion of a VNL vector or matrix into a NumPy array and
  back. For example:

    import itk
    v = itk.vnl_vector[itk.F]()
    v.set_size(2)
    arr = itk.PyVnl[itk.F].GetArrayFromVnlVector(v)
    v = itk.PyVnl[itk.F].GetVnlVectorFromArray(arr)

  See http://insight-journal.org/browse/publication/85
      https://hdl.handle.net/1926/188"
  GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKBridgeNumPy.git
  GIT_TAG 249e7be2d012c66b605498b1ce2b4b46498e0680
  )

Update BridgeNumPy to latest version on 2017.01.08 to address ITK-3511
ENH: Update BridgeNumPy to latest version on 2017.01.08 to address ITK-3511

This update addresses bug report ITK-3511 [1]. BridgeNumPy cannot create an
ITK image directly from a transpose of a NumPy array. The array is not C-style
contiguous when computing the transpose. Memory cannot be easily shared between
Python and C++. A specific error message letting the user know what the problem
is is now displayed.

Francois Budin (2):
      ENH: Print useful error message if NumPy array is not C-style contiguous
      Merge pull request #12 from \
          fbudin69500/ENH_better_error_message_for_fortran_data_ordered_arrays

[1] https://issues.itk.org/jira/browse/ITK-3511

Change-Id: I82fcd4558e8169844ff5ae796c47ae4e5251ade2
