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 solve the loss of precision in the process of voxel transformation of mesh? #4

Open
Dobmod opened this issue Nov 27, 2024 · 6 comments

Comments

@Dobmod
Copy link

Dobmod commented Nov 27, 2024

I'm sorry I haven't had time to use the library yet. But I have a question to ask. When I export the stl segmentation file to nrrd or nii format use
ing 3d slicer, I will face a great loss of precision. Does the library solve this problem, and if so, is it related to the resolution of ReferenceImage? Thank you very much!!

@Dobmod
Copy link
Author

Dobmod commented Nov 29, 2024

It would be nice if we could set the resolution.

@vcasellesb
Copy link
Owner

Hi. Apologies for the delayed response, I've been very busy. I'm sorry, but as the code is right now, the resolution of the ReferenceImage is the resolution that the resulting .nii file will have. If you have any suggestions on how to change that, I'd love to hear them. Honestly, I'm not an expert in stl meshes whatsoever.

@Dobmod
Copy link
Author

Dobmod commented Dec 2, 2024

Hi. Apologies for the delayed response, I've been very busy. I'm sorry, but as the code is right now, the resolution of the ReferenceImage is the resolution that the resulting .nii file will have. If you have any suggestions on how to change that, I'd love to hear them. Honestly, I'm not an expert in stl meshes whatsoever.

Thank you for taking the time to respond. I am trying to solve this problem through Slicer Python API!

@vcasellesb
Copy link
Owner

Hi @Dobmod ,

Please let me know if you find out the solution!

Thanks!
Vicent

@Dobmod
Copy link
Author

Dobmod commented Dec 22, 2024

Hi @vcasellesb , I first attempted resampling to enlarge the ReferenceImage, and then used it to export the STL. This way, I achieved less loss!

@vcasellesb
Copy link
Owner

Hi @vcasellesb , I first attempted resampling to enlarge the ReferenceImage, and then used it to export the STL. This way, I achieved less loss!

Dear @Dobmod,

I'm glad you figured it out! Of course, the resulting nifti segmentation converted from the stl is going to match the dimensions and spacing from the reference image, so changing those is a good way to achieve it. However, I think it's very specific to your use case.

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

2 participants