4

What are some libraries in Python that have the ability to read CT model files with extensions such as .vtk or .stl and perform 3D image registration with normal videos. I have found many softwares that have this ability but what I am looking for is not a program but a Python library such as Numpy or OpenCV, where all I need to do is import numpy or import cv2.

Made up example of what I want to do

  • Step 1 - Get the 3D CT model of a person's skull
  • Step 2 - Read the 3D CT model into Python
  • Step 3 - Get a normal video of a person standing still
  • Step 4 - Perform registration of the 3D CT skull and person's head from the normal video
  • Step 5 - Display the registration output

I have found a couple of Python libraries that "seem" to do this sort of thing but they do not have enough information in the library description to be sure that this is what I want. I am also open to using multiple libraries. Is there anyone who has done something similar to this and it would be great if someone with experience with any libraries could give me some recommendations, thanks. If there aren't any, I will also consider libraries in other languages.

What I have considered so far

  1. FW4SPL Libarary in C++
  2. MITK Library in C++
  3. MeVisLab Software in Python
  4. Elastix Library in C++
  5. SimpleElastix Library in Python
  6. ITK Library in C++
  7. SimpleITK Library in Python

For FW4SPL and MITK, I have been unable to successfully compile the source code due to new errors continuously occurring after debugging old errors. It seems that the occurrence of new errors will not stop occurring (I have spent a lot of time doing this and do not wish to continue anymore).

For MeVisLab, this is not a Python library such as numpy or opencv but it is a GUI which is also said to be programmable.

For Elastix, SimpleElastix, ITK and SimpleITK, they are indeed C++ and Python libraries which seem perfect but I am not sure if they provide the requirements of my application described above. Also, I am very confused about the relationship to one another.

Senyokbalgul
  • 1,058
  • 4
  • 13
  • 37
  • comment on reason for downvoting – Senyokbalgul Apr 02 '17 at 04:21
  • 1
    "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." ["What topics can I ask about here?"](https://stackoverflow.com/help/on-topic) – Tapio Apr 02 '17 at 20:12
  • 1
    @Tapio Sorry, I didn't realize that because I've seen quite a few questions asking for similar things that were well received. I will edit the question above to `describe the problem and what has been done so far to solve it`. – Senyokbalgul Apr 05 '17 at 01:14
  • 1
    Have you used [Slicer3D](https://www.slicer.org) before? This is a GUI, but it also allows you to write python scripts and is very powerful - [see tutorial](https://www.slicer.org/wiki/Documentation/4.0/Training#Slicer4_Programming_Tutorial) – KolaB Apr 07 '17 at 16:39
  • What do you mean by _registration of CT with person's head_? Don't you need fiducials for registering. I have personally used `Elastix` and it is pretty good for your purpose – Rick M. Apr 07 '17 at 17:58
  • @RickM. I mean, overlaying a 3D CT skull on top of a person's head in a normal video. Something like this for example http://campar.in.tum.de/twiki/pub/AMIARCS08/WebHome/fussX.jpg – Senyokbalgul Apr 08 '17 at 15:59
  • As you see in the image, there fiducials or markers which allow you to register. You can use ELASTIX for that purpose. – Rick M. Apr 08 '17 at 17:26
  • @Rick M. Would simpleelastix or simpleitk not work for this purpose? – Senyokbalgul Apr 09 '17 at 01:01
  • By ELASTIX I meant simple elastix – Rick M. Apr 09 '17 at 19:33
  • Here is an interesting link collection for registration libraries: http://pyimreg.github.io/ – Night Train Apr 06 '21 at 16:28

1 Answers1

3

I am playing with vtk and stl files for the first time. Your question drove me curious but I am clearly not experienced. I started looking into this before the above comment. I did not realize we were off-topic, sorry. So I give you my conclusions at this point, since there were built for sharing.

1) for .vtk files It turns out that most of the library I saw are for python 2.7 while I prefer the up to date version (3.5 for now). For 3.5 I finally adopted the version of ‘woodscn’ that seems promising, for coding it seems to me all the required info is on Reading a .vtk file with python

2) for .stl files the ‘nestly’ package from 'conda-forge’ looks good, with a typical example on https://github.com/fhcrc/nestly/blob/master/examples/basic_nest/make_nest.py

then you just have to write import vtk and import nestly in the python script.

hope this helps

Community
  • 1
  • 1
Stéphane
  • 1,389
  • 3
  • 13
  • 34