Skip to content

Instantly share code, notes, and snippets.

Avatar

David Haberthür habi

  • Institute of Anatomy, Unversity of Bern, Switzerland
  • Bern, Switzerland
View GitHub Profile
View for.map.atownsend.org.uk.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View GPXsplitter.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@habi
habi / Imread.ipynb
Last active Jun 22, 2021
Issues with different `imreads`
View Imread.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View sed_citations.sh
sed -i 's/Haberthuer2010/doi:10.1107\/S0909049510019618/g' *.md
sed -i 's/Haberthur2013/doi:10.1152\/japplphysiol.00642.2013/g' *.md
sed -i 's/Haberth_r2013/doi:10.1152\/japplphysiol.00642.2013/g' *.md
sed -i 's/Haberth_r_2013/doi:10.1152\/japplphysiol.00642.2013/g' *.md
sed -i 's/haberthr/doi:10.5281\/zenodo.3768407/g' *.md
sed -i 's/Barr__2014/doi:10.14814\/phy2.12063/g' *.md
sed -i 's/Barr__2016/doi:10.1152\/ajplung.00325.2016/g' *.md
sed -i 's/Tschanz_2014/doi:10.1152\/japplphysiol.01355.2013/g' *.md
sed -i 's/TSCHANZ_2011/doi:10.1111\/j.1365-2818.2010.03481.x/g' *.md
sed -i 's/Schittny_2008/doi:10.1152\/ajplung.00296.2007/g' *.md
View adventsfenster.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@habi
habi / cropper.py
Created Nov 24, 2020
Crop a (DASK) array of (tomographic) data to the biggest blob present in it.
View cropper.py
def cropper(image,
despeckle=True,
verbose=False,
threshold=50):
'''Crop array to biggest item in it'''
dimensions = len(image.shape)
if verbose:
print('Cropping %s-dimensional image' % dimensions)
# Threshold
thresholded = image > threshold
@habi
habi / cropper.py
Last active Sep 28, 2020
Function to crop a dataset to the smallest cuboid that contains (denoised) data. Displays the data if requested.
View cropper.py
def cropper(image,
despeckle=True,
verbose=False,
threshold=50):
'''Crop array to biggest item in it'''
dimensions = len(image.shape)
if verbose:
print('Cropping %s-dimensional image' % dimensions)
# Threshold
thresholded = image > threshold
View bern.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View export.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View download.all.sh
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' http://habi.gna.ch/u/yta