Registering two 3D data sets

asked 2014-07-13 17:19:04 -0500

NuclearJon gravatar image

Hello,

I am working on a project and I need to register two 3D data sets in order to analyze the differences between them. More specifically, I am working on two sets of Computed Tomography images and want to register them in order to find a cancerous region if it exists. I have the data as separate image files that represent different slices (that is heights in the patient). My initial thought was to create a vector of Mat objects and simply import the different slices into the separate places in the vector. But I kept getting out of range error at run-time. So I abandoned that approach.

I was then reading through the documentation and it explained how to create an n-dimensional Mat object for just this purpose. But I can not figure out how to import the image files into that 3D Mat object once it is created.

So far I have the object created like:

int size[] = {128,128,128}; cv::Mat images(3,sizes,CV_8U,Scalar::all(0));

This in theory will create a Mat object that has 3 dimensions of size 128x128x128 that are all 8 bit unsigned integers, and then sets them all to 0. However I cannot find anywhere in the documentation where it explains how to set any data in this object.

Oh BTW, I am planning on using the "estimateAffine3D" function to do most of the heavy lifting in the registration part, but any suggestions on that would be helpful too.

As you might have noticed, or perhaps I have successfully hidden my ignorance, I am pretty green when it comes to coding. I've taken basic C++ classes, but most of the higher level stuff goes way over my head. So if you could be so kind as to dumb down your answers so that a child could understand them, that would be very helpful.

THANKS!!!

edit retag flag offensive close merge delete

Comments

1

for this kind of task, you may want to look at PCL, too.

berak gravatar imageberak ( 2014-07-14 00:35:09 -0500 )edit

Actually why are you matching 3D sets if you have sliced recordings? Do the recordings match in slice position? That would reduce it down to a 2D problem.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-14 05:50:17 -0500 )edit

I need to perform 3D registration, and can't assume that the same slice number from each data set is the same angle. So I have to look at the 3D object as a whole.

NuclearJon gravatar imageNuclearJon ( 2014-07-14 19:39:54 -0500 )edit

I've looked at PCL, but the person in charge of my project is requiring me to use OpenCV.

NuclearJon gravatar imageNuclearJon ( 2014-07-14 21:30:34 -0500 )edit

Actually it would be quite stupid that you would go for OpenCV, which focusses on 2D computer vision problems and stereo vision, besides PCL which has its main focus in efficiently registering point clouds. It is you who has to convince the person in charge that OpenCV is the wrong way to do this.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-15 02:34:12 -0500 )edit

The main issue is my algorithm is only a small part of a bigger program, and the rest of the program will focus on 2D images and manipulating them. So that is where the requirement arose. I will attempt to convince them that this is the wrong set of libraries to use for my part, however in case they still want me to use OpenCV, do you have any suggestions on how to approach this problem using OpenCV?

NuclearJon gravatar imageNuclearJon ( 2014-07-16 12:31:13 -0500 )edit

Its not because the other part of the project uses OpenCV as library that a small part cannot use PCL. They are perfectly compatible in a combined project.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-07-17 04:15:15 -0500 )edit