Jump to content
hossein1990

Convert Slice images to Volume

Recommended Posts

Hi there

 

Is there a way to make a volume from some image slices in Houdini?

like bring CT scan slices to a volume and see it in the 3d volume

Share this post


Link to post
Share on other sites

That should be fairly simple do achieve as long as you have a your images in an ordered list (img_1.tif, img_2.tif, img_3.tif, ...)
in a volume wrangle, use the texture function to read the image RGB values > luminance to convert to greyscale
and set the volume density using that value. getbbox, to convert x,z to u,v coordinates and the y coordinate as your image index.
something like this:

// number of images
int lastImageIndex=30;
// get bounds
vector bmin,bmax;
getbbox(0,bmin,bmax);
// create u,v,imageIndex(y coordinate)
float u = fit(@P.x,bmin.x,bmax.x,0,1);
float v = fit(@P.z,bmin.z,bmax.z,0,1);
int imageIndex = int(fit(@P.y,bmin.y,bmax.y,0,lastImageIndex));
// create imageName, sample RBD, convert to greyscale and write to density
string imageFileName = “/path/image_”+itoa(imageIndex)+”.tif”;
vector color = texture(imageFileName, u, v, "pixelblur", 2.0);
float greyscale = luminance(color);
@density = greyscale;

hope that makes sense.

Edited by bunker
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

you can also just create COP2 Network SOP, set method to Volume

and inside File COP reading your sequence of files

the output of cop2net will be your volume 

  • Like 1

Share this post


Link to post
Share on other sites

cool, I didn't know about the "COP2 Network SOP"
How do you load more than one image at a time though?

Share this post


Link to post
Share on other sites

it automatically loads all images of the sequence as z axis of the volume

  • Like 2

Share this post


Link to post
Share on other sites

Thank you both (bunker & anim) for the answers.

but I`m quite new in Houdini and I don`t know how to do it with VEX or COP2...

It would be great if you can explain in a simple way or link me to a video 

when I search about slices to a volume just brings me volume to slices which I don't need it...

In fact, I need to know these:

1- Import image slices in Houdini (they are already ordered and greyscale)

2- Show them as volume

Share this post


Link to post
Share on other sites
On 1/13/2019 at 9:16 AM, mestela said:

example mri slice sequence, and a houdini scene to read it into a volume and display it.

capsicum.zip

Hey this is great, thanks for the file. I was wondering when I try to render the volume visualizer I only end up with a cube of particles -- not the volume data that appears in the viewport. What is the best way to render a volume visualizer? Sorry pretty new to Houdini

Share this post


Link to post
Share on other sites

There's an entagma tutorial about that, I made a brain out of scans following it :

 

Share this post


Link to post
Share on other sites
On 1/14/2019 at 3:16 AM, mestela said:

example mri slice sequence, and a houdini scene to read it into a volume and display it.

capsicum.zip

When importing an image stack using the COP2 network is it possible to import Cd and control the distance between the slices in the resulting volume?

I am trying to create a volume from DICOM data images that have been post processed and colored. I need to create a volume from these that keeps the Cd from the image stack.

I am currently using a loop to do this that is pretty much the same as what is done in the Entagma tutorial above, but this COP2 network method could be much more efficient for my needs.

Fairly amateur Houdini user here, using it for research into voxel printing. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×