[ITK] Python wrapper for first order ITKTextureFeatures

yannick.suter at istb.unibe.ch yannick.suter at istb.unibe.ch
Sat Sep 16 12:45:57 EDT 2017


Dear all,

I would like to use the the first order texture features of ITKTextureFeatures (https://github.com/InsightSoftwareConsortium/ITKTextureFeatures) in Python. Thanks to J.Vimort et al. for the great work!
Since the coocurrence and run length features are already wrapped, I tried to take these as an example and wrap it myself (I'm very new to this).

I would appreciate any help to point me into the right direction.

That's what I've tried:
- Created a .wrap file "itkFirstOrderTextureFeaturesImageFilter.wrap" and put it in the "/Modules/External/ITKTextureFeatures/wrapping" directory (see below)
- Added "itkFirstOrderTextureFeaturesImageFilter" to the CMakeLists.txt in the "/Modules/External/ITKTextureFeatures/wrapping" directory, now looking like this:

itk_wrap_module(TextureFeatures)

set(WRAPPER_SUBMODULE_ORDER
   itkCoocurrenceTextureFeaturesImageFilter
   itkRunLengthTextureFeaturesImageFilter
   itkFirstOrderTextureFeaturesImageFilter)

itk_auto_load_submodules()
itk_end_wrap_module()

This gives me the folowwing error for every datatype I set to wrap:
>> /home/yannick/Projects/PhD/ITK/ITK/bin/Wrapping/itkFirstOrderTextureFeaturesImageFilter.cxx:79:18: error: too few template arguments for class template 'FirstOrderTextureFeaturesImageFilter'
>>    typedef itk::FirstOrderTextureFeaturesImageFilter< itk::Image< signed short,2 >, itk::Image<itk::Vector<float,8>,2> > itkFirstOrderTextureFeaturesImageFilterISS2IVF82;
                 ^
>>/home/yannick/Projects/PhD/ITK/ITK/Modules/External/ITKTextureFeatures/include/itkFirstOrderTextureFeaturesImageFilter.h:52:27: note: template is declared here
>>class ITK_TEMPLATE_EXPORT FirstOrderTextureFeaturesImageFilter:

Since the it's working if I use it in C++, I don't see where template arguments are missing.

Best and thank you,

Yannick

That's my .wrap-file:
------------
set(OutputVectorDim 8)
itk_wrap_class("itk::FixedArray")
  itk_wrap_template("${ITKM_F}${OutputVectorDim}" "${ITKT_F},${OutputVectorDim}")
itk_end_wrap_class()

itk_wrap_class("itk::Vector")
  itk_wrap_template("${ITKM_F}${OutputVectorDim}" "${ITKT_F},${OutputVectorDim}")
itk_end_wrap_class()

WRAP_TYPE("itk::Image" "I" "itkImage.h")
  foreach(d ${ITK_WRAP_IMAGE_DIMS})
    ADD_TEMPLATE("V${ITKM_F}${OutputVectorDim}${d}" "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}")
  endforeach()
END_WRAP_TYPE()

itk_wrap_class("itk::Image" POINTER)
  foreach(d ${ITK_WRAP_IMAGE_DIMS})
    itk_wrap_template("V${ITKM_F}${OutputVectorDim}${d}" "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}")
  endforeach()
itk_end_wrap_class()

itk_wrap_class("itk::ImageSource" POINTER)
  foreach(d ${ITK_WRAP_IMAGE_DIMS})
    itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image<itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}>")
  endforeach()
itk_end_wrap_class()

itk_wrap_class("itk::ImageToImageFilter" POINTER)
  foreach(d ${ITK_WRAP_IMAGE_DIMS})
    foreach(t ${WRAP_ITK_INT})
      itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}"
                        "${ITKT_I${t}${d}}, itk::Image<itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}>")
    endforeach()
  endforeach()
itk_end_wrap_class()

itk_wrap_simple_class("itk::ImageIOBase" )

itk_wrap_class("itk::ImageFileReader" POINTER)
  foreach(d ${ITK_WRAP_IMAGE_DIMS})
    itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}"
                      "itk::Image<itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}>")
  endforeach()
itk_end_wrap_class()

itk_wrap_class("itk::ImageFileWriter" POINTER)
  foreach(d ${ITK_WRAP_IMAGE_DIMS})
    itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}"
                      "itk::Image<itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}>")
  endforeach()
itk_end_wrap_class()

itk_wrap_class("itk::ImageFileWriter" POINTER)
  foreach(d ${ITK_WRAP_IMAGE_DIMS})
    itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}"
                      "itk::Image<itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}>")
  endforeach()
itk_end_wrap_class()

itk_wrap_class("itk::FirstOrderTextureFeaturesImageFilter" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
  foreach(t ${WRAP_ITK_INT})
    itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}"
                      "${ITKT_I${t}${d}}, itk::Image<itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}>")
    itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}"
                      "${ITKT_I${t}${d}}, ${ITKT_VI${ITKM_F}${d}}")
  endforeach()
endforeach()
itk_end_wrap_class()


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20170916/bb006272/attachment.html>


More information about the Community mailing list