-
Notifications
You must be signed in to change notification settings - Fork 53
Add metadata
property to itk.Image and populate it from file metadata
#394
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
Comments
Some thoughts:
One idea is to have a function like so: If we want a property off of itk.Image, maybe it can be something like The classic use-case: User wants to scroll through a DICOM stack and have the W/L automatically set from the RescaleSlope and Intercept of the current slice.
|
I agree that important issues to take into account are:
The problem as you said is that we need to store all the DICOM metadata for all slices. I'd rather have the contrary: some data bank out of which we can extract a 3D Image / Volume given a set of files (or a series object), so the user can discard that data bank when they want. So "Parse -> Read what you want -> Create Image" instead of "Parse -> Create Image and store all metadata -> Read what you want later". i.e: the metadata should only be retrievable within the reader's scope, the application can then choose to cache what they need. Does that make sense?
I'd hope that itk.js' GDCM reader does that already by properly sorting the scans based on their proper order.? |
So, here are two ideas from this: we either support reading DICOM tags from the files at a later point (database model), or we support reading tags in-line with the image.
I'm not fully understanding nested datasets. Does that mean DICOM can store an arbitrary hierarchy of distinct datasets, each with their own set of dicom metadata?
Yes. I was thinking high-level operations, and GDCM should be doing this one, not us. |
@floryst Maybe we should ignore nested metadata for now until we have use cases that come up, and we can iterate on it unless some expert shows interest in helping (we could reach out on the ITK discourse). I'm surprised if this isn't already handled in ITK C++ between GDCM and DCMTK. @thewtex I just saw there was a Could you provide more details/fill us in on how that works? Is that with MONAI only? What about the issue mentioned above of metadata that varies for each 2D scan in a single series? I suppose that the solution we want to design as part of this thread's discussion should align with that latest addition in 5.2.rc1? Thanks! |
@agirault yes, as starting point we can add the same As a next step, we could improve this for a DICOM series based on @floryst's and your work.
In this case, the tags will correspond to a single slice. |
Here is one possible API for DICOM tags, depending on how itk.js webworker functionality works. We can add a new API, Now this might not be the most performant, since workflows will likely want to call
The first API is a good one to add regardless, but if performance is necessary, then maybe the second is a good fit. However, I would like to keep it as simple as possible so that logic can be built on top, rather than having feature creep. In any case, the first approach is definitely the easiest, while the second approach is more complicated and prone to edge cases. |
👍 @floryst yes, this seems like a good next step, providing a usable piece of functionality but also a building block for future work. The |
E.g. DICOM tags
The text was updated successfully, but these errors were encountered: