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

Is there API documentation or source code to describe how to save and load Annotation and Segmentation? What Annotation and Segmentation data structure are? #1137

Closed
3 tasks done
longerking opened this issue Nov 25, 2019 · 11 comments

Comments

@longerking
Copy link

longerking commented Nov 25, 2019

Prerequisites

  • Which version are you using? (Is it latest?)
  • Are you reporting to the correct repository?
  • Did you search existing issues? (Were any related?)

Description

Steps to Reproduce the issue

  1. When I do add Tools such as LengthTool, FreehandScissorsTool
  2. Then I want to save Annotation and Segmentation parameter that I drew on the element to database of vuejs-dicom App. Attempt to load them the next time user open the application
  3. Is there API documentation or source code to describe how to save and load Annotation and Segmentation? What Annotation and Segmentation data structure are?

Expected behavior: (What you expected to happen)

Actual behavior: (What actually happened)

CodeSandbox With Reproduction of Issue:

I've added FreehandScissorsTool,but I'm confused about what to do next of saving the Segmentation.

@JamesAPetts
Copy link
Member

IO using open source libraries is still a work in progress.

Using dcmjs, a library for DICOM manipulation in JavaScript, its possible to interoperate between cornerstoneTools toolState/labelmaps and DICOM representations.

There are live examples of writing labelmaps to DICOMSEG and annotations to DICOMSR (sources here).

Although DICOMSEG support is relatively good so far, support for all cornerstone annotations in DICOMSR is lacking, see an open issue here.

@longerking
Copy link
Author

longerking commented Nov 28, 2019

Thanks, @JamesAPetts . I think I need to explain my problem specifically. I have some data in nii (NIFTI) format, and I want to convert it into segments, and overlay them on the dicom element. is it possible? Is there any way to help me achieve my goal. Can you give me some advice?

@longerking
Copy link
Author

longerking commented Dec 10, 2019

Here is a solution

https://codesandbox.io/embed/priceless-newton-ib1m3

@zhihli
Copy link

zhihli commented Dec 31, 2020

Thanks, @JamesAPetts . I think I need to explain my problem specifically. I have some data in nii (NIFTI) format, and I want to convert it into segments, and overlay them on the dicom element. is it possible? Is there any way to help me achieve my goal. Can you give me some advice?
@longerking I have the same problem as you,Have you solved it?

@longerking
Copy link
Author

Thanks, @JamesAPetts . I think I need to explain my problem specifically. I have some data in nii (NIFTI) format, and I want to convert it into segments, and overlay them on the dicom element. is it possible? Is there any way to help me achieve my goal. Can you give me some advice?
@longerking I have the same problem as you,Have you solved it?

can you make your question clearer? if your problem is like mine, here might be the solution

https://codesandbox.io/embed/priceless-newton-ib1m3

@zhihli
Copy link

zhihli commented Dec 31, 2020

@longerking yes, I hava a nifti file containing segmentation data,I have seen your example,But I don’t know how to get the required data from nifti and draw it, Can you give me some advice?

@longerking
Copy link
Author

@longerking yes, I hava a nifti file containing segmentation data,I have seen your example,But I don’t know how to get the required data from nifti and draw it, Can you give me some advice?

cornerstoneTools load labelMap or segmentation source as an array, so ,the first thing you need to do is convert the nifti(nii or nii.gz) data into numpy array. You could do it via python module NiBabel

https://nipy.org/nibabel/installation.html

@zhihli
Copy link

zhihli commented Dec 31, 2020

@longerking Thank you for your reply,I will try. A digression, are you from China?

@longerking
Copy link
Author

Yes and hope my answer will help you.

@longerking Thank you for your reply,I will try. A digression, are you from China?

Yes and hope my answer will help you.

@zhihli
Copy link

zhihli commented Dec 31, 2020

@longerking 你好,能加个联系方式吗, 想请教下具体实现,谢谢

@longerking
Copy link
Author

@longerking 你好,能加个联系方式吗, 想请教下具体实现,谢谢

可以,这是我的邮箱: [email protected]

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