Jump to content

Convert Slice images to Volume


hossein1990

Recommended Posts

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 2
  • Thanks 1
Link to comment
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

Link to comment
Share on other sites

  • 1 year later...
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

Link to comment
Share on other sites

  • 1 year later...
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. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...