Help on Live Sectioning- batch processing


#1

Hello Everyone,

I am an medical student with little knowledge of C++ & 0 knowledge of 3d softwares. So gurus & experts please bear with me.

I need to know how to:-
convert STL file (or any other 3d format suited for this purpose) into a series of cross-section images, as in the case of live-sectioning, using scripting/programming.

To better understand my needs, take a look at this image.

Let us assume a vector V, perpendicular to which is the sectioning plane we need.
“v_co-ordinate” is the z co-ordinate of tail of V vector, origin by default
"v_angle" is angle of V from xy plane, 90 degree by default
"v_magnitude" is the distance along V vector at which the section plane must be plotted/obtained/read

I need guidance for writing something like this-

    int split_3d_object(char *fileName, float v_magnitude, float v_co-ordinate=0, float v_angle=90)
    {    //fileName is name of source STL file
        
        /*
         code to get a single cross section (in .jpg or any other format)
         & I can apply for loop, so don't bother with that :P
        */
     return 0;
    }

The output image should look something like this.
but it is extremely important that user can define orientation of sectioning plane.

I researched a little more & learned ways to automate live sectioning in CATIA, but I need to
do it via script for implementation purposes.
I am open to any programming language & any 3d software for getting this done.


(Menno Deij - van Rijswijk) #2

For some reason your image links do not work here.


(Dale Fugier) #3

What is “live sectioning?”

What will you do with the results of sectioning? When sectioning meshes, you are going to end up with one or more polylines…

You image attachments don’t work here either. A sample model might be nice (too)…


#4

Here’s the link to the images

  1. http://postimg.org/image/k2627c7a5/
  2. http://fullbodymriscan.com/wp-content/uploads/2013/11/Full-Body-MRI.jpg

thanks for the alert :slight_smile:


#5

Wow & I thought you people were actually good for help . . .


#6

Well, first of all 3D models are not like medical imaging. Medical imaging takes a series of “slices” through human tissue and creates an image file for each slice, with the range from black to white indicating differences in density. Those images do not constitute a 3D model file, there is software available to convert from a set of image files (such as an MRI) to a 3D model format, but the user still needs to decide what density threshold will form the “shell” of the model - depending whether you want to see bone, soft tissue, etc.

A 3D CAD model such is produced by Rhino or other software is just a “shell”. It is an outer skin (often closed, but not required) that represents the outer surface of the object. This outer skin can be represented by mathematically defined surfaces (BRep or Boundary Representation), Polygon meshes (such as an STL) or Subdivision surfaces (sort of like a hybrid between meshes and surfaces). None of these methods of representation have any “material” inside the shell, they are just a boundary that encloses space.
There is a 4th method of representing objects in 3D, that would be Voxels, which are perhaps best described as 3D pixels. This might be the only way to accurately represent a real medical scan with differing interior densities. Rhino, like most 3D CAD software, does not support voxels currently.

In any case, if you have an STL, you can certainly slice it in any way you want in Rhino, either manually with standard Rhino commands like Contour, or by using with scripting to automate the task. For “dynamic” sectioning, it should be possible to use the Grasshopper plug-in in Rhino, whereby you could set up a definition which could control angle, number of slices etc and see a real-time preview as you change the parameters. But in any case with an STL (or any other “shell” model) you will only have the outer boundaries of each slice.

HTH, --Mitch


#7

Thanks @Helvetosaur. Shallow of me for mockery :frowning:


#8

It’s possible to cancel posts in here if you really feel bad :smile:


(Menno Deij - van Rijswijk) #9

Maybe you have more luck with the open source ITK toolkit, see

http://www.itk.org/

It seems to be more suited to your needs if I read your and @Helvetosaur’s messages correctly.