Skip to content

feat(hp): enable OHIF to run with partial metadata for large studies at the cost of less effective hanging protocol - #3804

Merged
sedghi merged 44 commits into
masterfrom
fix/first-image-load-time
Jan 9, 2024
Merged

sedghi merged 44 commits into
masterfrom
fix/first-image-load-time

Conversation

@igoroctaviano

Copy link
Copy Markdown
Contributor

Context

This PR is related to the issue #3480 , that complains about the excessive time spend to display the first image of studies with a very large number of series. Compared to OHIF v2, it takes 3x the time to display the first image.

This error is related to the to when the the hanging protocol is fired. The hanging protocol waits until all series metadata are loaded before open a series in the study

Changes & Results

This PR makes two changes in the OHIF code. First, it defines a new config variable, minDisplaySetsToRunHP, that defines the mininum number of received displaySets to run the hanging protocol. The second change is related to the series thumbnails retrieval, changing the await function calls for the .then resolve calls, to not block the main context every time a new displayset is added. Should be noted that this setting could affect the correct hanging protocol application and should be used only when necessary.
Another change is related to how ohif retrieves the series metadata: this PR add extra dicom tag request to include Series Number in the series metadata to correctly order the series before starting request. The ordered list of series is important because when ohif detects it is retrieving a large study (more than 100 series), it will retrieve first a small number of series, 10, to start the hanging protocol application
Also, we add appConfig in onModeEnter to set minDisplaySetsToRunHP in modes

Testing

To test it, I configured the default.js pointing to IDC database (its important to set supportsWildcard: false with this database), set minDisplaySetsToRunHP to 10 and log the times with these links:

Study 1:
(v2) https://testing-viewer.canceridc.dev/viewer/1.3.12.2.1107.5.1.4.60175.30000008042114404745300000007
(v3) http://localhost:3000/viewer?StudyInstanceUIDs=1.3.12.2.1107.5.1.4.60175.30000008042114404745300000007

Study 2:
(v2) https://testing-viewer.canceridc.dev/viewer/1.3.12.2.1107.5.1.4.60175.30000008042114404745300000016
(v3) http://localhost:3000/viewer?StudyInstanceUIDs=1.3.12.2.1107.5.1.4.60175.30000008042114404745300000016

Checklist

PR

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

Code

  • My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

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

Tested Environment

  • OS: Windows 10
  • Node version: 16.14.0
  • Browser: Chrome 116.0.5845.97, Firefox 116.0.3

rodrigobasilio2022 and others added 27 commits August 22, 2023 11:52
@netlify

netlify Bot commented Nov 23, 2023 •

Copy link
Copy Markdown

✅ Deploy Preview for ohif-platform-docs ready!

Name Link
🔨 Latest commit 1225067
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/659d679f1594f00008ba4931
😎 Deploy Preview https://deploy-preview-3804--ohif-platform-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.

@netlify

netlify Bot commented Nov 23, 2023 •

Copy link
Copy Markdown

✅ Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit 1225067
🔍 Latest deploy log https://app.netlify.com/sites/ohif-dev/deploys/659d679f955d330008d927a2
😎 Deploy Preview https://deploy-preview-3804--ohif-dev.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.

@igoroctaviano
igoroctaviano requested a review from sedghi November 23, 2023 18:22
@igoroctaviano
igoroctaviano requested a review from sedghi December 6, 2023 12:32
@igoroctaviano

Copy link
Copy Markdown
Contributor Author

I see what you are doing (I guess deferring promises until you reach the mode.tsx, and then checking if the criteria for running HP is satisfied). Instead of doing so, can't you set up a pubsub to send events when metadata is received, and then check if you can? I'm just thinking out loud.

I'm not sure if I got this... Can you sketch something? I think the idea is to defer promises so we don't have to wait for them all to load in order to see something rendered. Then later the final hanging protocol will be applied as soon as they are all resolved.

@sedghi

Comment thread platform/app/src/routes/Mode/Mode.tsx Resolved

@wayfarer3130 wayfarer3130 left a comment

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.

Just a few small changes - this is looking quite good now.

@igoroctaviano

Copy link
Copy Markdown
Contributor Author

@wayfarer3130 can you please re-review this one?

@wayfarer3130 wayfarer3130 left a comment

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'm good with this now. Thanks for the protracted work on this one - it needed to be good enough to really work long term without breaking things, and I think we are there (it will need additional work for more complex HPS, but for now it is good)

@wayfarer3130

Copy link
Copy Markdown
Contributor

Can you check the failing tests?

@igoroctaviano

Copy link
Copy Markdown
Contributor Author

@wayfarer3130 @sedghi I think it's not related to these changes. There's something wrong with e2e (master). All other PRs including this one have the same failing step:

Chrome version major is 120
Installed version of Google Chrome is 120.0.6099.109 
404
Matching Chrome Driver Version 404'd, falling back to first matching major version.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   790  100   790    0     0  12521      0 --:--:-- --:--:-- --:--:-- 12539
New ChromeDriver version to be installed: 1204232
1204232 will be installed
curl: (22) The requested URL returned error: 404

Exited with code exit status 22

https://app.circleci.com/pipelines/github/OHIF/Viewers/12670/workflows/d8ef772c-e365-44f4-aa0c-77c5e72d4f65/jobs/27507

editableBy: {},
protocolMatchingRules: [],
toolGroupIds: ['default'],
hpInitiationCriteria: { minSeriesLoaded: 1 },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please add a comment above this line explain what this means

@sedghi
sedghi merged commit 0049f4c into master Jan 9, 2024
ryan00012 pushed a commit to new-lantern/nl-ohif that referenced this pull request Mar 27, 2024
* chore(version): Update package versions [skip ci]

* feat(displayArea): add display area to hanging protocol (OHIF#3691)

Co-authored-by: Ouwen Huang <[email protected]>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(debug): Add timing information about time to first image/all images, and query time (OHIF#3681)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(cli): Add npm packaged mode not working (OHIF#3689)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(translation): Side panel translate fix (OHIF#3156)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(locale): Added Turkish language support (tr-TR) - Community PR (OHIF#3695)

Co-authored-by: Ahmet Altay <[email protected]>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(locale): add German translations - community PR (OHIF#3697)

Co-authored-by: pwespi <[email protected]>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(measurement and microscopy):  various small fixes for measurement and microscopy side panel (OHIF#3696)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(segmentation scroll): and hydration bugs (OHIF#3701)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(bugs): fixing lots of bugs regarding release candidate (OHIF#3700)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(Segmentation): download RTSS from Labelmap(OHIF#3692)

Co-authored-by: Alireza <[email protected]>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(segmentation): do not use SAB if not specified (OHIF#3705)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(modality unit): fix the modality unit per target via upgrade of cs3d (OHIF#3706)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(voi): should publish voi change event on reset (OHIF#3707)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(segmentation):  Various fixes for segmentation mode and other (OHIF#3709)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(modules): add stylus loader as an option to be uncommented (OHIF#3710)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(i18n): display set(s) are two words for English messages (OHIF#3711)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(export): wrong export for the tmtv RT function (OHIF#3715)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(display messages): broken after timings (OHIF#3719)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* chore(version): move to the next beta version [BUMP BETA]

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(calibration): No calibration popup caused by perhaps an unused code optimization for production builds (OHIF#3736)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(cine): Use the frame rate specified in DICOM and optionally auto play cine (OHIF#3735)

Co-authored-by: rareramos <[email protected]>
Co-authored-by: Doug Horner <[email protected]>
Co-authored-by: Rehan <[email protected]>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(recipes): package.json script orthanc:up docker-compose path (OHIF#3741)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* docs(azure): Azure static Deployment details (OHIF#3740)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(sr): dcm4chee requires the patient name for an SR to match what is in the original study (OHIF#3739)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(toolbar): allow customizable toolbar for active viewport and allow active tool to be deactivated via a click (OHIF#3608)

Co-authored-by: Joe Boccanfuso <[email protected]>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(measurement service): Implemented correct check of schema keys in _isValidMeasurment. (OHIF#3750)

* feat(filters): save worklist query filters to session storage so that they persist between navigation to the viewer and back (OHIF#3749)

Co-authored-by: ladeirarodolfo <[email protected]>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(i18n): enhanced i18n support (OHIF#3730)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(thumbnail): Avoid multiple promise creations for thumbnails (OHIF#3756)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* docs(faq): FAQ and Segmentation Mode Fix for some studies (OHIF#3762)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(hp callback): Add viewport ready callback (OHIF#3772)

Co-authored-by: Ouwen Huang <[email protected]>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat: add VolumeViewport rotation (OHIF#3776)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(arrow): ArrowAnnotate text key cause validation error (OHIF#3771)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(path): upgrade docusaurus for security (OHIF#3780)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(dicomJSON): Add Loading Other Display Sets and JSON Metadata Generation script (OHIF#3777)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(overlay): Overlays aren't shown on undefined origin (OHIF#3781)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: 🐛 Run error handler for failed image requests (OHIF#3773)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(url): Add SeriesInstanceUIDs wado query param (OHIF#3746)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(docs): Added various training videos to support the OHIF CLI tools (OHIF#3794)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(metadata): to handle cornerstone3D update for htj2k (OHIF#3783)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(DICOM Overlay): The overlay data wasn't being refreshed on change (OHIF#3793)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(events): broadcast series summary metadata (OHIF#3798)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat: Merge Data Source (OHIF#3788)

Add the ability to merge two different series queries to generate a complete study query result.  Provides basic support for other types of merges, but those aren't yet added as full features.

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: Update the CS3D packages to add the most recent HTJ2K TSUIDS (OHIF#3806)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(cine): Set cine disabled on mode exit. (OHIF#3812)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(SM): drag and drop is now fixed for SM (OHIF#3813)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(auth): fix the issue with oauth at a non root path (OHIF#3840)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(HP): Added new 3D hanging protocols to be used in the new layout selector (OHIF#3844)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(i18n): enhanced i18n support (OHIF#3761)

* fix: address and improve system vulnerabilities (OHIF#3851)

* feat(config): Add activateViewportBeforeInteraction parameter for viewport interaction customization (OHIF#3847)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(customizationService): Enable saving and loading of private tags in SRs (OHIF#3842)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* Fix(HPService): custom image load performed is now reset to false on HP exit (OHIF#3809)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(dicom-seg) : Fix the missing color tag when loading Dicom-Seg (OHIF#3822)

Co-authored-by: Alireza <[email protected]>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* docs: Update HangingProtocolService.md doc sameAs example to contain constr… (OHIF#3765)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(overlay): add inline binary overlays (OHIF#3852)

* fix(icon-style): Ensure consistent icon dimensions (OHIF#3727)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* chore(version): upgrade cornerstone3D versions (OHIF#3853)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* chore(version): upgrade cornerstone3D versions to fix orientation (OHIF#3854)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: colormap for stack viewports via HangingProtocol (OHIF#3866)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: convert radian to degree value for mip rotation (OHIF#3881)

* fix: PDF display request in v3 (OHIF#3878)

Co-authored-by: Alireza <[email protected]>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat: improve disableEditing flag (OHIF#3875)

Co-authored-by: Igor Octaviano <[email protected]>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(ui): sidePanel expandedWidth (OHIF#3728)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat: Add on mode init hook (OHIF#3882)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* docs: Update user-account-control.md (OHIF#3877)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(segmentation): upgrade cs3d to fix various segmentation bugs (OHIF#3885)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(transferSyntax): prefer server transcoded transfer syntax for all images (OHIF#3883)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(hp): enable OHIF to run with partial metadata for large studies at the cost of less effective hanging protocol (OHIF#3804)

Co-authored-by: rodrigobasilio2022 <[email protected]>
Co-authored-by: rodrigobasilio2022 <[email protected]>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: Update CS3D to fix second render (OHIF#3892)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* docs: Update architecture.md (OHIF#3891)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: 🐛 Check merge key for merge data source (OHIF#3901)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: is same orientaiton (OHIF#3905)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(viewport-sync): remember synced viewports bw stack and volume and RENAME StackImageSync to ImageSliceSync (OHIF#3849)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: catch errors in getPTImageIdInstanceMetadata (OHIF#3897)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix toggleHpTools to support split primary button (OHIF#3900)

Fixes a small bug in toggling buttons with hanging protocols.

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: 🐛 Sort merge results based on default data source (input) (OHIF#3903)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(errorboundary): format stack trace properly (OHIF#3931)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(resize): Optimize resizing process and maintain zoom level (OHIF#3889)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(demo): Deploy issue (OHIF#3951)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(docs): Minor typos in hpModule.md (OHIF#3962)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* docs: Typo (OHIF#3975)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(cli): mode creation template (OHIF#3876) (OHIF#3981)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(delete measurement): icon for measurement table (OHIF#3775)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(SR display): and the token based navigation (OHIF#3995)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(worklist): New worklist buttons and tooltips (OHIF#3989)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

---------

Co-authored-by: ohif-bot <[email protected]>
Co-authored-by: Alireza <[email protected]>
Co-authored-by: Ouwen Huang <[email protected]>
Co-authored-by: Bill Wallace <[email protected]>
Co-authored-by: Joe Boccanfuso <[email protected]>
Co-authored-by: wangxuan <[email protected]>
Co-authored-by: Ahmet Altay <[email protected]>
Co-authored-by: pwespi <[email protected]>
Co-authored-by: dxlin <[email protected]>
Co-authored-by: rareramos <[email protected]>
Co-authored-by: Doug Horner <[email protected]>
Co-authored-by: Rehan <[email protected]>
Co-authored-by: edwardyangxin <[email protected]>
Co-authored-by: bluesteel23 <[email protected]>
Co-authored-by: Joe Boccanfuso <[email protected]>
Co-authored-by: ladeirarodolfo <[email protected]>
Co-authored-by: Pavel <[email protected]>
Co-authored-by: Ouwen Huang <[email protected]>
Co-authored-by: Pedro H. Köhler <[email protected]>
Co-authored-by: Igor Octaviano <[email protected]>
Co-authored-by: Sofien-Sellami <[email protected]>
Co-authored-by: Salim Kanoun <[email protected]>
Co-authored-by: Celian-abd <[email protected]>
Co-authored-by: AbishekBista9 <[email protected]>
Co-authored-by: rodrigobasilio2022 <[email protected]>
Co-authored-by: rodrigobasilio2022 <[email protected]>
Co-authored-by: Ibrahim <[email protected]>
Co-authored-by: EricB <[email protected]>
Co-authored-by: EricB <[email protected]>
thanh-nguyen-dang pushed a commit to uc-cdis/Viewers that referenced this pull request May 1, 2024
…at the cost of less effective hanging protocol (OHIF#3804)

Co-authored-by: rodrigobasilio2022 <[email protected]>
Co-authored-by: rodrigobasilio2022 <[email protected]>
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.

4 participants