Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e4aea40
added the optim code
hzarei4 May 30, 2023
7ecba4b
added the general 7 parameters fitting
hzarei4 May 31, 2023
0c828e5
Updated the helpa and examples
hzarei4 Jun 2, 2023
b8b89a5
Merge pull request #1 from hzarei4/developement
hzarei4 Jun 2, 2023
e09916b
Updated the Project and removed the additional dep
hzarei4 Jun 2, 2023
86a1037
Merge pull request #2 from hzarei4/developement
hzarei4 Jun 2, 2023
31636e8
N-dimensional generalization
Jan 25, 2024
77ebdbc
Merge pull request #3 from hzarei4/developement
hzarei4 Jan 25, 2024
0062797
Removing clutters
Jan 25, 2024
c1acf27
cleaning the main code
hzarei4 Feb 26, 2024
db04c00
Merge pull request #4 from hzarei4/developement
hzarei4 Feb 26, 2024
d8e7145
Merge pull request #4 from hzarei4/main
hzarei4 Feb 26, 2024
8ae0a6f
one allocation
RainerHeintzmann Feb 26, 2024
fd56e1c
added random seed and fixed type stability
hzarei4 Feb 27, 2024
c236014
added the function input support
hzarei4 Mar 28, 2024
63f548c
rewrote some bits towards modularity
RainerHeintzmann Apr 3, 2024
09f49bf
cleanup
RainerHeintzmann Apr 3, 2024
82d886c
Tried taylor_test.jl
RainerHeintzmann Apr 3, 2024
9790667
added a test for a multidimensional taylor expansion
RainerHeintzmann Apr 4, 2024
3fcc290
Fixed the speed and allocations, tip: don't assign `Array` type to `itp`
hzarei4 Apr 5, 2024
e19d0bd
Merge branch 'develop' of https://github.com/RainerHeintzmann/DataToF…
hzarei4 Apr 5, 2024
c2338f9
fixed polynomial memory up to order 2
RainerHeintzmann Apr 5, 2024
739bbc9
merged
RainerHeintzmann Apr 5, 2024
5688b45
Merge branch 'develop' of https://github.com/RainerHeintzmann/DataToF…
RainerHeintzmann Apr 5, 2024
5c533d2
adding functional input as `get_function_general`, cleaning `export`s
hzarei4 Apr 5, 2024
f8c69f0
Merge branch 'develop' of https://github.com/RainerHeintzmann/DataToF…
hzarei4 Apr 5, 2024
e94bbcd
working version of non-linear deformations
RainerHeintzmann Apr 5, 2024
60c39f6
Merge branch 'develop' of https://github.com/RainerHeintzmann/DataToF…
RainerHeintzmann Apr 5, 2024
ef19af5
modded
hzarei4 Jul 10, 2024
87f4325
added Github workflow
hzarei4 Jul 10, 2024
3787978
renaming ci.yml
hzarei4 Jul 10, 2024
2a1b764
fixed bug and without creator
RainerHeintzmann Jul 14, 2024
9c2c7f7
finally got it working fast
RainerHeintzmann Jul 14, 2024
22f6789
a bit of cleanup
RainerHeintzmann Jul 14, 2024
8c7ddc7
removed Unrolled
RainerHeintzmann Jul 15, 2024
38cbb83
added a Pluto example notebook + bugfixes
RainerHeintzmann Jul 15, 2024
e738204
example of polynomial IM
hzarei4 Jul 15, 2024
0f1079f
Merge branch 'develop' of https://github.com/RainerHeintzmann/DataToF…
hzarei4 Jul 15, 2024
bd2c5e9
updated ci.yml
hzarei4 Jul 15, 2024
133ca00
removed undefined export
hzarei4 Jul 15, 2024
76b7d14
modified tutorial to the new commits
hzarei4 Jul 15, 2024
85efbbc
updated tutorial
hzarei4 Jul 15, 2024
b8d6c7d
modded ci.yml
hzarei4 Jul 15, 2024
fc8a3f9
added eevbranch
hzarei4 Jul 15, 2024
a6e3615
better Pluto sliders
RainerHeintzmann Jul 15, 2024
47d9a0b
better Pluto example
RainerHeintzmann Jul 15, 2024
6acc73e
Documenter and DocumenterTools
RainerHeintzmann Jul 16, 2024
bc04932
added the @generated tag to allow arbitrary dimensions
RainerHeintzmann Jul 22, 2024
4e117fb
modified to use EvalMultiPoly.jl
hzarei4 Jul 23, 2024
4c041b9
added CUDA functionality and some examples
hzarei4 Oct 30, 2024
0f7f69c
updated Project.toml
RainerHeintzmann Jun 10, 2025
4885978
updated Project.toml, compatible with new ver of Interpolations.jl.
hzarei4 Aug 28, 2025
8878d94
Merge branch 'develop' of https://github.com/RainerHeintzmann/DataToF…
hzarei4 Aug 28, 2025
fe8ddee
added example
RainerHeintzmann Apr 29, 2026
9d2e868
updated the CI to pass the tests
hzarei4 Apr 29, 2026
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
Binary file added .DS_Store
Binary file not shown.
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CI
on:
pull_request:
branches:
- main
- develop
push:
branches:
- main
- develop
tags: '*'
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.9'
os:
- [ubuntu-latest]
arch:
- x64
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- name: Add unregistered dependencies
run: julia -e 'using Pkg; Pkg.develop(PackageSpec(url="https://github.com/rainerheintzmann/EvalMultiPoly.jl"))'

- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: lcov.info


docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: "1.9"
- name: Add unregistered dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(url="https://github.com/rainerheintzmann/EvalMultiPoly.jl")); Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'

- uses: julia-actions/julia-docdeploy@releases/v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,19 @@ docs/site/
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml
examples/Manifest.toml
examples/*.tiff
examples/image_registration_2dpolim.jl

*.mp4
*.png
examples/figures/*
examples/*.tif
examples/*.ipynb
*.jpeg
*.gif
*.jpg
*.txt
*.txt
.*tiff
examples/6-4-Rigis.jl
20 changes: 20 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,25 @@ authors = ["RainerHeintzmann <heintzmann@gmail.com>"]
version = "0.1.0"

[deps]
EvalMultiPoly = "c78649ec-f9ed-405e-be6d-0472f43586aa"
FourierTools = "b18b359b-aebc-45ac-a139-9c0ccbb2871e"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
FourierTools = "0.4"
Interpolations = "0.15.1, 0.16"
StaticArrays = "1.9.6, 1.10"
Aqua = "0.8"
Test = "1.9.3"
Zygote = "0.6.70"
julia = "1"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[targets]
test = ["Aqua", "Test", "Zygote"]
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# DataToFunctions.jl
Represents (measured) data as a function, which supports scaling and shifting. It is intended to be used as a tool for fitting data, where the fitting function is given by measured data.
Represents (measured) data as a function, which supports affine and generally, matrix transformations for arrays. It is intended to be used as a tool for fitting data, where the fitting function is given by measured data.

It assumes the data as an Interpolation object (function), then it can transform the data to any arbitrary affine or matrix transformations.

What is important about this package is that it does not assume any pre-defined function as the data for the inverse modeling procedures.
11 changes: 11 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[deps]
DataToFunctions = "64cfdffa-4d02-49ee-ae8b-a805370874f5"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
EvalMultiPoly = "c78649ec-f9ed-405e-be6d-0472f43586aa"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
SyntheticObjects = "e7028c27-0967-45e9-8fdb-dbc10ccb2b0a"
23 changes: 23 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import Pkg
Pkg.activate(@__DIR__)

cd(@__DIR__) # go into `docs` folder

using Documenter, Literate, DataToFunctions

# convert tutorial/examples to markdown
Literate.markdown("./src/tutorial.jl", "./src")
# Which markdown files to compile to HTML
# (which is also the sidebar and the table
# of contents for your documentation)

pages = Any[
"Introduction" => "index.md",
"Tutorial" => "tutorial.md",
"API" => "api.md",
]

# compile to HTML:
makedocs(; sitename="DataToFunctions.jl", pages, modules = [DataToFunctions], warnonly = true)

deploydocs(repo = "github.com/RainerHeintzmann/DataToFunctions.jl.git", devbranch = "develop")
20 changes: 20 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# API

```@docs
get_function
add_dim
red_dim
red_dim_apply
idx_appy
mat_mul
func_transform
func_transform_tup
apply_transform
apply_transform_homogen
apply_transform_affine
get_function_tuple
get_function_svec
get_function_affine
get_function_poly
split_tuple
```
5 changes: 5 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# DataTofunctions.jl

```@docs
DataToFunctions
```
50 changes: 50 additions & 0 deletions docs/src/tutorial.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Tutorial for the DataToFunctions.jl package

import Pkg
Pkg.add("SyntheticObjects")
Pkg.add("StaticArrays")
Pkg.add("Plots")
Pkg.add("Random")

# Load the packages
using DataToFunctions
using SyntheticObjects
using StaticArrays
using Random
using Plots

# We set the Random.seed for reproducibility
Random.seed!(14)

# Define the data
sz = 128
data = filaments3D((sz, sz, 1), num_filaments=3)[:, :, 1]

# define the interpolation function using this package
f_affine = get_function_affine(data)

# define the transformation parameters
params = [1.0, 2.0, 1.2, 0.8, 0.0, 0.0, 0.0]

# apply the transformation
data_transformed = f_affine(params)
heatmap(data_transformed, aspect_ratio=1
, title="Transformed data using a transformation parameters vector"
, titlefontsize=10, size=(500, 500)
, xlabel="X", ylabel="Y")


## The next example is to use a transformation matrix
matrix_c = [1.0 0.0 2.0;
0.0 1.0 3.0;
0.0 0.0 1.0]

data_transformed_m = f_affine(SMatrix{3, 3}(matrix_c))
heatmap(data_transformed_m, aspect_ratio=1
, title="Transformed data using a transformation matrix"
, titlefontsize=10, size=(500, 500)
, xlabel="X", ylabel="Y")


# Now we try to do the transformation using a polynomial function
# we first define the interpolation object using the DataToFunctions package with a polynomial of order 1
78 changes: 78 additions & 0 deletions docs/src/tutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
```@meta
EditURL = "tutorial.jl"
```

Tutorial for the DataToFunctions.jl package

````@example tutorial
import Pkg
Pkg.add("SyntheticObjects")
Pkg.add("StaticArrays")
Pkg.add("Plots")
Pkg.add("Random")
````

Load the packages

````@example tutorial
using DataToFunctions
using SyntheticObjects
using StaticArrays
using Random
using Plots
````

We set the Random.seed for reproducibility

````@example tutorial
Random.seed!(14)
````

Define the data

````@example tutorial
sz = 128
data = filaments3D((sz, sz, 1), num_filaments=3)[:, :, 1]
````

define the interpolation function using this package

````@example tutorial
f_affine = get_function_affine(data)
````

define the transformation parameters

````@example tutorial
params = [1.0, 2.0, 1.2, 0.8, 0.0, 0.0, 0.0]
````

apply the transformation

````@example tutorial
data_transformed = f_affine(params)
heatmap(data_transformed, aspect_ratio=1
, title="Transformed data using a transformation parameters vector"
, titlefontsize=10, size=(500, 500)
, xlabel="X", ylabel="Y")


# The next example is to use a transformation matrix
matrix_c = [1.0 0.0 2.0;
0.0 1.0 3.0;
0.0 0.0 1.0]

data_transformed_m = f_affine(SMatrix{3, 3}(matrix_c))
heatmap(data_transformed_m, aspect_ratio=1
, title="Transformed data using a transformation matrix"
, titlefontsize=10, size=(500, 500)
, xlabel="X", ylabel="Y")
````

Now we try to do the transformation using a polynomial function
we first define the interpolation object using the DataToFunctions package with a polynomial of order 1

---

*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*

Loading
Loading