Skip to content

Conversation

@fabian-s
Copy link
Contributor

@fabian-s fabian-s commented Sep 1, 2025

remaining todos:

  • add landmark registration example / implementation
  • implement affine registration (challenge: shorten/lengthen/shift domains, figure out best optimizer)
  • include summary of results of sim. experiments in vignette
  • fix figure formats/sizes in vignette
  • reduce new "Suggests:"

m-muecke and others added 30 commits June 10, 2025 20:45
* comments

* FS comments
m-muecke and others added 27 commits August 4, 2025 17:50
next: restructure vignette, add growth preprocessing case study...
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Merge branch 'dev' into registration

# Conflicts:
#	.gitignore
@fabian-s
Copy link
Contributor Author

fabian-s commented Sep 1, 2025

[WIP]

@fabian-s fabian-s requested a review from Copilot September 1, 2025 17:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive functional data registration capabilities to the tf package by implementing elastic deformation and alignment functions. The registration functionality enables temporal alignment of functional data by separating phase (timing) variation from amplitude (shape) variation.

  • Implements core registration functionality using SRVF and FDA methods
  • Adds comprehensive documentation with real-world examples using growth and pinch datasets
  • Provides integration capabilities with the mlr3 framework

Reviewed Changes

Copilot reviewed 26 out of 29 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vignettes/registration.Rmd Comprehensive tutorial on curve registration with real-world examples
vignettes/mlr3-integration.Rmd Integration example with mlr3 framework for FDA
tests/testthat/test-vec-cast.R Removes debug print statements from test helper function
tests/testthat/test-register.R Comprehensive test suite for registration functionality
tests/testthat/test-assertions.R Tests for warping function validation
man/*.Rd Documentation files for registration functions and datasets
data-raw/*.R Data processing scripts for example datasets
attic/*.R Development and troubleshooting scripts
_pkgdown.yml Updates package documentation structure
R/register.R Core registration implementation with warping/unwarping functions
R/data.R Documentation for example datasets
R/calculus.R Function inversion implementation
Multiple other R files Supporting utilities and improvements

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


The registration process involves:

1. Estimating "warping functions" using `tf_register()` - these capture the time scale deformations of the observed functions relative to a (tpyically iteratively estimated) common template.
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a spelling error: 'tpyically' should be 'typically'.

Suggested change
1. Estimating "warping functions" using `tf_register()` - these capture the time scale deformations of the observed functions relative to a (tpyically iteratively estimated) common template.
1. Estimating "warping functions" using `tf_register()` - these capture the time scale deformations of the observed functions relative to a (typically iteratively estimated) common template.

Copilot uses AI. Check for mistakes.

Some general caveats:

- alignments can be fairly sensitive to the specifics of data representation (i.e., what kind of basis representation is being used, how many gridpoints the functions are being evaluated on, how to interpolate between grid points, whether/how much the data was smoothed before registration). Even for a simple looking example like the "Berkeley Growth" data shown below, you can get very different alignment results from the same method, depending on the specific pre-processing - see section !!TODO!!.
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placeholder '!!TODO!!' should be replaced with an actual section reference or removed if the section doesn't exist yet.

Suggested change
- alignments can be fairly sensitive to the specifics of data representation (i.e., what kind of basis representation is being used, how many gridpoints the functions are being evaluated on, how to interpolate between grid points, whether/how much the data was smoothed before registration). Even for a simple looking example like the "Berkeley Growth" data shown below, you can get very different alignment results from the same method, depending on the specific pre-processing - see section !!TODO!!.
- alignments can be fairly sensitive to the specifics of data representation (i.e., what kind of basis representation is being used, how many gridpoints the functions are being evaluated on, how to interpolate between grid points, whether/how much the data was smoothed before registration). Even for a simple looking example like the "Berkeley Growth" data shown below, you can get very different alignment results from the same method, depending on the specific pre-processing.

Copilot uses AI. Check for mistakes.

Development of this subject is aligned to the population mean pattern in the first 2-3 years
(unwarping function follows bisecting angle), and delayed over most of the rest of the observed period (unwarping function below bisecting angle, all arrows pointing left).
The graph of the original growth trajectory itself is compressed by the alignment early on (slope of unwarping function < 1 for age 2-7, arrows to the left lenghtening), then dilated (steep unwarping function slope for age 7-10, arrows to the left shortening).
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a spelling error: 'lenghtening' should be 'lengthening'.

Suggested change
The graph of the original growth trajectory itself is compressed by the alignment early on (slope of unwarping function < 1 for age 2-7, arrows to the left lenghtening), then dilated (steep unwarping function slope for age 7-10, arrows to the left shortening).
The graph of the original growth trajectory itself is compressed by the alignment early on (slope of unwarping function < 1 for age 2-7, arrows to the left lengthening), then dilated (steep unwarping function slope for age 7-10, arrows to the left shortening).

Copilot uses AI. Check for mistakes.
Comment on lines +213 to +214
if (is.character(x)) {
x <- sub("$^", "NA", x)
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regular expression '$^' will never match any string because it looks for end-of-string followed by start-of-string, which is impossible. This should likely be '^$' to match empty strings.

Suggested change
if (is.character(x)) {
x <- sub("$^", "NA", x)
x <- sub("^$", "NA", x)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants