Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Izaaner · Jun 16, 2016 at 04:18 PM · renderingrenderervoxelworld spacevolumetric

How to Volume Render from a Stack of 2D Slices and (Possibly?) Generate a Mesh?

I am looking to render a volume using a stack of 2D images, such as MRI data, and possibly generate a mesh from that data. Methods I have looked into for volume rendering with Ray Marching typically result in a volume not calculated in world space. I would need the object to render in World Space with other meshes woven in the semi-transparent volume, meaning setting a static render layer would not solve this to my knowledge.

Would it be possible to analyze the 2D image stack and create a mesh / detailed voxel mesh from the RGBA data, given the layer spacing?

Any information on techniques that would guide me towards an answer such as in-depth how-to for ray-marching for world-space rendering in Unity or efficient 3D mesh rendering from 2D image stacks would be greatly appreciated (the mesh generation does not need to be done at run-time on a build but the mesh would need to be saved out).

I apologize for ignorance on the details of the methods used to accomplish what I want to do and the terminology in advance but I am trying to explain in depth what I am trying to accomplish.

Thank you!

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Cherno · Jun 16, 2016 at 05:10 PM 0
Share

I don't know how ray-marching would help. I'd just go through each image (I suppose it's a Texture type) and then go through each pixel via GetPixel, and if the alpha value of the color is above 0, treat it as a solid space. Simultaneously, create a 3-dimensional int array that corresponds to the image sizes with the y dimension as the number of image layers.

Go through each cell in the array and if a cell is solid and check it's neighbors. If one is also solid, add the vertices of a face for that cube side to the mesh's vertex array.

It's basically how all the $$anonymous$$inecraft clones work. Basic voxel stuff.

avatar image Izaaner Cherno · Jun 16, 2016 at 05:47 PM 0
Share

Interesting, this follows what I have been looking into but few, if any, examples out there have dealt with image stacks (you are right, 2D textures (RGBA)) and have shown the fidelity I have needed. Are their any sources you could point me towards that would help me with examples? This is something that will be viewed from all angles, moved by the user, and clipped into so interior values/space matters, a Boolean approach will not necessarily work since there will be some variance of alpha with the medical image stacks.

Edit: I realize the second half of my reply is to the volumetric visualization in scene and not the mesh generation but the mesh generation based on values between 0 and 1 versus >0 would be very different right? Thresholds between 0 and 1 that generate varying meshes would be an interesting approach but I am not sure how to go that route.

A source I found for Voxel $$anonymous$$esh: http://alexstv.com/ and the older posts: http://studentgamedev.blogspot.com/2013/08/unity-voxel-tutorial-part-1-generating.html

avatar image Cherno Izaaner · Jun 16, 2016 at 09:45 PM 0
Share

The only thing you need to know is how to generate meshes from script, which is information that can be obtained from the Scripting API ($$anonymous$$esh class). Then it's just a matter of taking your 3-dimensional array and deciding wether a cell that is solid has any of the six possible faces that make up a cube.

avatar image MichaelB13 · Jan 27, 2017 at 12:24 PM 0
Share

Have you found out how to have a volume rendered 3D Texture interact correctly with other meshes? I'm currently struggling with this problem.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by mezzostatic · Jan 04, 2017 at 12:39 PM

Im working on something similar, i am coding point clouds from stacks of images to process them in a point cloud program or meshlab. edge detection depends on the image you start from, if it is BW or color, you have to decide what criteria you want.

then march along the top and bottom image, get all the pixels that represent an volume, then march through all the other layers and race through the edges and check out what pixels you want from there inthe point cloud/mesh and then march through the images themselves detecting every color which changes from B/W as a border or which is a certain shade as a threshold where vertices can be.

i've finished a code in BW, it's about 5 7 hours work i can send it along for 10 dollars i have my bank nagging me. regards.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by ceitel · Aug 30, 2017 at 07:23 PM

@Izaaner If it does not need to be done at run-time I would suggest freeware such as 3DSlicer (https://www.slicer.org/) which lets you do everything you've mentioned and save to an OBJ or STL file. If it needs to be done at run-time in Unity I'm still searching for an answer to this.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Dynamic Multi-pass texture splatting with shadows? 0 Answers

[Unity SRP] How do I clear 3d RW RenderTexture? 1 Answer

Blender/Unity dont show faces 2 Answers

Weird rendering on Android: some materials become black, some sprites are replaced 1 Answer

Volumetric Clouds Options Missing 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges