Skip to content

feat(createImageIdsAndCacheMetaData): Add Sort Instance Number#1305

Open
jlopes90 wants to merge 1 commit intocornerstonejs:mainfrom
jlopes90:add-sort-instance-number-to-createImageIdsAndCacheMetaData
Open

feat(createImageIdsAndCacheMetaData): Add Sort Instance Number#1305
jlopes90 wants to merge 1 commit intocornerstonejs:mainfrom
jlopes90:add-sort-instance-number-to-createImageIdsAndCacheMetaData

Conversation

@jlopes90
Copy link
Copy Markdown
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:

@netlify
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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