Computer Vision News - December 2016
Every month, Computer Vision News shows you a nice trick that will make your work easier. This time, our engineers show how you can share interactive, animated 3D figures, for instance of medical scans, by making them viewable in browser . To do this, we will use the x3mesh_deform function written by Benjamin Irving , which you can download here . Let’s demonstrate this x3mesh_deform by using our Matlab kidney visualization (follow the link to find it as the Trick of the Month in Computer Vision News of July ); but this time, we will visualize it and animate it via HTML in the browser. The following Matlab code creates a mesh (comprised of faces and vertices) to construct the object that needs to be visualized; it then calls the x3mesh_deform function to generate the HTML file: Line 1: the Matlab code takes as input the kidney segmentation from a CT scan (kidneyImage) - which is a 3D matrix with positive Hounsfield Unit (HU) values inside the kidney and zero elsewhere. Line 4: we call isosurface the Matlab’s built-in function for computing the mesh for a given threshold pixel value (isoVal). Setting the isoVal to 1 means that all pixels with positive values will be included in the mesh that envelops the segmentation; this will give us the kidney boundaries, since our kidney segmentation (kidneyImage) has a greater than zero values (HU) inside the kidney and zero outside. Lines 6-8: so far, we have generated a static mesh; now we will animate the image by generating a second mesh and the animation will morph from the first mesh to the second and back. To do so, we will create a second set of vertices to define the second mesh. This is done by defining a mesh 90% of the size of the first mesh. Lines 11-12: we call the x3mesh_deform function which takes as its input the faces and vertices of the first mesh and the vertices of the second mesh (i.e. the animation will flow from one set of vertices to the other). HTML_FILE_NAME defines the name of the html output file. 14 Computer Vision News Trick Web Tools for Visualization Trick
Made with FlippingBook
RkJQdWJsaXNoZXIy NTc3NzU=