nroduit / Weasis

Weasis is a DICOM viewer available as a desktop application or as a web-based application.
https://nroduit.github.io
Other
821 stars 293 forks source link

Add a feature to fix the slice number while moving in cine #331

Open firasuke opened 2 years ago

firasuke commented 2 years ago

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like When dealing with cinematic images that are taken with different slices (6 slices through an anatomy, in each slice another image is acquired every 10 seconds, making the total number of images equal to 60, when trying to play them it loops through the slices instead of fixing the slice and looping through time. This doesn't happen when the slice position is fixated and no other slices in different levels are taken).

Describe alternatives you've considered No other open-source dicom viewer that I know of has the ability to fix the position and loop through time, instead of just looping through the slices position disregarding time.

Additional context No

nroduit commented 2 years ago

I don't know if I understood correctly. You would like to have a way to limit the loop, for example on a series of 60 images make a loop from image 20 to 30. Is this correct?

If the series contains different anatomical parts, protocols, or directions... it should be split into sub-series automatically. In this way, the loop of the cine would correspond to the needs.

If the series does not separate into subseries, it is possible to change the separation rules. Is there a tag that would define the change within the series?

firasuke commented 2 years ago

I think you did understand correctly. Consider a case where 10 slices are taken through the beating heart, then the entire thing is recorded and imaged retrospectively over the course of 10 seconds (or an X number of cardiac cycles), this amounts to 100 images.

In the case above there are two ways to view cinematic movies:

Method 2 mostly works with most dicom viewers because cinematic views are mostly single slices looping through time, meaning a single slice in the heart (consider a 4-chamber view) that has its position fixed is imaged over the course of 10 seconds, resulting in 10 images, regardless of how you loop through them, it'll appear as the heart is moving.

Method 1 allows you to select the position of the slice beforehand, then loop in time. Example, the third slice passes through the left ventricle, and to view it in cine with time changing one would select slices (3, 13, 23, 33, 43, 53... 93) and so on.

Method 1: out1

Method 2: out2

firasuke commented 2 years ago

I think for this to happen, an option to skip X number of images should be provided, and the X can be changed by the user.

Using the mouse wheel should act as selecting the slice (example slice 4 of 120), then X can be 10 (for 10 seconds), the viewer will then display 4, 14, 24, 34, 44 ... 94 until it gets to 4 and start back again.

nroduit commented 2 years ago

If the goal is simply to apply a filter to the series, this is already possible using the key images.

You have to select the images that will be associated with a Key Object Selection and then activate the filter and play the cine. Moreover, these objects can be saved in DICOM

image

firasuke commented 2 years ago

No the goal isn't to apply a filter to the cine, but rather control the amount of slices that are looping in a cinematic.

An option can be added in the "Cine" window/tab under the option "Speed (fps)", called "Frameskip/Skip Slices/Time" that shows every X slice as selected by the user.

I think the default you're using is 1, just make it an option and it would be good to go.

nroduit commented 2 years ago

No the goal isn't to apply a filter to the cine, but rather control the amount of slices that are looping in a cinematic.

I don't understand the difference. Applying a filter is a generalized way to control the number of images involved in the loop.

What I can do is to add a method to automatically select images when creating a Key Object Selection (KO). That is to say to put an offset and a sampling step to select automatically a sequence of images. The advantage of KOs is to be able to adjust if the cycles contain variations and to save this selection.

I don't want to add directly on the cine because it's the first time I hear this request and it may not be understood by users and complicate the GUI.

firasuke commented 2 years ago

I don't want to add directly on the cine because it's the first time I hear this request and it may not be understood by users and complicate the GUI.

Well this feature is in most proprietary DICOM viewers, and I thought having it in Weasis would make it even more powerful. It's really as simple as having a bottom slider that allows you to pick the slice position and then it starts a cinematic view by moving through time without changing the position so that the organ appears moving.

I don't really think you clearly understood what I meant, even after posting the GIFs above.

I also don't think it would complicate the GUI as it's already full of stuff that aren't that commonly used. Plus, having this option would put Weasis ahead of most open-source DICOM viewers as most don't even support it to begin with.

nroduit commented 2 years ago

I am not actually very familiar with cardiac studies. In order to properly handle this type of exam, new specialized views are required to handle the 4D aspects.

My time on this project is very limited and I already have a lot of tasks to do. Unfortunately, to achieve this kind of specialized functionality, we need contributors.

firasuke commented 2 years ago

I am not actually very familiar with cardiac studies. In order to properly handle this type of exam, new specialized views are required to handle the 4D aspects.

I see.

My time on this project is very limited and I already have a lot of tasks to do. Unfortunately, to achieve this kind of specialized functionality, we need contributors.

Well this is why, as a radiologist irl, I reached out to you as I found Weasis to be the most advanced open-source DICOM viewer available.

To be fair, I still think you didn't understand me correctly or that I didn't properly explain what the request is. I don't think it should be hard for a talented developer like yourself as you've implemented most of the complex stuff in Weasis.

I generally use a shell script written by me to convert the looping images into a cinematic video. It is a very basic script that loops every X number of images based on the time of acquisition and it works fine, but I thought having Weasis support this out of the box with an additional option in its cinematic window wouldn't hurt.

If Weasis had this implemented, I'd definitely recommend it to my colleagues being the only open-source DICOM viewer out there that can properly display cardiac studies.

Thanks for your time, and good luck with your endeavours!

nroduit commented 2 years ago

In order to implement a new feature, I need a specification that clearly defines what needs to be done. If you can provide me a small summary with both what is desired in addition in the GUI (screenshot of a software that has this functionality) and explain the operation on an example of a cine on a series.

Then I could evaluate if this does not lead to wider modifications.

firasuke commented 2 years ago

Here's an example of spatio-temporal acquistions (cinematic views) of the heart when viewed from a DICOM viewer that supports this feature:

https://user-images.githubusercontent.com/46160727/197285174-5943cdcf-2c33-4989-a7fd-65ec90e743ba.mp4

On the right is a single slice 4-chamber view of the heart, and on the left is a 2-chamber view, while the view in the middle is a multi-slice short-axis view.

Weasis doesn't a have a problem displaying the views on the left and right, but the one in the middle is troublesome to view on many DICOM viewers.

Here are the exact views when opened on Weasis:

https://user-images.githubusercontent.com/46160727/197286490-7758ba6c-a8ae-4a36-9d92-735e63f283d4.mp4

The views on the right and left are working as expected because they are single-slice views (slice number doesn't change), but the view in the middle is looping through the slice number instead of moving gracefully through time as shown in the software above.

Hope that clears some confusion.

Edit: Also would it be possible to play all cinematic views at the same time as shown in the example above, and not by hovering or focusing over one to get it to play?

nroduit commented 2 years ago

Thanks for the description. I think some modifications are needed to manage the cardiac cycles. However, it depends strongly on the metadata values like Stack ID Index Value, Temporal Position Index Value, In-Stack Position Number, specific to DICOM Enhanced Sop Classes. Could you send me a sample to understand the metadata that is filled in?

The cine on several views is not possible at the moment but is already on my list of things to improve.

firasuke commented 2 years ago

Could you send me a sample to understand the metadata that is filled in?

Alright, I've sent a sample study to you.

The cine on several views is not possible at the moment but is already on my list of things to improve.

I see. Well that's a shame, looking forward to it though!

nroduit commented 2 years ago

Thanks. I managed to run the cine correctly by changing the sorting of the series.

https://user-images.githubusercontent.com/993975/197600690-ecaf6e74-da3a-4a19-9efe-403e42961215.mp4

firasuke commented 2 years ago

Thanks. I managed to run the cine correctly by changing the sorting of the series.

Ok, I can confirm this is working as intended!

Now the only thing left is to let it loop at that specific/fixed slice number without moving on the next slice.

firasuke commented 8 months ago

Now the only thing left is to let it loop at that specific/fixed slice number without moving on the next slice.

Any updates to this?

nroduit commented 8 months ago

Unfortunately, the requests are numerous and the time I can devote to this project is very limited. Moreover, very specific requests are prioritized low.