Skip to content

Instantly share code, notes, and snippets.

View alexlib's full-sized avatar
:octocat:
Working

Alex Liberzon alexlib

:octocat:
Working
View GitHub Profile
@alexlib
alexlib / openpiv_ultrasound_windef.ipynb
Created October 25, 2022 21:43
openpiv_ultrasound_windef.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexlib
alexlib / MinMaxForPIV.py
Created October 19, 2022 21:28 — forked from nepomnyi/MinMaxForPIV.py
A python min-max filter implementation after Adrain & Westerweel, "Particle image velocimetry", 2011, p.250.
import cv2
import numpy as np
def minMaxFilter(img, filterSize, minContrast):
"""
After R.Adrian, J.Westerweel, "Particle image velocimetry", Cambridge
university press, 2011. See ch.6.1.2, p.248-250.
Parameters: img (cv2.imread) - image to be filtered
filterSize (nd.array) - a 1x2 numpy array of the filter height
and width correspondingly
@alexlib
alexlib / customDeen.py
Created October 19, 2022 21:28 — forked from nepomnyi/customDeen.py
The custom implementation of the PIV image preprocessing algorithm after N. Deen et al., "On image preprocessing for PIV of single- and two-phase flows over reflecting objects", Exp. Fluids, 49(2):525-530, 2010.
def customDeen(frame0,
frame1,
algorithmType = 'basic',
cliplimit = 2.0,
tileGridSize = (4, 4)
):
"""
This is the custom implementation of the image processing alogrithm for PIV
after Deen, Willems, Annaland, Kuipers, Lammertink, Kemperman, Wessling,
Meer, "On image preprocessing for PIV of single and two phase flows over
@alexlib
alexlib / openpiv_webm_black_holes_merge.ipynb
Created October 15, 2022 20:20
openpiv_webm_black_holes_merge.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexlib
alexlib / github_desktop_ubuntu.sh
Created August 29, 2022 18:23 — forked from berkorbay/github_desktop_ubuntu.md
To install Github Desktop for Ubuntu
## Follow this link for further updates to Github Desktop for Ubuntu https://github.com/shiftkey/desktop/releases/latest
# UPDATE (2021-10-18): Thanks to Amin Yahyaabadi's message, the updated code is as follows
sudo wget https://github.com/shiftkey/desktop/releases/download/release-2.9.3-linux3/GitHubDesktop-linux-2.9.3-linux3.deb
### Uncomment below line if you have not installed gdebi-core before
# sudo apt-get install gdebi-core
sudo gdebi GitHubDesktop-linux-2.9.3-linux3.deb
# UPDATE (2021-03-05): Thanks to PaoloRanzi81's comment, the updated code is as follows https://gist.github.com/PaoloRanzi81
@alexlib
alexlib / align_two_3d_vectors_vectorised.py
Created May 12, 2022 18:30 — forked from alisterburt/align_two_3d_vectors_vectorised.py
vectorised version of align_two_3d_vectors.py
def align_vectorised(a: np.ndarray, b: np.ndarray):
"""
Find array of rotation matrices r such that r @ a = b when a and b are arrays of normalised vectors
implementation designed to avoid trig calls
based on https://iquilezles.org/www/articles/noacos/noacos.htm
:param a: normalised vector(s) of length 3
:param b: normalised vector(s) of length 3
:return: rotation matrix
"""
# setup
def random_uniform_rotation(size=1):
"""
Return uniform rotation vectors sampled on a sphere
Args:
size : int
The number of vectors
Returns:
vector: np.ndarray
The rotation vectors
"""
@alexlib
alexlib / napari_interactive_sim.py
Created May 12, 2022 18:28 — forked from alisterburt/napari_interactive_sim.py
2d interactivity with physics simulation in the background
from time import sleep
import napari
import numpy as np
from napari.qt.threading import thread_worker
viewer = napari.Viewer()
bbox_layer = viewer.add_points(
[[-1, -1], [-1, 1], [1, -1], [1, 1]], face_color='green')
points_layer = viewer.add_points([0, 0], face_color='magenta')
@alexlib
alexlib / snake.py
Created May 12, 2022 18:24 — forked from alisterburt/snake.py
snake in napari
from time import sleep
from enum import Enum
import napari
import numpy as np
import psygnal
from napari.qt.threading import thread_worker
BOARD_SIZE = 14
INITIAL_SNAKE_LENGTH = 4
@alexlib
alexlib / live_viewer.ipynb
Created May 12, 2022 18:22 — forked from alisterburt/live_viewer.ipynb
live napari viewer in jupyter-rfb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.