Skip to content

PERF: Upgrade elastix to 2026-05-15 (faster AfterThreadedComputePDFs)#388

Open
N-Dekker wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
N-Dekker:PERF-elastix-faster-AfterThreadedComputePDFs
Open

PERF: Upgrade elastix to 2026-05-15 (faster AfterThreadedComputePDFs)#388
N-Dekker wants to merge 1 commit into
InsightSoftwareConsortium:mainfrom
N-Dekker:PERF-elastix-faster-AfterThreadedComputePDFs

Conversation

@N-Dekker
Copy link
Copy Markdown
Collaborator

@N-Dekker N-Dekker commented May 12, 2026

@N-Dekker
Copy link
Copy Markdown
Collaborator Author

Just re-ran the original benchmark from Nicolas Chiaruttini (@NicoKiaru) at https://discourse.itk.org/t/8x-slower-registration-with-itk-elastix-python-api-vs-elastix-cli-minimal-reproducible-example/7736/1 (including the use of the unsupported "NumberOfThreads" parameter). At "my" LKEB/LUMC pc (AMD Threadripper, 32-Cores, 4 GHz, 64 logical processors), Windows 11, using Python 3.13.

Command-line arguments: --fixed blobs.tif --moving blobs-rot15deg.tif --runs 3 --elastix D:\X\Bin\E\elastix-5.3.1-windows\elastix.exe

Output with the latest itk-elastix release (0.25.3):


--- Run 1/3 (warm-up) ---
  [CLI]     2.01s  transform exists: True
  [itk-API] 36.50s  transform exists: True

--- Run 2/3 ---
  [CLI]     1.59s  transform exists: True
  [itk-API] 36.96s  transform exists: True

--- Run 3/3 ---
  [CLI]     2.06s  transform exists: True
  [itk-API] 35.73s  transform exists: True

Run            CLI (s)     itk-API (s)  ratio (itk/cli)
-------------------------------------------------------
*1               2.011          36.501          18.15x
 2               1.592          36.959          23.21x
 3               2.064          35.729          17.31x

Steady-state avg CLI     (runs 2+): 1.828s
Steady-state avg itk-API (runs 2+): 36.344s
Steady-state ratio (itk/cli): 19.88x

Output with the WindowsWheel311 from this pull request:

--- Run 1/3 (warm-up) ---
  [CLI]     3.43s  transform exists: True
  [itk-API] 6.93s  transform exists: True

--- Run 2/3 ---
  [CLI]     2.03s  transform exists: True
  [itk-API] 6.92s  transform exists: True

--- Run 3/3 ---
  [CLI]     2.12s  transform exists: True
  [itk-API] 6.97s  transform exists: True

Run            CLI (s)     itk-API (s)  ratio (itk/cli)
-------------------------------------------------------
*1               3.430           6.925           2.02x
 2               2.032           6.921           3.41x
 3               2.118           6.970           3.29x

Steady-state avg CLI     (runs 2+): 2.075s
Steady-state avg itk-API (runs 2+): 6.946s
Steady-state ratio (itk/cli): 3.35x

Conclusion: this pull request yields a major performance improvement. However, with this particular benchmark, the CLI (elastix.exe) still remains faster than itk-elastix. To be continued...!

P.S. With this pull request, the "elastix.log" created by itk-elastix has a warning, saying:

WARNING: 5 unused parameter(s) found!
  Unused parameter: AutomaticScalesEstimation
  Unused parameter: AutomaticTransformInitialization
  Unused parameter: AutomaticTransformInitializationMethod
  Unused parameter: ErodeMask
  Unused parameter: NumberOfThreads

So with this pull request it should be easier for users to find out that "NumberOfThreads" is not supported.

@N-Dekker N-Dekker force-pushed the PERF-elastix-faster-AfterThreadedComputePDFs branch from 3688b56 to 02d6046 Compare May 15, 2026 12:39
Included elastix pull requests:

SuperElastix/elastix#1444
"Improve performance of Advanced, ParzenWindowHistogram,
ParzenWindowMutualInformation ImageToImageMetric"

SuperElastix/elastix#1440
"PERF: Use ImageBufferRange in AfterThreadedComputePDFs"

SuperElastix/elastix#1431
"ENH: Print a warning for each unused parameter of the ParameterMap"

All included new commits:

SuperElastix/elastix@5.3.1...77c726a
@N-Dekker N-Dekker force-pushed the PERF-elastix-faster-AfterThreadedComputePDFs branch from 02d6046 to 87c016c Compare May 15, 2026 12:40
@N-Dekker N-Dekker changed the title WIP: PERF: Upgrade elastix to 2026-05-05 (faster AfterThreadedComputePDFs) PERF: Upgrade elastix to 2026-05-15 (faster AfterThreadedComputePDFs) May 15, 2026
@N-Dekker N-Dekker marked this pull request as ready for review May 15, 2026 14:13
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