LLNL / LEAP

comprehensive library of 3D transmission Computed Tomography (CT) algorithms with Python and C++ APIs, a PyQt GUI, and fully integrated with PyTorch
https://leapct.readthedocs.io
MIT License
104 stars 10 forks source link

Geometry of the cone-beam projection #17

Closed junbopeng closed 8 months ago

junbopeng commented 8 months ago

Hi I tried the cone-beam projection in LEAP, the detector had 200 rows and the centerRow is 100.5 (see below):

proj = Projector(use_gpu=True, gpu_device=device) proj.leapct.set_volume(256, 256, 100, 1, 1, 0, 0, 0) proj.leapct.set_conebeam(360, 200, 256, 1, 1.5, 100.5, 128.5, proj.leapct.setAngleArray(360, 360.0), 1000, 1500, tau=0.0, helicalPitch=0.0) ... sino = proj.leapct.project(sino,img) plt.imshow(sino[100,:,:].cpu().numpy(), cmap='gray')

However, the displayed projection in the 101 view looks like: image

Seems that the parameter of centerRow doesn't work properly?

kylechampley commented 8 months ago

Actually, there ain't nothing wrong with the centerRow parameter. It works just fine.

The problem here is how the z-slice positions were set.

There is a new release (v1.1) that I just published that uses a new definition of the z-slice positions that is much more intuitive. I actually realized the way I was specifying z-slice locations was very strange about a week ago and made a change to the code.

Anyway, please pull the latest code (or download the latest release) and run your code again. Everything should be centered as expected. Sorry for the hassle.

junbopeng commented 8 months ago

Actually, there ain't nothing wrong with the centerRow parameter. It works just fine.

The problem here is how the z-slice positions were set.

There is a new release (v1.1) that I just published that uses a new definition of the z-slice positions that is much more intuitive. I actually realized the way I was specifying z-slice locations was very strange about a week ago and made a change to the code.

Anyway, please pull the latest code (or download the latest release) and run your code again. Everything should be centered as expected. Sorry for the hassle.

Thanks for your work! The v1.1 works now!