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

How to export bones of a dicom set (for example in .obj) in AMI.js? #391

Open
1 of 7 tasks
cpanap00 opened this issue Aug 28, 2019 · 8 comments
Open
1 of 7 tasks

Comments

@cpanap00
Copy link

cpanap00 commented Aug 28, 2019

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

  1. Load DICOM data
    image

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

  3. 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);)
    image

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

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

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
@xgui3783
Copy link

xgui3783 commented Aug 29, 2019 via email

@NicolasRannou
Copy link
Member

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!

@cpanap00
Copy link
Author

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.

@NicolasRannou
Copy link
Member

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 :)

@cpanap00
Copy link
Author

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.

@NicolasRannou
Copy link
Member

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!

@cpanap00
Copy link
Author

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.

@cpanap00
Copy link
Author

cpanap00 commented Sep 4, 2019

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:
image

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

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:
image

This is how I export to TXT the data:
image

My question is: What am I doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants