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

[Feature Request] Study prefetching service and progress bar for display sets #3363

Closed
igoroctaviano opened this issue May 3, 2023 · 23 comments · Fixed by #4206
Closed

[Feature Request] Study prefetching service and progress bar for display sets #3363

igoroctaviano opened this issue May 3, 2023 · 23 comments · Fixed by #4206
Assignees
Labels
Design Needed Feature Request IDC:candidate Possible feature requests for discussion, and if we agree, they can be relabeled IDC:priority

Comments

@igoroctaviano
Copy link
Contributor

igoroctaviano commented May 3, 2023

Request

  • Display a progress bar close to each thumbnail and also in the scrollbar so the user knows which frame is cached
  • Have a configurable study prefetcher service with options to retrieve images similar to v2
  studyPrefetcher: {
    enabled: true,
    order: 'closest', // top-bottom or bottom-up or outwards 
    displaySetCount: 3, // amount of displaySets up or down
    maxNumPrefetchRequests: 100,
    displayProgressBar: true,
  },

Context

The status of series loading is missing. Frame fetching/caching behavior is unclear - even though I scroll through a series several times, the scrolling remains jumpy, and the “Loading…” message keeps showing up. How can I know when the entire series is actually loaded?

v2 Port Redesign:

@dan-rukas add design here when finalized

  • New icons: loading, completed, incomplete
@igoroctaviano igoroctaviano added Community: Request ✋ IDC:candidate Possible feature requests for discussion, and if we agree, they can be relabeled IDC:priority labels May 3, 2023
@arunvc
Copy link

arunvc commented Jun 8, 2023

Same as #883 , pending since long time

@Amal-p
Copy link

Amal-p commented Jun 8, 2023

Similar to issue #883, this pending task has been awaiting completion for an extended duration.

@asphub
Copy link

asphub commented Jun 8, 2023

Me also facing the same issue. Needs to get fixed ASAP. Same as #883

@Yonatanmh
Copy link

Same here, eagerly await this feature!

@igoroctaviano igoroctaviano changed the title v3: Study Prefetcher & Progress bar for display sets [Feature Request] v3: Study Prefetcher & Progress bar for display sets Jul 7, 2023
@igoroctaviano igoroctaviano changed the title [Feature Request] v3: Study Prefetcher & Progress bar for display sets [Feature Request] Study Prefetcher and progress bar for display sets Aug 2, 2023
@igoroctaviano igoroctaviano changed the title [Feature Request] Study Prefetcher and progress bar for display sets [Feature Request] Study prefetching service and progress bar for display sets Aug 2, 2023
@james-hanks
Copy link

james-hanks commented Aug 8, 2023

  • Need better user story for thumbnail. Could we discuss @igoroctaviano so @dan-rukas can document design
  • Dan to do preliminary sketch and we will meet for feedback
  • 2nd part is scrollbar - we have idea of how to move forward for that

@james-hanks james-hanks self-assigned this Aug 8, 2023
@igoroctaviano
Copy link
Contributor Author

@dan-rukas any updates on this one?

@sedghi
Copy link
Member

sedghi commented Sep 14, 2023

Someone from community commented they would like to have a load time for the study which makes sense in this prefetcher

@james-hanks james-hanks assigned dan-rukas and unassigned james-hanks Sep 29, 2023
@james-hanks
Copy link

We will investigate and design during upcoming UI redesign

@fedorov
Copy link
Member

fedorov commented Nov 3, 2023

@james-hanks any updates on this?

@james-hanks
Copy link

@fedorov this in our queue for next major release (3.8). We are currently in design review phase. We will update the ticket with design when it is finalized - please feel free to take a look and comment at that time

@james-hanks
Copy link

  • some large use cases will de-cache and potentially reset the visual indicator which will be confusing for users
  • might make sense to replicate the UI in thumbnail and viewport

@GlebVST
Copy link

GlebVST commented Apr 22, 2024

Is this feature being worked on actively? Maybe someone knows a branch with corresponding changes ongoing work/drafts?

@jrudascas
Copy link

Any update on this?

@GlebVST
Copy link

GlebVST commented May 1, 2024

Not exactly a prefetching service as requested by this ticket but something I figured could be used for custom preloading of certain images (like all from specific displaySet) and potentially adapted to load all display sets in a background.

import { DisplaySet } from '@ohif/core';
import { getConfiguration as getCoreConfiguration, imageLoader } from '@cornerstonejs/core';
import { extensionManager } from '../../../App';

const preloadDisplaySet = async (displaySet: DisplaySet) => {
    const dataSource = extensionManager.getActiveDataSource()[0];
    const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
    const { useNorm16Texture } = getCoreConfiguration().rendering;
    const options = {
      targetBuffer: {
        type: useNorm16Texture ? undefined : 'Float32Array',
      },
      preScale: {
        enabled: true,
      },
      requestType: 'prefetch',
      priority: 0,
    };
    return Promise.all(imageLoader.loadAndCacheImages(imageIds, options));
};

@sedghi
Copy link
Member

sedghi commented May 4, 2024

No update, but this will come for next release

@PatrykLuszcz-1
Copy link

@sedghi When we can expect next release ?

@sedghi
Copy link
Member

sedghi commented May 7, 2024

@PatrykLuszcz-1 official release will be somewhere in September probably, but the feature will get merged into master branch (dev) sooner

see our branching logic
https://docs.ohif.org/development/getting-started/#branches

@sedghi
Copy link
Member

sedghi commented May 28, 2024

@lscoder will start on this this week. We will target the top-bottom for now

@lscoder lscoder linked a pull request Jun 10, 2024 that will close this issue
@chriszao
Copy link

Any updates on this? I tried to run @lscoder PR to test it, but didn't get what's changed and how it should work.
In my project, we want to download all images before showing OHIF UI, but I don't understand how the project do the requests to download the images. If someone could help me or give me some guidance to achieve this, I'd be so grateful 🙏🏾

@sedghi
Copy link
Member

sedghi commented Jun 21, 2024

@chriszao you should wait for Leo's PR to get merged first

@lscoder
Copy link
Collaborator

lscoder commented Jun 28, 2024

Any updates on this? I tried to run @lscoder PR to test it, but didn't get what's changed and how it should work. In my project, we want to download all images before showing OHIF UI, but I don't understand how the project do the requests to download the images. If someone could help me or give me some guidance to achieve this, I'd be so grateful 🙏🏾

@chriszao The changes are merged and you need to enable the service first because it is disabled by default. You need to add something like this to your config file:

studyPrefetcher: {
    enabled: true,
    displaySetCount: 2,
    maxNumPrefetchRequests: 10,
    order: 'closest',
  },

You can set the order to "closest", "downward" or "upward".

@chriszao
Copy link

chriszao commented Jul 4, 2024

@lscoder You saved my life with that PR hahaha! 🎉.
Just a small doubt. Is there a way to download all studies? Because from what I understand, it downloads the amount defined in displaySetCount, based on the selected study, right? It would be great if the application was able to download all the studies in the background, doing something similar to what you implemented. But, for example, it downloads every 5 studies (could be a configurable variable), until it downloads them all.

@lscoder
Copy link
Collaborator

lscoder commented Jul 4, 2024

@lscoder You saved my life with that PR hahaha! 🎉. Just a small doubt. Is there a way to download all studies? Because from what I understand, it downloads the amount defined in displaySetCount, based on the selected study, right? It would be great if the application was able to download all the studies in the background, doing something similar to what you implemented. But, for example, it downloads every 5 studies (could be a configurable variable), until it downloads them all.

@chriszao Good to hear that lol It downloads any displaySet returned by displaySetService.getActiveDisplaySets() that can be from the primary studies (StudyInstanceUIDs url parameter) or any related study. The only problem is that the displaySets from related studies are added to the displaySetService only after switching to All tab and clicking on one of the related studies to expand it to show the displaySets. After expanding a related study the study prefetcher can also load the displaySets from it as shown below.

StudyPrefetcher.-.Related.Studies.mp4

Loading all the displaySets from related studies would not be a major change but it would require changing how the prefetcher works because it does not load studies but displaySets from any study.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Needed Feature Request IDC:candidate Possible feature requests for discussion, and if we agree, they can be relabeled IDC:priority
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.