Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create a better 3d photon viewer to integrate in the pfe #83

Open
X3msnake opened this issue Aug 7, 2018 · 47 comments
Open

create a better 3d photon viewer to integrate in the pfe #83

X3msnake opened this issue Aug 7, 2018 · 47 comments
Labels
investigate Issues that adress a hipothesis or need further insights in order to be resolved

Comments

@X3msnake
Copy link
Member

X3msnake commented Aug 7, 2018

https://github.com/ephtracy/voxel-model/blob/master/MagicaVoxel-file-format-vox-extension.txt

if we implement this file format export we can open photon files in this open source voxel Photoshop and edit the photon sliced files :) or simply use the viewer

https://ephtracy.github.io

@X3msnake
Copy link
Member Author

X3msnake commented Aug 7, 2018

Since MagicaVoxel is not Open source

Best alternative will be Goxel and VoxelShop

Voxelshop
https://www.youtube.com/watch?v=SQJiifHfZPE

Goxel
https://www.youtube.com/watch?v=h-52oe4P6jc

@X3msnake X3msnake added the investigate Issues that adress a hipothesis or need further insights in order to be resolved label Aug 7, 2018
@X3msnake
Copy link
Member Author

X3msnake commented Aug 7, 2018

list of 22 voxel editors

https://www.slant.co/topics/1544/~voxel-editors

@X3msnake
Copy link
Member Author

X3msnake commented Aug 7, 2018

image

https://developer.nvidia.com/gvdb

@X3msnake
Copy link
Member Author

X3msnake commented Aug 7, 2018

Voxel-Engine
A CPU based sparse voxel octree renderer.

https://github.com/bcmpinc/voxel-engine
https://bcmpinc.wordpress.com/

@X3msnake
Copy link
Member Author

X3msnake commented Aug 7, 2018

Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.

https://github.com/bkaradzic/bgfx

image

@X3msnake
Copy link
Member Author

X3msnake commented Aug 7, 2018

https://github.com/Phyronnaz/VoxelPlugin

UNREAL ENGINE VOXEL PLUGIN

@X3msnake
Copy link
Member Author

X3msnake commented Aug 7, 2018

GIGASPACE
http://gigavoxels.inrialpes.fr/download.html

A CUDA/GLSL library for the efficient 3D real-time rendering of highly detailed scenes.

Needs a Fermi processor

@X3msnake
Copy link
Member Author

X3msnake commented Aug 8, 2018

https://github.com/armory3d/armory_docs
Armory is a game engine with full Blender integration, turning it into a complete game development tool.

Game Templates
Archviz Templates
Examples
Global Illumination
Voxel World
Material Vault

@X3msnake
Copy link
Member Author

X3msnake commented Aug 8, 2018

Zmorph apparently uses Voxel thech in their slicer

https://voxelizer.com/

source: https://www.reddit.com/r/3Dprinting/comments/642nwq/voxelbased_file_formats/

@X3msnake
Copy link
Member Author

X3msnake commented Aug 8, 2018

Monolith Is free A Voxel-Based Modeling Engine For Multimaterial 3D Printing
http://www.monolith.zone/examples/

@X3msnake
Copy link
Member Author

X3msnake commented Aug 9, 2018

https://medium.com/retronator-magazine/pixels-and-voxels-the-long-answer-5889ecc18190

@X3msnake
Copy link
Member Author

X3msnake commented Aug 9, 2018

https://github.com/html5rocks/www.html5rocks.com/tree/master/content/tutorials/webgl/million_letters
https://www.html5rocks.com/en/tutorials/webgl/million_letters/

one idea is to use points or particles to render the photon model and use a animated Cube sprite that follows the isometric camera projevtion

@X3msnake X3msnake changed the title implement vox import/export file format create a better 3d photon viewer to integrate in the pfe Aug 9, 2018
@X3msnake
Copy link
Member Author

X3msnake commented Aug 9, 2018

threeoctree.js (r60)
(sparse + dynamic) 3D spatial representation structure for fast searches
The aim of this project is to create a fully featured search tree for the THREE.js WebGL library.

This build is stable up to THREE.js ~r60
(updates to latest THREE build on hold as my time is required on other projects)

https://github.com/collinhover/threeoctree

@X3msnake
Copy link
Member Author

X3msnake commented Aug 9, 2018

WHAT IS VOLUME RENDERING?
Unlike traditional rendering uses triangles to display 3D graphics, volume rendering uses other methods such as Volume Ray Casting. This image-based method renders a 3D scalar field into a 2D image by casting rays along the 3D volume. Each pixel we see on the screen is the result of a ray that is going through the cube and getting intensity samples from the voxels at regular intervals.

http://www.lebarba.com

@X3msnake
Copy link
Member Author

X3msnake commented Aug 9, 2018

Voxeltastic!
Ever need to ray trace your 3D images in some way that's more interested than slices? Don't want hard surfaces? Wanna do it in a web browser for the world to see? Try Voxeltastic! It's a A WebGL-based Raytraced Voxel Engine with Transparency. If you'd like a brief summary of what the default interface is, please click this link:

https://github.com/cnlohr/voxeltastic

@X3msnake
Copy link
Member Author

X3msnake commented Aug 9, 2018

This is/will be a real-time OpenGL Sparse Voxel Oct-tree Raycaster. It makes heavy use of GPU compute.

http://danpburke.blogspot.com/2012/11/one-shiny-dragon.html

Voxel Rendering Test
https://www.youtube.com/watch?v=xW2YZBkk53I

SourceCode
https://github.com/burito/voxel

@X3msnake
Copy link
Member Author

X3msnake commented Aug 9, 2018

VoxCad

VoxCAD (Voxel CAD) is a cross-platform open source voxel modeling and analyzing software. VoxCAD includes the Voxelyze 3D dynamics engine with large deformations, collision detection, multiple materials, volumetric actuation, etc. Check out the

https://sites.google.com/site/voxcadproject/file-cabinet

@X3msnake
Copy link
Member Author

X3msnake commented Aug 9, 2018

Voxelengine3 is a ThreeJS WebGL voxel engine. The code has NOT been polished and is provided "as is". There are a lot of code that are redundant and there are tons of improvements that can be made.

https://www.findbestopensource.com/product/lallassu-voxelengine3

@X3msnake
Copy link
Member Author

X3msnake commented Aug 9, 2018

http://scholarworks.rit.edu/theses/9378/

Current technology allows MRI and other patient data to be translated into voxel-based 3D models for the purpose of visualization. However, these voxel models are extremely complex and are not suitable for rapid real-time manipulation. For true “on-the-fly” interactivity, polygon-based models must be hand-built using other methods and imported into a game engine.This project develops an algorithm to translate complex datasets into optimized models for real-time interactivity without sacrificing accuracy of the original imaging modality.

1.Osirix – Advanced Open-Source PACS Workstation DICOM Viewer http://www.osirix-viewer.com/

  1. 3D Slicer- A multi-platform, free and open source software package for visualization and medical image computing http://www.3dslicer.org

3.MudBox – Autodesk¨ Mudbox™ 3D digital sculpting and digital painting software http://usa.autodesk. com

4.3D Coat – Retopologizing and 3D sculpting software http://3d-coat.com

5.MAYA - Autodesk¨Maya¨ 3D animation software delivers an end-to-end creative workflow with compression tools for animation, modeling, simulation, visual effects, rendering, matchmoving, and compositing on a highly extensible production platform http://usa.autodesk.com

6.Unreal Engine 3 – a complete development framework for PCs, iOS, Xbox 360¨, and PlayStation¨ 3, providing a vast array of core technologies, content creation tools and support infrastructure http://www. unrealengine.com/

@X3msnake
Copy link
Member Author

X3msnake commented Aug 9, 2018

https://github.com/Gforcex/OpenGraphic/blob/master/README.md

OpenGraphic
Graphic Engine & Game Engine open source list!

@NardJ
Copy link
Collaborator

NardJ commented Aug 13, 2018

What could help is, is erode the model to a shell width of 1 voxel and store the voxels as 3d coord's instead of storing complete voxel array.

@NardJ
Copy link
Collaborator

NardJ commented Aug 19, 2018

@Photonsters/photonsters
I almost have a voxel viewer in PFE, but I can't get my model to light properly. All sides have the same light intensity. The following is an octagon with a thickness, however the side walls have the same lighting intensity as the top walls. (Don't know about the light blue artifact line at the bottom)
image

My points array is a flat/1D array of triangle corner points. My normals array is a flat/1D array of normal 3d-vectors for each triangle. I feel like I am missing something really basic about using OpenGL. Any help is appreciated!

The following code is in the init procedure:

# ===============================================
# First add points to buffer
# ===============================================
points = numpy.array(points,dtype=numpy.float32)
points=points * scale
self.voxelPtBufferLen = len(points) // 3

glEnableClientState(GL_VERTEX_ARRAY)
self.voxelPtBufferIdx = glGenBuffers(1)
dataSizePt = arrays.ArrayDatatype.arrayByteCount(points)

# print ("datasize",dataSize)
glBindBuffer(GL_ARRAY_BUFFER, self.voxelPtBufferIdx)
glBufferData(GL_ARRAY_BUFFER, dataSizePt, points, GL_STATIC_DRAW)

glDisableClientState(GL_VERTEX_ARRAY)

# ===============================================
# Second add normals for each triangle to buffer
# ===============================================
normals = numpy.array(normals, dtype=numpy.float32)
self.voxelNmBufferLen = len(normals)

glEnableClientState(GL_NORMAL_ARRAY)
self.voxelNmBufferIdx = glGenBuffers(1)
dataSizeNm = arrays.ArrayDatatype.arrayByteCount(normals)

glBindBuffer(GL_ARRAY_BUFFER, self.voxelNmBufferIdx)
glBufferData(GL_ARRAY_BUFFER, dataSizeNm, normals, GL_STATIC_DRAW)

glDisableClientState(GL_NORMAL_ARRAY)

And in the loop I have the following code to draw the model

colorFront = (0.1, 0.3, 0.6)
colorBack = (1, 0.3, 0.3)
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, (0.2, 0.2, 0.2))
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (0.8, 0.8, 1.0))
glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, 50.0)

glEnable(GL_DEPTH_TEST)
glEnable(GL_NORMALIZE)


glLight(GL_LIGHT1, GL_AMBIENT, (0.3, 0.0, 0.0, 1))
glLight(GL_LIGHT1, GL_DIFFUSE, (0.6, 0.0, 0.0, 1))
glLight(GL_LIGHT1, GL_SPECULAR, (0.9, 0.0, 0.0, 1))
glLight(GL_LIGHT1, GL_POSITION, (10,10,10))
glLight(GL_LIGHT1, GL_SPOT_DIRECTION, (-10,-10,-10))
glEnable(GL_LIGHT1)

glBegin(GL_QUADS)
glColor3f(1.0,1.0,0)
glVertex3f(10, 10, 10)
glVertex3f(12, 12, 12)
glVertex3f(10, 12, 12)
glVertex3f(12, 10, 12)
glEnd()

glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
glColor3fv(colorFront)

# DRAW VOXELS
glEnableClientState(GL_VERTEX_ARRAY)
glBindBuffer(GL_ARRAY_BUFFER, self.voxelPtBufferIdx)
glVertexPointer(3,GL_FLOAT,0,None)

glEnableClientState(GL_NORMAL_ARRAY)
glBindBuffer(GL_ARRAY_BUFFER, self.voxelNmBufferIdx)
glNormalPointer(GL_FLOAT, 0, 0)

glDrawArrays(GL_TRIANGLES, 0, self.voxelPtBufferLen)

glDisableClientState(GL_VERTEX_ARRAY)
glDisableClientState(GL_NORMAL_ARRAY)

@NardJ
Copy link
Collaborator

NardJ commented Aug 19, 2018

Solved. We have a voxel viewer :-)

image

There are still bugs too remove and coloring of model should be enhanced.,

@X3msnake
Copy link
Member Author

X3msnake commented Aug 19, 2018 via email

@X3msnake
Copy link
Member Author

X3msnake commented Aug 20, 2018

@X3msnake
Copy link
Member Author

@X3msnake
Copy link
Member Author

X3msnake commented Aug 20, 2018

@X3msnake
Copy link
Member Author

X3msnake commented Aug 22, 2018

@NardJ
Copy link
Collaborator

NardJ commented Aug 23, 2018

Cool stuff. Maybe something for the next version. (First I am planning to complete the slicer and voxel viewer itself.)

@X3msnake
Copy link
Member Author

http://borg.ensc.sfu.ca/research/fdoct-gpu-code.html

In this paper, we describe how to highly optimize a CUDA based platform to perform real-time processing of optical coherence tomography interferometric data and 3D volumetric rendering using commercially-available cost-effective graphic processing units (GPUs). The maximum complete attainable axial scan processing rate (including memory transfer and displaying Bscan frame) was 2.24 megahertz for 16 bits pixel depth and 2048 FFT size; the maximum 3D volumetric rendering (including B-scan, en face view display, and 3D rendering) rate was ~23 volumes/second (volume size:1024x256x200). To the best of our knowledge, this is the fastest processing rate reported to date with a single-chip GPU and the first implementation of realtime video-rate volumetric OCT processing and rendering that is capable of matching the acquisition rates of ultrahigh-speed OCT.

@X3msnake
Copy link
Member Author

processing discourse octree library
https://github.com/thwegene/OCT/blob/master/README.md

@X3msnake
Copy link
Member Author

https://github.com/cagcoach/BlenderPlot/

A script for plotting voxel diagrams using Blender

Video Tutorial: https://www.youtube.com/watch?v=vrxsk6D1KhQ&feature=youtu.be

@X3msnake
Copy link
Member Author

https://www.paraview.org/overview/

ParaView is an open-source, multi-platform data analysis and visualization application. ParaView users can quickly build visualizations to analyze their data using qualitative and quantitative techniques.

Can read Voxel Data in XYZ format

https://www.youtube.com/watch?v=UwKFg0yOlCA&t=45s
https://www.youtube.com/watch?v=jbq26vWdNdE

@X3msnake
Copy link
Member Author

X3msnake commented Sep 10, 2018

http://fiji.sc/
Fiji is an image processing package—a "batteries-included" distribution of ImageJ, bundling a lot of plugins which facilitate scientific image analysis.

https://imagej.net/plugins/3d-viewer/index.html
https://imagej.net/3D_Viewer
This plugin offers hardware-accelerated visualization possibilities for image stacks, using the Java 3D library. Stacks can be displayed as texture-based volume renderings, surfaces or orthoslices.

image

@X3msnake
Copy link
Member Author

PAPER: Voxel-based Solid Models: Representation, Display and Geometric Analysis
https://pdfs.semanticscholar.org/b2ec/9d0c9fadba4174e1ae5d29fccb7b344dc365.pdf

@X3msnake
Copy link
Member Author

X3msnake commented Jan 8, 2019

following this thread in FB group here is another cat scan software to investigate

https://www.cti.gov.br/pt-br/invesalius/nova-versão-invesalius-31

This one does allow for importing arbitrary images into a full 3D reconstruction
Youtube

@X3msnake
Copy link
Member Author

X3msnake commented Jan 8, 2019

OrtogOnBlender
add-on: Import DICOM voxel data on Blender

@X3msnake
Copy link
Member Author

X3msnake commented Jan 9, 2019

@NardJ
Copy link
Collaborator

NardJ commented Jan 9, 2019

Voxel Engine in C++

@NardJ
Copy link
Collaborator

NardJ commented Jan 9, 2019

BinVox Editor could also be a good starting point. Some python code at https://github.com/dimatura/binvox-rw-py.

@X3msnake
Copy link
Member Author

@NardJ Invesalius is actually written in python

https://github.com/invesalius/invesalius3/tree/master/presets/raycasting

@NardJ
Copy link
Collaborator

NardJ commented Jan 12, 2019

Goxel claims to be unlimited, but upon testing a large size it crashes.

MagicaVoxel won't allow larger objects (in the editor) than 126x126x126. It seems that it is possible to create a world/scene with multiple objects and this of larger dimensions. MagicaVoxel claims being limited to rendering volumes of 2048x2048x1024 (But not that many solid voxels.)

(Qubicle costs money.)

@NardJ
Copy link
Collaborator

NardJ commented Jan 13, 2019

Did a test converting Photon file to STL file. It works, but takes a long time and generates large files (GBs). Slic3r could not load file due to memory issues and crashed. Best route for voxelviewer is raycaster.

@NardJ
Copy link
Collaborator

NardJ commented Jan 13, 2019

Another program to reconstruct a model from slices: https://www.slicer.org/, but slow/unusable on my laptop.

@X3msnake
Copy link
Member Author

X3msnake commented Jan 13, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Issues that adress a hipothesis or need further insights in order to be resolved
Projects
None yet
Development

No branches or pull requests

2 participants