alabamagan / NIfTI-gridview

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

UI issue when image is opened with segmentation #6

Open Adamtk22 opened 2 years ago

Adamtk22 commented 2 years ago

Image display data refuses to update when an image is opened with segmentation. The image must be reselected in the 'Files' tab in order to allow display data to be updated.

Capturenew Image file is deselected after loading segmentation

Steps to reproduce

  1. Open image
  2. Open segmentation
  3. Move sliders for display size or display center position

This line in mainwindow.py partially contributes to this issue Capturemainwindow

alabamagan commented 2 years ago

I noticed this bug too but I wasn't able to consistently reproduce it.

Adamtk22 commented 1 year ago

This issue can be fixed by removing _update_file_list_view from _action_open_segmentation folder This change would not affect the intended behavior since opening segmentations should not interfere with the image folder list

See the commit below https://github.com/Adamtk22/NIfTI-gridview-dev/commit/c7be7d73eef13a0be8f9ab12f1b8f01bc87acb58

alabamagan commented 1 year ago

That line will gray out images without a segmentation to display. I.e., if you open a folder of images and then a segmentation folder only with 10 of 100 cases segmented, it will gray out the 90 cases without the segmentation. I did this because I didn't write the escape in grid generation how to handle it when the segmentation is not found. Also, its more convenient to locate the cases with segmentation. So I would like to keep that line. Perhaps add a refresh after loading the segmentation folders will solve this issue.

Adamtk22 commented 1 year ago

I had another look at _update_file_list_view. Maybe the method could be split into two so that updating list item flags would not require a refilling of the list or some checks could be added into the method to determine if the list is to be refilled

See if this implementation is satisfactory https://github.com/Adamtk22/NIfTI-gridview-dev/commit/bc2487b25526ee05ab215f6256e84a9395b048a5