This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def reject_outliers(arr, window_size, threshold): | |
""" | |
Given a 1D signal, replace outliers with the average of the surrounding points. | |
Does the following for every point: | |
1. Computes the median of the sliding window | |
2. Computes the percentage difference between the current point and the | |
sliding window median | |
3. If that deviation exceeds the given threshold, replaces that point with | |
the average of the surrounding two points. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for /r %%f in (*MP4) do ( | |
ffmpeg -i %%f -q:a 0 -map a "%%~nf.wav" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Requirements: | |
// Trainable Weka Segmentation | |
// The list of files to use for training must be described in a text file, | |
// with each line containing the full path to one image. | |
listOfImages = File.openDialog("Choose a file with a list of images:"); | |
imagesString = File.openAsString(listOfImages); | |
images = split(imagesString, "\n"); | |
for (i=0; i<images.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def copy_lut(from_layer, to_layer, opacity=False): | |
""" | |
Copies the visualization properties from one layer to another in napari. | |
Only the colormap, contrast limits, and gamma values are included by default. | |
The opacity can be optionally copied as well. | |
Blending and interpolation are ignored. | |
OlderNewer