-
Notifications
You must be signed in to change notification settings - Fork 453
fix: 4d for timeslot vector #2523
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
Conversation
… and update isDynamicVolume logic
Co-authored-by: Copilot <[email protected]>
…tting using TimeSlotVector and SliceVector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request addresses issues related to 4D (dynamic) volume handling in Cornerstone3D. It refactors the deprecated numTimePoints property in ImageVolume to use a getter that accesses numDimensionGroups from StreamingDynamicImageVolume, and adds support for multiframe 4D image splitting using DICOM Nuclear Medicine tags (TimeSlotVector and SliceVector).
Key changes:
- Refactored
numTimePointsfrom a nullable property to a getter that provides backward compatibility - Updated
isDynamicVolume()logic to properly handle the getter-based numTimePoints - Added new
handleMultiframe4D()function to split multiframe images by TimeSlotVector (0054,0070) and SliceVector (0054,0080) tags for NM gated SPECT/PET images
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/core/src/cache/classes/ImageVolume.ts | Converts deprecated numTimePoints from a nullable field to a getter that accesses numDimensionGroups for backward compatibility, and updates isDynamicVolume() to handle the new getter |
| packages/core/src/utilities/splitImageIdsBy4DTags.ts | Adds multiframe 4D splitting support via new handleMultiframe4D() and generateFrameImageId() functions that process TimeSlotVector and SliceVector DICOM tags for Nuclear Medicine images |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wayfarer3130
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add testing notes as to which study to try loading to test this? Even if it has to link with OHIF to do it, I'd like to be able to run this. I can upload a new dataset if required.
Can you address the copilot issues - for the frame numbers, I would suggest adding an endpoint to the metadata which returns all imageIds for the given sop class, and then just use the index. Otherwise you could pass the imageIds list into this function instead of trying to parse/generate image ids.
This issue has the data OHIF/Viewers#5554 Update: here is the OHIF PR OHIF/Viewers#5666 |
…ameImageId functions; add tests for multiframe 4D functionality
…ageId and add validation for SliceVector in handleMultiframe4D
… logging in handleMultiframe4D for SliceVector validation
44b8706 to
804e2bf
Compare
|
@sedghi - I'm not sure what is going on with the docusaurus build |
This pull request adds support for splitting multiframe 4D images (such as NM Multi-frame SPECT/PET) by leveraging DICOM's
TimeSlotVectorandSliceVectortags. The main focus is on enabling correct grouping of image frames by time slots and slices for advanced 4D image handling. Additionally, it updates theImageVolumeclass to improve its handling of time points and dynamic volume detection.Multiframe 4D support and image grouping:
splitImageIdsBy4DTags.tsto detect and handle multiframe 4D images using the DICOMTimeSlotVector(0054,0070) andSliceVector(0054,0080) tags, generating frame-specificimageIdsand grouping them by time slot. This enables correct splitting of NM multi-frame images for 4D visualization and analysis. [1] [2]handleMultiframe4Dfunction and supporting types to encapsulate the splitting logic and result structure.splitImageIdsBy4DTagsfunction to use the new multiframe splitting logic before falling back to previous grouping methods.ImageVolume class improvements:
numTimePointsproperty inImageVolumeto a getter that dynamically returns the number of dimension groups (time points), defaulting to 1 if not available.isDynamicVolumemethod inImageVolumeto use the newnumTimePointsgetter, providing more robust detection of 4D (dynamic) volumes.