How to export bones of a dicom set (for example in .obj) in AMI.js?
Description
I want to load some DICOM files and export the bones of that files or at least the volume. I already load the DICOM files and get the quadview and the volume Rendering, but I want to export the bones of that files.
When I export to .obj I get the box which is the content of the volume but I want to export the content inside.
Steps to Reproduce
-
Load DICOM data

-
I Load the volume using vrHelper = new AMI.VolumeRenderingHelper(stack);

-
I export it using OBJExporter and passing the scene which contains the volume, i also tried to pass the mesh ( let exporter = new THREE.OBJExporter(); let obj = exporter.parse(mesh);)

Expected Results
What I would really like is to export the bones and then slice it get only a part of that, for example get only the clavicle.
I would like to export this:

Actual Results
But I am only be able to export an empty box
This is the mesh that I am exporting which has 12 faces and 8 vertices and it has geometry: BoxGeometry, I Know that this is wrong but I don´t Know how to get the real mesh

I tried to create a labelmap using threshold and get only bones and then create a mesh from that labelmap but I wasn't able to do that.
Thank you very much.
Browsers Affected
- [X] All
- [ ] Chrome
- [ ] Firefox
- [ ] Edge
- [ ] Safari 9
- [ ] Safari 8
- [ ] IE 11
Versions
- AMI: v.0.32.0
- THREEJS: v.1.0.7
My understanding is that one can use the threejs obj exporter SO github to export the Mesh
edit: my apologies, as you have already pointed out, this does not solve your problem
On Wed, Aug 28, 2019 at 10:56 AM cpanap00 [email protected] wrote:
Description
I want to load some DICOM files and export the bones of that files or at least the volume. I already load the DICOM files and get the quadview and the volume Rendering, but I want to export the bones of that files.
When I export to .obj I get the box which is the content of the volume but I want to export the content inside. Steps to Reproduce Expected Results
What I would really like is to export the bones and then slice it get only a part of that, for example get only the clavicle. I would like to export this: [image: image] https://user-images.githubusercontent.com/17741571/63840565-93d9cf00-c981-11e9-98d7-cac6efb42a70.png Actual Results
But I am only be able to export an empty box
This is the mesh that I am exporting which has 12 faces and 8 vertices and it has geometry: BoxGeometry, I Know that this is wrong but I don´t Know how to get the real mesh [image: image] https://user-images.githubusercontent.com/17741571/63841009-4c077780-c982-11e9-8f37-cd662894c4b0.png
I tried to create a labelmap using threshold and get only bones and then create a mesh from that labelmap but I wasn't able to do that.
Thank you very much. Browsers Affected
- All
- Chrome
- Firefox
- Edge
- Safari 9
- Safari 8
- IE 11
Versions
- AMI: v.0.32.0
- THREEJS: v.1.0.7
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FNNDSC/ami/issues/391?email_source=notifications&email_token=AET34F6J22NEYP7DZMEWDGDQGY4UXA5CNFSM4IQ7ZKKKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HH3QWXQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AET34FZJPL4QEC5WZAYEJGTQGY4UXANCNFSM4IQ7ZKKA .
Hi, you can not export anything from the volume rendering itself: first you must generate a 3d model from the voxels values, using marching cubes for instance, then export it to the format of your choice!
My understanding is that one can use the threejs obj exporter SO github to export the Mesh … On Wed, Aug 28, 2019 at 10:56 AM cpanap00 @.***> wrote: Description I want to load some DICOM files and export the bones of that files or at least the volume. I already load the DICOM files and get the quadview and the volume Rendering, but I want to export the bones of that files. When I export to .obj I get the box which is the content of the volume but I want to export the content inside. Steps to Reproduce Expected Results What I would really like is to export the bones and then slice it get only a part of that, for example get only the clavicle. I would like to export this: [image: image] https://user-images.githubusercontent.com/17741571/63840565-93d9cf00-c981-11e9-98d7-cac6efb42a70.png Actual Results But I am only be able to export an empty box This is the mesh that I am exporting which has 12 faces and 8 vertices and it has geometry: BoxGeometry, I Know that this is wrong but I don´t Know how to get the real mesh [image: image] https://user-images.githubusercontent.com/17741571/63841009-4c077780-c982-11e9-8f37-cd662894c4b0.png I tried to create a labelmap using threshold and get only bones and then create a mesh from that labelmap but I wasn't able to do that. Thank you very much. Browsers Affected - All - Chrome - Firefox - Edge - Safari 9 - Safari 8 - IE 11 Versions - AMI: v.0.32.0 - THREEJS: v.1.0.7 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#391?email_source=notifications&email_token=AET34F6J22NEYP7DZMEWDGDQGY4UXA5CNFSM4IQ7ZKKKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HH3QWXQ>, or mute the thread https://github.com/notifications/unsubscribe-auth/AET34FZJPL4QEC5WZAYEJGTQGY4UXANCNFSM4IQ7ZKKA .
Thank you but I already use OBJExporter and It works fine, That's why I get the box my problem is that I need to generate a 3D model to export it.
Thank you but I already use OBJExporter and It works fine, That's why I get the box my problem is that I need to generate a 3D model to export it.
See comments above above marching cubes :)
Hi, you can not export anything from the volume rendering itself: first you must generate a 3d model from the voxels values, using marching cubes for instance, then export it to the format of your choice!
Thank You NicolasRannou, that's what I thought, I had already search about marching cubes and perhaps I need to do it in Back-End such as C++ or python because I didn´t find anything using javascript. Do I need to do a labelmap using threshold in order to export only the bones or It won't be necessary?
Thank You again.
So yes you can write your own JS implementation (probably using web-workers somehow for performance) or do it in the back end (which may be faster anyway).
In theory, all you need is the DICOM data. From there you can just iterate through the voxels and for each of them, depending on its intensity decide whether it should be part of the mesh or not!
So yes you can write your own JS implementation (probably using web-workers somehow for performance) or do it in the back end (which may be faster anyway).
In theory, all you need is the DICOM data. From there you can just iterate through the voxels and for each of them, depending on its intensity decide whether it should be part of the mesh or not!
Okay, Thank You very much.
I'm sorry to bother you again but I'm not able to get the mesh. I think the problem is from the data I use to get the mesh.
I use the rawData from the stack and this is what it should looks like:

However when I use marching cubes algorithm this is what I get:

The form is very similar but It is not perfect. I'm using this https://github.com/kig/gl-volume3d-demo for the marching cubes algorithm and I'm passing the dimensions too which are x:512 y:512 and z:61 in this case:

This is how I export to TXT the data:

My question is: What am I doing wrong?