Skip to content

Commit

Permalink
Merge pull request #952 from maharshi-gor/rf/code_spell
Browse files Browse the repository at this point in the history
RF: Code Spell Fixed
  • Loading branch information
skoudoro authored Dec 13, 2024
2 parents d57df65 + 051365e commit 40481aa
Show file tree
Hide file tree
Showing 24 changed files with 9,031 additions and 9,025 deletions.
4 changes: 2 additions & 2 deletions docs/examples/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"\n",
"\n",
"def screenshot(event):\n",
" show_m.snapshot('snapshot.png')\n",
" show_m.snapshot(\"snapshot.png\")\n",
"\n",
"\n",
"cube.add_event_handler(screenshot, \"click\")\n",
Expand Down Expand Up @@ -87,7 +87,7 @@
" gfx.MeshPhongMaterial(color=\"blue\", pick_write=True),\n",
")\n",
"\n",
"show_m.scene.add(cube2)\n"
"show_m.scene.add(cube2)"
]
},
{
Expand Down
10 changes: 5 additions & 5 deletions docs/examples/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@

s = sphere(15, color=(1, 0, 1, 1), position=(25, 25, 25))

point_cloud = points(3,
point_positions=[(5, -5, 5), (-5, 5, 5), (5, 5, -5)],
colors=[(1, 1, 1, 1), (1, 1, 0, 1), (1, 0, 0, 1)])
point_cloud = points(
3,
point_positions=[(5, -5, 5), (-5, 5, 5), (5, 5, -5)],
colors=[(1, 1, 1, 1), (1, 1, 0, 1), (1, 0, 0, 1)],
)

# show_m.scene.add(cube)
show_m.scene.add(s)
show_m.scene.add(point_cloud)




# def screenshot(event):
# show_m.snapshot('snapshot.png')

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/example_offscreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@


def screenshot(event):
show_m.snapshot('snapshot.png')
show_m.snapshot("snapshot.png")


# cube.add_event_handler(screenshot, "click")

if __name__ == "__main__":
show_m.render()
show_m.canvas.draw()
show_m.snapshot('offscreen.png')
show_m.snapshot("offscreen.png")
18 changes: 7 additions & 11 deletions docs/examples/example_streamlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
from fury.colormap import distinguishable_colormap

fname = os.path.expanduser(
'~/.dipy/bundle_atlas_hcp842/Atlas_80_Bundles/bundles/AC.trk')
"~/.dipy/bundle_atlas_hcp842/Atlas_80_Bundles/bundles/AC.trk"
)

sft = load_tractogram(fname, 'same', bbox_valid_check=False)
sft = load_tractogram(fname, "same", bbox_valid_check=False)
streamlines = sft.streamlines

# Pygfx window setup
Expand All @@ -33,16 +34,11 @@
color = next(color_gen)
start_idx = int(pygfx_offsets[i] + i)
end_idx = int(start_idx + pygfx_lengths[i])
pygfx_streamlines = np.insert(
pygfx_streamlines, end_idx, nan_buffer, axis=0)
pygfx_streamlines = np.insert(pygfx_streamlines, end_idx, nan_buffer, axis=0)
pygfx_colors[start_idx:end_idx] = (*color, 1)

# Pygfx line definition
lines = lines(
positions=pygfx_streamlines,
colors=pygfx_colors,
color_mode='vertex'
)
lines = lines(positions=pygfx_streamlines, colors=pygfx_colors, color_mode="vertex")

show_m.scene.add(lines)

Expand All @@ -60,7 +56,7 @@ def on_pick(event):
print("Vertex Coord: ", pygfx_streamlines[vertex])
selected = find_line(vertex)
color = pygfx_colors[selected[0]][:3]
pygfx_colors[selected[0]:selected[1] + 1] = (*color, 0.5)
pygfx_colors[selected[0] : selected[1] + 1] = (*color, 0.5)
lines.geometry.colors.update_range()
show_m.update()

Expand All @@ -78,6 +74,6 @@ def find_line(vertex):
return [left + 1, right - 1]


if __name__ == '__main__':
if __name__ == "__main__":
show_m.render()
show_m.start()
4 changes: 1 addition & 3 deletions docs/examples/example_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ def clicked(event):

# panel.obj.add_event_handler(clicked, 'pointer_down')
show_m.scene.add(panel.obj)
panel.obj.handle_event(gfx.PointerEvent(x=10, y=10, type='pointer_down'))

panel.obj.handle_event(gfx.PointerEvent(x=10, y=10, type="pointer_down"))


# geo = gfx.plane_geometry(200, 50)
Expand All @@ -33,7 +32,6 @@ def clicked(event):
# show_m.scene.add(obj)



if __name__ == "__main__":
show_m.render()
show_m.start()
Loading

0 comments on commit 40481aa

Please sign in to comment.