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
# coding: utf-8 | |
# https://twitter.com/loicaroyer/status/1146173537658404864 | |
# | |
# #Python Twitter Challenge | |
# Given a list of integers u=[a_0, ..., a_m] | |
# find the set of indices {i_0, ..., i_n} for that list such that the product | |
# u[i_0]* ... *u[i_n] is the closest to a given integer N. | |
# The shortest and most #elegant solution wins. | |
# (standard libs allowed) | |
# |
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
function [bg,image,binary3D] = rollingBallBackgroundViaBinary3D(image,ballRadius,smooth) | |
%rollingBallBackgroundViaBinary3D Calculate rolling ball background | |
% | |
% INPUT | |
% image - 2D image of positive integers | |
% ballRadius - (optional) radius of rolling ball, default: 5 | |
% smooth - (optional) radius for Gaussian smoothing | |
% | |
% OUTPUT | |
% bg - rolling ball estimated background |
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
// Rolling Ball Test via Binary 3D Landscape | |
// Mark Kittisopikul | |
// December 2019 | |
// References | |
// 1. SR Sternberg. Biomedical Image Processing. IEEE Computer 1983. | |
// https://doi.ieeecomputersociety.org/10.1109/MC.1983.1654163 | |
// 2. SR Sternberg. Grayscale Morphology. CVGIP 1986 | |
// https://doi.org/10.1016/0734-189X(86)90004-6 | |
// 3. R Adams. “Radial Decomposition of Discs and Spheres”. |
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
import StatsBase | |
""" | |
xs,ys = samplePairs(x,y,nSamples=length(x)*length(y)) | |
Samples a pair of values, one from x and one from y, without repetition | |
""" | |
function samplePairs(x::AbstractVector{T}, y::AbstractVector{T}; nSamples=length(x)*length(y)) where {T} | |
xout = Vector{T}(undef,nSamples) | |
yout = Vector{T}(undef,nSamples) | |
p = length(x)*length(y) | |
s = zeros(Int,nSamples) |
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
# Hacked toether from https://github.com/JuliaLang/julia/blob/2d5741174ce3e6a394010d2e470e4269ca54607f/stdlib/LinearAlgebra/src/lapack.jl#L1371 | |
# http://www.netlib.org/lapack/explore-html/d6/d10/group__complex16_g_esolve_ga61e68db68886c3f80753fac87ca35a6e.html#ga61e68db68886c3f80753fac87ca35a6e | |
using LinearAlgebra | |
const liblapack = Base.liblapack_name | |
import LinearAlgebra.LAPACK.chklapackerror, LinearAlgebra.LAPACK.subsetrows | |
import ..LinearAlgebra.BLAS.@blasfunc |
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
"Allows for the splitting output among several AbstractDisplays" | |
module Tee | |
import Base.Multimedia.display | |
import Base.TextDisplay | |
import Base: flush, close | |
export TeeDisplay, display, teeDisplay, FlushingTextDisplay, flush, close | |
""" | |
TeeDisplay(displays::Vector{AbstractDisplay}) | |
TeeDisplay(args::AbstractDisplay...) |
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
""" | |
napari.jl | |
Test using PyCall.jl to invoke Napari ( http://github.com/napari ) from | |
the Julia language ( https://julialang.org/ ) 1.3.1 | |
Mark Kittisopikul | |
January 29th, 2020 | |
""" |
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
#@output Integer nFrames | |
//Sum_contour_lengths_by_frame_ | |
//Mark Kittisopikul | |
//February 14th, 2020 | |
//Install into Fiji.app/plugins/Scripts/Plugins/Curve Tracing/ | |
//Companion to https://github.com/jalmar/CurveTracing | |
//Add up | |
importClass(Packages.ij.IJ); | |
importClass(Packages.ij.plugin.frame.RoiManager) |
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
using JavaCall; | |
println("I threw a wish in the well ...") | |
JavaCall.init() | |
println("Hey, I just met you and this is crazy") | |
jls = @jimport java.lang.System | |
version = jcall(jls,"getProperty",JString,(JString,),"java.version") | |
println("Java Version: ",version) | |
jlm = @jimport java.lang.Math | |
@async begin | |
println("But here's my number, so call me maybe") |
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
# This file is machine-generated - editing it directly is not advised | |
[[AbstractTrees]] | |
deps = ["Markdown"] | |
git-tree-sha1 = "86d092c2599f1f7bb01668bf8eb3412f98d61e47" | |
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" | |
version = "0.3.2" | |
[[Adapt]] | |
deps = ["LinearAlgebra"] |
OlderNewer