Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

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

Open igoroctaviano opened this issue 1 year ago • 17 comments

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 avatar May 03 '23 21:05 igoroctaviano

Same as #883 , pending since long time

arunvc avatar Jun 08 '23 05:06 arunvc

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

Amal-p avatar Jun 08 '23 05:06 Amal-p

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

asphub avatar Jun 08 '23 05:06 asphub

Same here, eagerly await this feature!

Yonatanmh avatar Jun 22 '23 19:06 Yonatanmh

  • 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 avatar Aug 08 '23 14:08 james-hanks

@dan-rukas any updates on this one?

igoroctaviano avatar Sep 08 '23 19:09 igoroctaviano

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

sedghi avatar Sep 14 '23 14:09 sedghi

We will investigate and design during upcoming UI redesign

james-hanks avatar Sep 29 '23 15:09 james-hanks

@james-hanks any updates on this?

fedorov avatar Nov 03 '23 20:11 fedorov

@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 avatar Nov 08 '23 18:11 james-hanks

  • 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

james-hanks avatar Dec 15 '23 21:12 james-hanks

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

GlebVST avatar Apr 22 '24 04:04 GlebVST

Any update on this?

jrudascas avatar Apr 30 '24 17:04 jrudascas

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));
};

GlebVST avatar May 01 '24 14:05 GlebVST

No update, but this will come for next release

sedghi avatar May 04 '24 15:05 sedghi

@sedghi When we can expect next release ?

PatrykLuszcz-1 avatar May 07 '24 07:05 PatrykLuszcz-1

@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 avatar May 07 '24 13:05 sedghi

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

sedghi avatar May 28 '24 16:05 sedghi

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 avatar Jun 20 '24 18:06 chriszao

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

sedghi avatar Jun 21 '24 15:06 sedghi

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".

lscoder avatar Jun 28 '24 21:06 lscoder

@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 avatar Jul 04 '24 18:07 chriszao

@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.

https://github.com/OHIF/Viewers/assets/931820/e3c6304a-9c67-4555-9761-ae2f9dec49d7

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.

lscoder avatar Jul 04 '24 19:07 lscoder