Closed rpeltekov closed 1 month ago
probably also with this task figure out a better way to display the object in the viewer
should also make it variable by the user in the gui, so that they could change the max abs value the colorbar has.
edit: i actually don't think this is really necessary
once you figure out how to run this (maybe it might be worthwhile to figure out how to create a mock scanner so that we can test things....):
currently, the color for the images is determined by the dynamic range of the entire 3d dataset. i.e. the values from every slice. however, this leads to it being very hard to see any visual differences in the b0 map or the actual non b0map image.
to further make it easier to understand what we look at when we check out the images, the colorbar would be nice. like the ones that you can spawn with plt.colorbar() when using matplotlib. it should just show what the max min and midpoint values are next to the spectrum of color seen in the image. since images are b/w, it will just grayscale values that you need to worry about for now.
some tips or places to start: for dynamic range, look here and maybe best to remove the attribute viewMaxAbs, and just use the max(abs(of the slice that is being shown)) for scale.
after that look for a way to have the min / max values in the original slice show up when the slice is rendered before you start attempting a color bar. depending on how hard that will be, this will be enough. this is one of 3 places imageViewer is created, and notice the viewLabel. This is what gui object gets updated with the pixel value when you click on the image. this function modifies the contents of the label, and i want you to simple make sure that a string like "Max {max} Min {min} | " is always displayed regardless of if you are clicking on the image.
in gui.py, add colorbar item near where the image views are created (here for example), and figure out how to sync the update sequence to these images (here) so that the color bar works well?.
probably also make an update function for the colorbar in guiUtils to create the imageViewer, the label for the mouse hover/click event, and also for the color bar at this point so the code isn't repeated to generate all those three times in gui.py