Skip to content

Fix Varian loader direction and XIM parsing - #762

Merged
AnderBiguri merged 3 commits into
CERN:masterfrom
DebadityaHait:fix/varian-rotation-direction
Aug 4, 2026
Merged

AnderBiguri merged 3 commits into
CERN:masterfrom
DebadityaHait:fix/varian-rotation-direction

Conversation

@DebadityaHait

@DebadityaHait DebadityaHait commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Correct bowtie calibration-file selection for clockwise Varian TrueBeam 2.7 scans.
  • Decode uncompressed XIM pixel buffers into shaped signed-integer arrays.

Real-data validation

Using TIGRE’s documented Varian CBCT resolution-phantom dataset:
https://zenodo.org/records/8045749

  • Base: StartAngle=180.0, StopAngle=-20.0 selects CC and loads 10 FilterBowtie_CC_* files.
  • This PR: the same scan selects CW and loads 10 FilterBowtie_CW_* files.
  • The sample calibration XIM files use compression=1.

@AnderBiguri

Copy link
Copy Markdown
Member

have you tested this with Varian data? can you show me? or is this an AI random PR?

@DebadityaHait

Copy link
Copy Markdown
Contributor Author

Yes—I used AI assistance to prepare this PR, but it is a targeted parity fix rather than a speculative change.

I tested it with TIGRE’s documented Varian CBCT resolution-phantom dataset: https://zenodo.org/records/8045749

Its TrueBeam 2.7 Scan.xml has StartAngle=180.0 and StopAngle=-20.0. On that dataset, the parent version classifies the scan as CC; this PR classifies it as CW and load_blank_projections() successfully loads all 10 FilterBowtie_CW_* calibration images.

I also added regression coverage for both angle signs and for the FilterBowtie_CW*.xim selection path.

@AnderBiguri

Copy link
Copy Markdown
Member

Thanks! can you put both of your PRs here, remove the test files, and show me the before/after of the test, if anything changes?

@DebadityaHait DebadityaHait changed the title Fix Varian rotation direction Fix Varian loader direction and XIM parsing Aug 4, 2026
@DebadityaHait

Copy link
Copy Markdown
Contributor Author

Consolidated #764 into this PR and removed the PR-specific test files as requested.

Real-data before/after using TIGRE’s documented Varian CBCT resolution-phantom dataset:

Version Direction Loaded blank calibrations
Base CC 10 FilterBowtie_CC_* files
This PR CW 10 FilterBowtie_CW_* files

The sample calibration XIM files use compression=1, so the uncompressed-XIM branch does not change output for this dataset.

@AnderBiguri

Copy link
Copy Markdown
Member

can you show the reconstruction differences before/after? To validate the code does indeed change the recon.

@DebadityaHait

Copy link
Copy Markdown
Contributor Author

I ran matched FDK reconstructions on TIGRE’s documented Varian CBCT resolution-phantom dataset.

Both runs used 32 evenly spaced real projections, a fixed 128³ reconstruction geometry, and disabled detector/scatter corrections.

Version Blank calibrations Reconstruction
Base 10 FilterBowtie_CC_* files Base volume
This PR 10 FilterBowtie_CW_* files Corrected volume

The reconstructed volumes differ:

  • Mean absolute difference: 0.0004847554
  • Maximum absolute difference: 0.0045613390
  • Relative L2 difference: 4.586146%

The embedded central-slice comparison shows the base volume, corrected volume, and their absolute difference.

Varian FDK reconstruction comparison

@AnderBiguri
AnderBiguri merged commit 856ccae into CERN:master Aug 4, 2026
cslht11 pushed a commit to cslht11/TIGRE that referenced this pull request Sep 6, 2026
…rection

Fix Varian loader direction and XIM parsing
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.

2 participants