Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
name = "ThinPlateSplines"
uuid = "1d861738-f48e-4029-b1d3-81ce6bc7f5ab"
authors = ["Al Nejati"]
version = "0.2.0"
version = "0.2.1"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Tullio = "bc48ee85-29a4-5162-ae0b-a64e1601d4bc"

[weakdeps]
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"

[extensions]
ThinPlateSplinesGeometryBasicsExt = "GeometryBasics"

[compat]
julia = "1, 1.6, 1.7, 1.8"
Tullio = "0.3"
GeometryBasics = "0.4, 0.5"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
21 changes: 21 additions & 0 deletions ext/ThinPlateSplinesGeometryBasicsExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module ThinPlateSplinesGeometryBasicsExt
using GeometryBasics: Point
import ThinPlateSplines: tps_solve, tps_deform, ThinPlateSpline

function tps_solve(
x::AbstractVector{<:Point},
y::AbstractVector{<:Point},
λ;
compute_affine = true
)
x = stack(x; dims=1)
y = stack(y; dims=1)
return tps_solve(x, y, λ; compute_affine)
end

function tps_deform(x2::AbstractVector{<:Point}, tps::ThinPlateSpline)
x2 = stack(x2; dims=1)
deformed = tps_deform(x2, tps)
return Point{size(deformed,2)}.(eachrow(deformed))
end
end