alabamagan / NIfTI-gridview

A pyQt interface to visualize NIfTI images as grided images.
MIT License
6 stars 2 forks source link

Mismatch segmentation and image #4

Open alabamagan opened 2 years ago

alabamagan commented 2 years ago

When shifting the setting display size and x y position, there could be a mismatch between the contour and the image.

圖片

Adamtk22 commented 1 year ago

I was only able to recreate this issue with the display size slider. The xy position sliders did not cause any mismatches. The issue could be fixed by uncommenting self.draw_worker.run call in _update_image_data from mainwindow.py, but it results in decreased performance while segmentations are opened.

Capture

alabamagan commented 1 year ago

This run() function is the signal for background job to generate the image. Might be that's a problem but I can't remember why I put a background job here. What behavioral changes did you note after changing that line?

Adamtk22 commented 1 year ago

Without uncommenting that line, the issue can be recreated by rapidly moving the display slider. The mismatch did not manifest when I moved the slider slowly. Uncommenting that line allowed the display size slider to be moved rapidly without causing mismatches, but at the expense of increased stuttering while changing display size with segmentations opened.

alabamagan commented 1 year ago

Ah I see, I use this configuration for the smoothness. Perhaps you can implement an addition function wrapping the current one that listen to the mouse move event, and then if the last mouse move event is say 0.X second ago, kick the draw_worker for refreshing the picture?