Page 2 of 3
Re: CT/MR scans > 3D viewer
Posted: Tue May 06, 2014 11:27 pm
by IdeasVacuum
Mythos, we are not trying to give an image depth (2D --> 3D). What we get from a scan is several 2D slices. We create/inherit points on those planar slices. The slices are a distance apart (3.1mm) and so the points are 3D, but each group of points belonging to a slice stay on their respective slice plane.
Re: CT/MR scans > 3D viewer
Posted: Tue May 06, 2014 11:46 pm
by Mythros
You would have to show me in the code how this idea works. I would understand much better with an example.
Re: CT/MR scans > 3D viewer
Posted: Tue May 06, 2014 11:58 pm
by IdeasVacuum
Just take a look at Marc's images in this post, especially the one of his mum as you can clearly see slicing.
Re: CT/MR scans > 3D viewer
Posted: Wed May 07, 2014 5:35 am
by marc_256
Hi Mythros,
Let say, we do a CT scan from a part of the body,
with was for my mother the abdomen / intestinal canal
So, the zone => 150 images x 3.1mm distance => +-450 mm body part.
It is like you cut the body in 2 parts and look on top of it.
And you take a picture of what you see.
What I do,
1 ) I load first (gray-scale) image (518x518 pixels)
2 ) Read the color info/pixel (x = 0...517, y = 0...517) = 268324 px/image
3 ) go to step 1 till last image
4 ) create the 3D pointed mesh with (518px*518px/image * 150 images = 40248600 3D points in the mesh) xyz data.
5 ) I select what I want to see, like above, you see the skeleton.
6 ) I can select zones/parts in the 3D point/mesh,
- the yellow cube is the overall outside
- the blue cube is the selected transparency/cut away zone
- the red cube is the colored zone
what you can see here
http://www.marc-systems.be/new_2010/Vie ... amples.htm
Some, are my fathers cancer (red colored)
9) What I do now, is to write some contrast algorithms to highlight some organs ...
So, I created a 3D pointed mesh, that I can scale/rotate
But there is my problem,
rotate the pointed mesh is ok,
but when I scale/zoom, I get this moire effect...
And that is the goal of the program, to look inside the organs and see differences in the textures, deformations
or abnormal models.
Some info about Scanner:
http://en.wikipedia.org/wiki/Medical_imaging
My mother is home since yesterday, so I have to look after her,
but I go clear up the source and create some demo version to understand the results.
Re: CT/MR scans > 3D viewer
Posted: Wed May 07, 2014 11:19 am
by IdeasVacuum
Hi Marc
but when I scale/zoom, I get this moire effect...
I assume the scale/zoom is done via the Camera settings. Might the moire effect effect be a GPU issue? Have you tried it on another PC?
Re: CT/MR scans > 3D viewer
Posted: Wed May 07, 2014 11:52 am
by marc_256
@IdeasVacuum
Yes, I move the camera closer or further away from the object (pointed mesh),
Now, but I will test this with my other (fathers) laptop and desktop PC.
If I have some time !!, I go make some demo .exe file, so if you have some time,
will you test this for me on your pc ?
For now info:
Windows 8.1 x64
Purebasic 5.22 LTS final x64
I go to compile it with purebasic 5.22 LTS / 32 bits PC also ...
Re: CT/MR scans > 3D viewer
Posted: Wed May 07, 2014 1:28 pm
by marc_256
The transparency/contrast algorithm used on a cut away part of the body scans.
the best result I have for now.
You can see the liver inside, with the cancer in black.
Re: CT/MR scans > 3D viewer
Posted: Wed May 07, 2014 2:28 pm
by IdeasVacuum
Hi Marc. I'd be delighted to test the exe for you.
Edit: If you pm me, I can give you access to my ftp.
Re: CT/MR scans > 3D viewer
Posted: Wed May 07, 2014 6:46 pm
by Samuel
marc_256 wrote:
but when I scale/zoom, I get this moire effect...
Just out of curiosity what material filtering mode are you using? You could play around with
MaterialFilteringMode(#Material, Mode [, MaxAnisotropicValue])
to see if the effect disappears or lessens.
Re: CT/MR scans > 3D viewer
Posted: Wed May 07, 2014 8:43 pm
by marc_256
Hi Samuel,
I used this 2 filtering modes:
MaterialFilteringMode(1, #PB_Material_Trilinear)
MaterialFilteringMode(1, #PB_Material_Anisotropic, 8 )
with the same results.
Re: CT/MR scans > 3D viewer
Posted: Fri May 09, 2014 6:34 pm
by marc_256
This is a test program of creating 3D images in a canvas-gadget,
is very slow, every 3D calculation is made in CPU/FPU.
But this gives some opportunity to manipulate the image data.

Re: CT/MR scans > 3D viewer
Posted: Fri May 09, 2014 7:06 pm
by Mythros
@marc_256: Can you please release the source code?
Thank you VERY much!
Have a nice day!
Re: CT/MR scans > 3D viewer
Posted: Fri May 09, 2014 8:45 pm
by marc_256
Mythros wrote:@marc_256: Can you please release the source code?
Thank you VERY much!
Have a nice day!
Hi Mythros,
I will one day,
but before I do this, I want to clear up the prototype source.
So we can start with a cleaned version we can build on.
I find it to dangerous to start with a buggy source and build on that.
And I go put every step in separated procedures, so it becomes clear for every participant.
Secondly, I will use openGL so we can build multi platform.
For now, see it as a open project, and in a while it becomes an open source...
Re: CT/MR scans > 3D viewer
Posted: Fri May 09, 2014 8:56 pm
by Mythros
marc_256 wrote:Mythros wrote:@marc_256: Can you please release the source code?
Thank you VERY much!
Have a nice day!
Hi Mythros,
I will one day,
but before I do this, I want to clear up the prototype source.
So we can start with a cleaned version we can build on.
I find it to dangerous to start with a buggy source and build on that.
And I go put every step in separated procedures, so it becomes clear for every participant.
Secondly, I will use openGL so we can build multi platform.
For now, see it as a open project, and in a while it becomes an open source...
YAY! Thank you VERY much for doing this! I APPLAUD you for turning an image into a full 3d model!
I've been trying to do this for YEARS!
Thanks again, and have a GREAT afternoon!
Sincerely,
Mythros
Re: CT/MR scans > 3D viewer
Posted: Mon May 12, 2014 9:15 am
by djes
Hello Marc, sorry for your family. I've seen your topic and I'm interested because I've tried to do the same thing by the past with the result of a topographic 3d scanner (topology of a cave). I've not coded anything, just using some software, but not with good result, so I gived up. Anyway, I've seen some good 3d models that let me think there's already some 3d software that is doing the job, but not freely available by now. They compute what is knows as a
Delaunay Triangulation, you surely already know that. But first (or after), it could be useful to reduce the point number. There's also some good algo to do that. In your particular case, I imagine there's some thickness of the organs that should help to determine if you're "inside" or "outside". At this point, the polygon (with a normal) and the closed shape seems necessary to me...