c++ - ITK in Python: SimpleITK or not? -


i have started work itk week simpleitk in python. though, currently, satisfied simpleitk, have noticed features such powell optimization scheme or oneplusevolutionary 1 not available in simpleitk. seems same landmark-based registration methods.

so, wondering if there way retrieve features available in itk (in c++) in simpleitk or if necessary perform own wrapping?

if not later learn c++ so!

thanks!

you correct. simpleitk limited in functionality. possible access entire itk library in python using wrapitk interface. old interface don't believe has been updated while. however, still possible compile new builds source , use wrapitk.

the process not smooth. have done build on windows machine in past , had noted of not-so-smooth-steps had encounter. i'll lay down here. since haven't mentioned os, i'm going go ahead explain setup windows. let's see if you're able , running.

  • itk-4.6 + python2.7 + cmake + vs2008 professional (all 32-bit)
  • nothing later vs2008 can compile gccxml, required generating python bindings
  • after configuring cmake, following flags need additionally set:
    • itk_wrap_python
    • itk_wrap_* (all types: float, double, etc.)
    • itk_build_shared_libs (gets automatically set if first flag set)
  • in vs2008, build in release mode only. number of projects in project explorer more 500. around 300-350 should built.
  • when building, make sure have accessible internet conection downloading gccxml (which downloaded after have started build in vs2008). there should no error while verifying download. if there is, might because of directory creation permission errors.
  • the project should built no errors
  • copy wrapitk.pth file itk build/wrapping/generators/python/release python/lib/site-packages
  • add following path variable:
    • c:\programlibs\itk\build2008\lib\release
    • c:\programlibs\itk\build2008\bin\release
    • c:\programlibs\itk\build2008\lib
  • now itk should work (below test python file can use run sanity check on build). except every time call itk.image first time in program or on python interpreter, there dozen warnings , take time execute that. known issue. once past this, it's smooth.

test file

import itk pixeltype = itk.uc imagetype = itk.image[pixeltype, 2] readertype = itk.imagefilereader[imagetype] writertype = itk.imagefilewriter[imagetype] reader = readertype.new() writer = writertype.new() reader.setfilename("<input image file location>") writer.setfilename("d:/output.png") writer.setinput( reader.getoutput() ) writer.update() 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -