Voxel head in flash
22 de Julio del 2008
(versión en castellano abajo)
Mr. Doob, a Flash expert and a great graphic designer shown me some days ago some voxel experiments he was doing with Actionscript 3. I have very few idea (nothing at all) of Flash, but I remembered some voxel head renderer I did years ago as a Windows executable and thought it could be done with a reasonable speed in Flash too. So, I asked Mr. Doob if he wanted to help me with the port, and here it is.
It is medical data, a CT scan I got here. It was resampled to 512×512x512 and then coloured with radiosity. It looks a bit creepy in the mouth; these spikes are interferences caused by the tooth.
You can see the source code here.
Read the article Mr. Doob wrote about our creation.
Español
Mr. Doob, experto en Flash y genial diseñador gráfico, me mostró hace unos días unos experimentos de voxels con Actionscript 3 en los que estaba trabajando. Yo apenas se nada de Flash, pero recordé un renderizador de voxels que hice como ejecutable Windows hace años, y pensé que se podría portar y conseguir una velocidad razonable. Se lo comenté a Mr. Doob, y aquí lo tenéis.
Los datos son médicos, un tac que encontré aquí. Lo redimensioné a 512×512x512 y lo coloreé con un algoritmo de radiosity para voxels. Se que da un poco de miedo, pero los agujeros y salientes cercanos a la boca son sólo distorsiones producidas por los dientes en el tac.
El código fuente está disponible aquí.
Neat and the code is dead simple.
Any idea how it would perform using polar coordinates instead ? You would gain 1 ADD and 1 MUL per pixel. I gainned a lot that way when I played with the RADIOHEAD pointcloud in JavaScript. I rendered 6485 dots at 20fps in Opera 9.51 using Canvas.
RESPECT! magnificient even the head looks pretty scary
very impressive :)
congratulations to both of you and thanks a lot for sharing the code.
Has probado a usar un ByteArray y luego una transferencia en bloque con setPixels(rect:Rectangle, inputByteArray:ByteArray). Yo creo que ganarías algo de velocidad: a mi por lo menos escribir los pixeles en un ByteArray y luego usar setPixels me funcionaba mejor que usar setPixel para cada pixel.
Simplemente ten cuidado de hacer un seek a cero antes porque sino da error.
Santi:
Acabo de hacer unas cuantas pruebas de velocidad y el setPixels es mas lento. Bueno, lo que es lento es modificar el byteArray, ya sea usando byteArray[count++] = a; byteArray[count++] = r; … o byteArray.writeUnsignedInt(color). Siempre van mas rapido que hacer un setPixel(); Al parecer, en flash10, tendremos el setVector en el bitmapData con el que se podra mejorar un poco esto.
Hello, you should take another kind of head ct scan. The dental artefact can be avoid a little with a soft reconstruction filter made by the ct scan.
Estáis locos! thumb up
(leave the teeth alone, they rule)
how convert in .v ?? Use the MRIcro ?
Hola! mi primera vez aqui..
Este swf me pareció..:
Soberbio!!
It’s dreat! Realy.
My question: I see in the code - that it is download “data.v” file and than make parsing. How to get this type of file from datasets you’v point?
Thanks.
[…] de interes: http://mrdoob.com/blog/post/571 http://www.romancortes.com/blog/voxel-head-in-flash/ […]
[…] http://www.romancortes.com/blog/voxel-head-in-flash/ Probablemente el 3D más detallado en flash hasta la […]