Skip to content

population_template: Fix linear drift correction#2802

Merged
Lestropie merged 2 commits intodevfrom
population_template_linear_drift_fix
Mar 4, 2024
Merged

population_template: Fix linear drift correction#2802
Lestropie merged 2 commits intodevfrom
population_template_linear_drift_fix

Conversation

@Lestropie
Copy link
Member

Found this one while porting code for #2678.

Problem appears to have been introduced here in 5ad072f as part of #2471.

It does not affect master, as the drift correction functionality does not yet exist there.

I'm posting as a draft for now, as currently the average transformation is recomputed at every linear registration iteration, whereas it should only need to be done once; but I'll want to test a little more before committing that.

@maxpietsch: Do you have any good exemplar data with a clear drift?

Transforms purportedly averaged across the cohort were erroneously equivalent to the transform of the last input.
@github-actions
Copy link

clang-tidy review says "All clean, LGTM! 👍"

@Lestropie
Copy link
Member Author

@daljit46: There's a MacOSX CI failure on this one related to cmake that's unrelated to the changeset.

@daljit46
Copy link
Member

This looks like a symlinks issue, but unfortunately I still haven't gotten my Macbook yet so I'm unable to test it. Perhaps @bjeurissen could take a look and see what's going on?

- Only compute the reference transform for linear drift correction once, rather than overwriting it every linear iteration.
- If performing linear drift correction, but no initial alignment was performed, then use the mean of the first linear iteration as the drift correction reference.
@github-actions
Copy link

github-actions bot commented Mar 3, 2024

clang-tidy review says "All clean, LGTM! 👍"

@Lestropie Lestropie marked this pull request as ready for review March 3, 2024 23:08
@Lestropie
Copy link
Member Author

I have ensured that population_template at least executes for both combinations of -linear_no_drift_correction (present vs. absent) and -initial_alignment none vs. default (mass). Script tests fail due to divergence with previously generated data, but that is due either to the drift correction itself, or something else upstream. I think that I will defer testing to #2811 once 3.1.0 is closer; for each failed test I can do git bisects to figure out what introduces changes, and regenerate reference data if required.

@Lestropie Lestropie merged commit c319696 into dev Mar 4, 2024
@Lestropie Lestropie deleted the population_template_linear_drift_fix branch March 4, 2024 04:26
@Lestropie Lestropie restored the population_template_linear_drift_fix branch August 26, 2025 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants