Conversation
|
To be discussed: I wrote an update method that can be used to create an updated version of a frozen object:
I renamed I think there are three options:
I still think |
Add PixelMask class
…ting_logic Separate plotting logic from data logic
|
@JulietteFrancovich Then, finally, this last (?) PR. I addressed your comments. Could you check whether you agree with only a Also, this includes a TIVMap that could represent TIV or amplitude. Should we differentiate? |
This PR introduces the PixelMap class for representation of a 2D array of pixel values. It includes math functions to add/subtract/divide/multiply with scalars, arrays or other PixelMaps. It includes a thresholding feature to set values below (or above) a threshold to np.nan. It includes an imshow method to make plotting the pixel map easy.
Subclasses set default values for plotting. There is a convert_to method to convert to different subclasses.
I defined a set of subclasses that can be expanded later.
I've written this according to some new 'best practice' rules:
time(not the case here) andvaluescan be supplied as positional arguments, the rest can only be supplied as keyword arguments.updatemethod that returns a copy with the keyword arguments replacing attributes.I included a test_pixelmap_imshow notebook with examples and tests for the visual part of imshow.
Included in this PR is a slight restructuring of the documentation. I can extract it to a different PR if necessary.
I've tried to keep with default colormaps, or use black -> color. However, I think these can be tweaked a bit further, e.g. with black -> color -> white. Any suggestions are welcome!