Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
310 changes: 309 additions & 1 deletion brainspace/plotting/colormaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,312 @@
[70, 130, 180, 255],
[196, 58, 250, 255]], dtype=np.uint8)

colormaps = {'yeo7': yeo7_colors}
eco_kos_colors = np.array([[0, 0, 0, 255],
[126, 40, 127, 255],
[51, 104, 156, 255],
[167, 210, 140, 255],
[254, 205, 8, 255],
Comment on lines +12 to +16

Copilot AI Feb 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new colormap arrays don’t document what they represent (source/expected label set/continuous vs discrete). Adding short comments (e.g., provenance and intended number of labels/colors) above each definition would make this file easier to maintain and help users pick the right map.

Copilot uses AI. Check for mistakes.
[255, 253, 25, 255]], dtype=np.uint8)

spec_5_colors = np.array([[0, 0, 0, 255],
[50, 136, 189, 255],
[171, 221, 164, 255],
[235, 235, 181, 255],
[253, 174, 97, 255],
[213, 62, 79, 255]], dtype=np.uint8)

fs_colours2 = np.array([[ 0, 0, 0, 255],
[ 25, 100, 40, 255],
[125, 100, 160, 255],
[100, 25, 0, 255],
[220, 20, 100, 255],
Comment on lines +26 to +30

Copilot AI Feb 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fs_colours2 uses inconsistent spelling compared to the existing *_colors variables in this module (e.g., yeo7_colors). Rename to fs_colors2 (and update the colormaps dict accordingly) to keep naming consistent.

Copilot uses AI. Check for mistakes.
[220, 20, 10, 255],
[180, 220, 140, 255],
[220, 60, 220, 255],
[180, 40, 120, 255],
[140, 20, 140, 255],
[ 20, 30, 140, 255],
[ 35, 75, 50, 255],
[225, 140, 140, 255],
[200, 35, 75, 255],
[160, 100, 50, 255],
[ 20, 220, 60, 255],
[ 60, 220, 60, 255],
[220, 180, 140, 255],
[ 20, 100, 50, 255],
[220, 60, 20, 255],
[120, 100, 60, 255],
[220, 20, 20, 255],
[220, 180, 220, 255],
[ 60, 20, 220, 255],
[160, 140, 180, 255],
[ 80, 20, 140, 255],
[ 75, 50, 125, 255],
[ 20, 220, 160, 255],
[ 20, 180, 140, 255],
[140, 220, 220, 255],
[ 80, 160, 20, 255],
[100, 0, 100, 255],
[ 70, 70, 70, 255],
[150, 150, 200, 255],
[255, 192, 32, 255]], dtype=np.uint8)

BuGyRd = np.array([[33, 113, 181, 255],
[35, 115, 182, 255],
[37, 117, 183, 255],
[39, 119, 184, 255],
[41, 121, 185, 255],
Comment on lines +62 to +66

Copilot AI Feb 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BuGyRd is defined with mixed naming style (CamelCase) and without the _colors suffix used by the other colormaps. Consider renaming to something like bu_gyrd_colors (and using a consistently-cased key in colormaps) to keep the public colormap names predictable.

Copilot uses AI. Check for mistakes.
[43, 123, 186, 255],
[45, 125, 187, 255],
[47, 127, 188, 255],
[49, 129, 189, 255],
[51, 131, 190, 255],
[53, 133, 191, 255],
[55, 135, 192, 255],
[57, 137, 193, 255],
[59, 139, 194, 255],
[61, 141, 195, 255],
[64, 144, 197, 255],
[66, 146, 198, 255],
[68, 147, 199, 255],
[71, 149, 200, 255],
[73, 151, 201, 255],
[76, 153, 202, 255],
[79, 154, 203, 255],
[81, 156, 204, 255],
[84, 158, 205, 255],
[86, 160, 206, 255],
Comment on lines +63 to +86

Copilot AI Feb 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BuGyRd array formatting is inconsistent with the earlier arrays (elements are not indented/aligned), which makes it hard to read and review. Reformat this block to match the style used for yeo7_colors/fs_* (consistent indentation and alignment).

Suggested change
[35, 115, 182, 255],
[37, 117, 183, 255],
[39, 119, 184, 255],
[41, 121, 185, 255],
[43, 123, 186, 255],
[45, 125, 187, 255],
[47, 127, 188, 255],
[49, 129, 189, 255],
[51, 131, 190, 255],
[53, 133, 191, 255],
[55, 135, 192, 255],
[57, 137, 193, 255],
[59, 139, 194, 255],
[61, 141, 195, 255],
[64, 144, 197, 255],
[66, 146, 198, 255],
[68, 147, 199, 255],
[71, 149, 200, 255],
[73, 151, 201, 255],
[76, 153, 202, 255],
[79, 154, 203, 255],
[81, 156, 204, 255],
[84, 158, 205, 255],
[86, 160, 206, 255],
[35, 115, 182, 255],
[37, 117, 183, 255],
[39, 119, 184, 255],
[41, 121, 185, 255],
[43, 123, 186, 255],
[45, 125, 187, 255],
[47, 127, 188, 255],
[49, 129, 189, 255],
[51, 131, 190, 255],
[53, 133, 191, 255],
[55, 135, 192, 255],
[57, 137, 193, 255],
[59, 139, 194, 255],
[61, 141, 195, 255],
[64, 144, 197, 255],
[66, 146, 198, 255],
[68, 147, 199, 255],
[71, 149, 200, 255],
[73, 151, 201, 255],
[76, 153, 202, 255],
[79, 154, 203, 255],
[81, 156, 204, 255],
[84, 158, 205, 255],
[86, 160, 206, 255],

Copilot uses AI. Check for mistakes.
[89, 161, 207, 255],
[91, 163, 208, 255],
[94, 165, 209, 255],
[97, 167, 210, 255],
[99, 168, 211, 255],
[102, 170, 212, 255],
[104, 172, 213, 255],
[107, 174, 214, 255],
[110, 175, 214, 255],
[113, 177, 215, 255],
[117, 179, 216, 255],
[120, 181, 216, 255],
[123, 183, 217, 255],
[126, 184, 218, 255],
[129, 186, 218, 255],
[133, 188, 219, 255],
[136, 190, 220, 255],
[139, 191, 220, 255],
[142, 193, 221, 255],
[145, 195, 222, 255],
[148, 197, 223, 255],
[152, 198, 223, 255],
[155, 200, 224, 255],
[158, 202, 225, 255],
[160, 203, 226, 255],
[163, 204, 226, 255],
[166, 205, 227, 255],
[168, 206, 228, 255],
[171, 207, 229, 255],
[173, 208, 230, 255],
[176, 209, 231, 255],
[178, 210, 232, 255],
[181, 211, 233, 255],
[183, 212, 233, 255],
[186, 213, 234, 255],
[188, 214, 235, 255],
[191, 216, 236, 255],
[193, 217, 237, 255],
[196, 218, 238, 255],
[198, 219, 239, 255],
[199, 220, 239, 255],
[201, 221, 240, 255],
[202, 222, 240, 255],
[204, 223, 241, 255],
[205, 224, 241, 255],
[207, 225, 242, 255],
[208, 226, 242, 255],
[210, 227, 243, 255],
[211, 228, 243, 255],
[213, 229, 244, 255],
[214, 230, 244, 255],
[216, 231, 245, 255],
[217, 232, 245, 255],
[219, 233, 246, 255],
[220, 234, 246, 255],
[222, 235, 247, 255],
[224, 236, 247, 255],
[225, 237, 248, 255],
[227, 238, 248, 255],
[228, 239, 249, 255],
[230, 240, 249, 255],
[231, 241, 250, 255],
[233, 242, 250, 255],
[235, 243, 251, 255],
[236, 244, 251, 255],
[238, 245, 252, 255],
[239, 246, 252, 255],
[241, 247, 253, 255],
[242, 248, 253, 255],
[244, 249, 254, 255],
[246, 250, 254, 255],
[246, 250, 254, 255],
[245, 249, 252, 255],
[244, 247, 251, 255],
[243, 246, 249, 255],
[242, 244, 247, 255],
[240, 243, 246, 255],
[239, 242, 244, 255],
[238, 240, 242, 255],
[237, 239, 241, 255],
[236, 238, 239, 255],
[235, 236, 238, 255],
[234, 235, 236, 255],
[233, 233, 234, 255],
[231, 232, 233, 255],
[230, 231, 231, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 229, 229, 255],
[229, 227, 226, 255],
[231, 224, 222, 255],
[232, 222, 218, 255],
[234, 219, 213, 255],
[235, 216, 209, 255],
[237, 214, 205, 255],
[238, 211, 200, 255],
[239, 209, 196, 255],
[241, 206, 192, 255],
[242, 203, 188, 255],
[244, 201, 183, 255],
[245, 198, 179, 255],
[247, 195, 175, 255],
[248, 193, 171, 255],
[250, 190, 166, 255],
[251, 187, 162, 255],
[252, 185, 159, 255],
[252, 182, 156, 255],
[252, 180, 153, 255],
[252, 177, 150, 255],
[252, 175, 147, 255],
[252, 172, 144, 255],
[252, 169, 141, 255],
[252, 167, 138, 255],
[252, 164, 135, 255],
[252, 162, 132, 255],
[252, 159, 129, 255],
[252, 157, 126, 255],
[252, 154, 123, 255],
[252, 151, 120, 255],
[252, 149, 117, 255],
[252, 146, 114, 255],
[251, 144, 112, 255],
[251, 141, 109, 255],
[251, 139, 107, 255],
[251, 136, 104, 255],
[251, 134, 102, 255],
[251, 131, 99, 255],
[251, 129, 97, 255],
[251, 126, 94, 255],
[251, 124, 92, 255],
[251, 121, 89, 255],
[251, 119, 87, 255],
[251, 116, 84, 255],
[251, 114, 82, 255],
[251, 111, 79, 255],
[251, 109, 77, 255],
[251, 106, 74, 255],
[250, 103, 72, 255],
[249, 100, 70, 255],
[248, 97, 68, 255],
[248, 94, 66, 255],
[247, 91, 65, 255],
[246, 89, 63, 255],
[245, 86, 61, 255],
[245, 83, 59, 255],
[244, 80, 57, 255],
[243, 77, 55, 255],
[242, 74, 53, 255],
[242, 71, 51, 255],
[241, 68, 49, 255],
[240, 65, 48, 255],
[239, 62, 46, 255],
[239, 59, 44, 255],
[237, 57, 43, 255],
[234, 55, 42, 255],
[232, 52, 41, 255],
[230, 50, 40, 255],
[228, 48, 39, 255],
[225, 46, 38, 255],
[223, 44, 37, 255],
[221, 41, 36, 255],
[219, 39, 35, 255],
[216, 37, 34, 255],
[214, 35, 33, 255],
[212, 33, 32, 255],
[210, 30, 31, 255],
[207, 28, 30, 255],
[205, 26, 30, 255],
[203, 24, 29, 255],
[200, 23, 28, 255],
[198, 22, 28, 255],
[196, 22, 27, 255],
[193, 21, 27, 255],
[191, 21, 26, 255],
[188, 20, 26, 255],
[186, 20, 25, 255],
[184, 19, 25, 255],
[181, 18, 24, 255],
[179, 18, 24, 255],
[177, 17, 23, 255],
[174, 17, 23, 255],
[172, 16, 22, 255],
[169, 16, 22, 255],
[167, 15, 21, 255],
[165, 15, 21, 255],
[161, 14, 20, 255],
[157, 13, 20, 255],
[153, 12, 19, 255],
[149, 11, 19, 255],
[145, 10, 18, 255],
[141, 9, 18, 255],
[138, 8, 17, 255],
[134, 7, 17, 255],
[130, 6, 16, 255],
[126, 5, 16, 255],
[122, 4, 15, 255],
[118, 3, 15, 255],
[114, 2, 14, 255],
[110, 1, 14, 255],
[106, 0, 13, 255],
[103, 0, 13, 255]], dtype=np.uint8)

colormaps = {'yeo7': yeo7_colors, 'BuGyRd': BuGyRd,
'eco_kos': eco_kos_colors, 'spec_5': spec_5_colors, 'fs': fs_colours2 }
Comment on lines +319 to +320

Copilot AI Feb 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New built-in colormaps are added here but there’s no test coverage ensuring plot_surf can resolve these keys via the colormaps dict. Add a lightweight plotting test that uses one of the new keys (e.g., 'eco_kos' or 'BuGyRd') so failures show up quickly if the dict changes.

Copilot uses AI. Check for mistakes.
6 changes: 5 additions & 1 deletion brainspace/plotting/surface_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
orientations = {'medial': (0, -90, -90),
'lateral': (0, 90, 90),
'ventral': (0, 180, 0),
'dorsal': (0, 0, 0)}
'dorsal': (0, 0, 0),
'anterior': (90, 90, 90),
'posterior': (270, 90, 90),
'flatL': (0, 180, 90),
'flatR': (0, 180, 270)}
Comment on lines +27 to +31

Copilot AI Feb 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstrings for build_plotter and plot_surf still list possible view values as only {'lateral','medial','ventral','dorsal'}, but this change adds additional supported views (anterior/posterior/flatL/flatR). Update the docstrings to include the new options so users can discover them and the documentation stays accurate.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +31

Copilot AI Feb 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New view keys flatL/flatR introduce mixed casing while all existing view keys are lowercase. Consider renaming these to a consistent lowercase/snake_case form (and optionally keeping backward-compatible aliases) to avoid surprising, case-sensitive API behavior.

Suggested change
'flatL': (0, 180, 90),
'flatR': (0, 180, 270)}
'flat_l': (0, 180, 90),
'flat_r': (0, 180, 270)}

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +31

Copilot AI Feb 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These new view orientations are user-facing behavior but aren’t covered by plotting tests. Adding a small unit test that calls build_plotter/plot_surf with one of the new view strings (e.g., 'anterior') would prevent regressions (e.g., typos in the orientations dict).

Copilot uses AI. Check for mistakes.


def _add_colorbar(ren, lut, location, **cb_kwds):
Expand Down
Loading