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

feat(4d): replace timepoint with dimensionGroupNumber for 4D handling with backward compatibility #1764

Merged
merged 10 commits into from
Jan 21, 2025

Conversation

sedghi
Copy link
Member

@sedghi sedghi commented Jan 17, 2025

In our 4D handling, we previously used timePoint (starting at 0) and numberOfTimePoints. However:

  1. It is confusing because it starts at 0 instead of 1.
  2. It is incompatible with the fact that the 4th dimension can represent something other than time (e.g., positionIdentifier). Here is the relevant part of standard

This PR introduces dimensionGroupNumber in a backward-compatible way to prevent breaking changes.

If you see a warning in your console, follow the instructions to update accordingly. In Cornerstone3D 3.0, all references to timePointIndex will be removed in the future.

Note on 0-based and 1-based Indexing:

  • timePoints were 0-based
  • dimensionGroup is 1-based
Old Name New Name Context
timePointIndex (property/setter in IDynamicImageVolume, StreamingDynamicImageVolume) dimensionGroupNumber (property/setter in IDynamicImageVolume, StreamingDynamicImageVolume) Interface, Class
numTimePoints (property in IDynamicImageVolume, StreamingDynamicImageVolume, ImageVolume, VoxelManager.createScalarDynamicVolumeVoxelManager) numDimensionGroups (property in IDynamicImageVolume, StreamingDynamicImageVolume) Interface, Class, Static Method
getCurrentTimePointImageIds getCurrentDimensionGroupImageIds Class (StreamingDynamicImageVolume)
flatImageIdIndexToTimePointIndex flatImageIdIndexToDimensionGroupNumber Class (StreamingDynamicImageVolume)
isTimePointLoaded isDimensionGroupLoaded Class (StreamingDynamicImageVolume)
markTimePointAsLoaded markDimensionGroupAsLoaded Class (StreamingDynamicImageVolume)
DYNAMIC_VOLUME_TIME_POINT_INDEX_CHANGED DYNAMIC_VOLUME_DIMENSION_GROUP_CHANGED Enum (EVENTS)
DYNAMIC_VOLUME_TIME_POINT_LOADED DYNAMIC_VOLUME_DIMENSION_GROUP_LOADED Enum (EVENTS)
checkTimePointCompletion checkDimensionGroupCompletion Class (StreamingDynamicImageVolume, BaseStreamingImageVolume)
timePoint (parameter in VoxelManager.createScalarDynamicVolumeVoxelManager) dimensionGroupNumber (parameter in VoxelManager.createScalarDynamicVolumeVoxelManager) Static Method
setTimePoint setDimensionGroupNumber Class (VoxelManager)
getAtIndexAndTimePoint getAtIndexAndDimensionGroup Class (VoxelManager)
getTimePointScalarData getDimensionGroupScalarData Class (VoxelManager)
getCurrentTimePointScalarData getCurrentDimensionGroupScalarData Class (VoxelManager)
getCurrentTimePoint getCurrentDimensionGroupNumber Class (VoxelManager)

Copy link

stackblitz bot commented Jan 17, 2025

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Jan 17, 2025

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 1ea0ea0
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/678fccbe59259a0008740990
😎 Deploy Preview https://deploy-preview-1764--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sedghi sedghi requested a review from wayfarer3130 January 17, 2025 21:46
@sedghi sedghi mentioned this pull request Jan 17, 2025
8 tasks
@sedghi sedghi changed the title fix/dynamic frame start index feat(4d): replace timepoint with dimensionGroupNumber for 4D handling with backward compatibility Jan 21, 2025
@sedghi sedghi merged commit d0c0338 into main Jan 21, 2025
29 checks passed
@sedghi sedghi deleted the fix/dynamic-frame-start-index branch January 22, 2025 16:07
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

Successfully merging this pull request may close these issues.

2 participants