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(createImageIdsAndCacheMetaData): Add Sort Instance Number #1305

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jlopes90
Copy link
Contributor

@jlopes90 jlopes90 commented Jun 5, 2024

Context

Fix: #1170 (comment)

Changes & Results

Testing

Example Segmentation Volume
https://deploy-preview-1305--cornerstone-3d-docs.netlify.app/live-examples/segmentationVolume.html

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] "OS:
  • [] "Node version:
  • [] "Browser:

Copy link

netlify bot commented Jun 5, 2024

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit fbd36ae
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/66603b8c305dce0008e86411
😎 Deploy Preview https://deploy-preview-1305--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.

Comment on lines +56 to +58
const sortedInstances = Object.values(instances).sort(
(a, b) => a[INSTANCE_NUMBER].Value[0] - b[INSTANCE_NUMBER].Value[0]
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you will be interested in checking out this helper: utilities.sortImageIdsAndGetSpacing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already tested it and it's not right.

image

async function fetchDicom() {
    // Get Cornerstone imageIds for the source data and fetch metadata into RAM
    imageIds = await createImageIdsAndCacheMetaData(dev.getConfig.fetchDicom);

    //
    const { sortedImageIds } = csUtilities.sortImageIdsAndGetSpacing(imageIds);

    //
    await loadDicom(sortedImageIds.reverse());
}

@jlopes90 jlopes90 requested a review from kom482 June 6, 2024 16:43
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.

[Bug] how to load dicom-segment data
2 participants