CERN / TIGRE

TIGRE: Tomographic Iterative GPU-based Reconstruction Toolbox
BSD 3-Clause "New" or "Revised" License
550 stars 182 forks source link

Convert ASTRA geometry to TIGRE geometry? #383

Open sjmgarnier opened 2 years ago

sjmgarnier commented 2 years ago

Hello! This is more a question than an issue. Is there a way to convert ASTRA geometries into TIGRE geometries easily? Thanks in advance for your help.

AnderBiguri commented 2 years ago

Hi! there isn't a function to do so (if you find one, please do commit it to TIGRE!), but unless you have a particularly weird geometry, it should be easy to create it or just fill the geometries by hand using ASTRA values. Give it a shot, I also have a little experience with ASTRA so I may be able to help if you get stuck.

sjmgarnier commented 2 years ago

@AnderBiguri Thanks for your very quick reply! We do have a bit of a weird geometry, that's why I'm looking for something that'll do the work for me :-) Long story short, we're using a "homemade" CT scanner in semi-fieldwork conditions in the tropical forest (you can read about an earlier work of ours here if that is of interest to you: https://arxiv.org/abs/2110.09017). We can't guarantee that the axis of rotation is always perfectly aligned with the source-detector axis, so we rely on posthoc calibration with fiducial markers for estimating the position of the source-detector couple relative to the axis of rotation. As a result, we have a different configuration for each angle.

AnderBiguri commented 2 years ago

@sjmgarnier Oh, that is quite interesting!

Depends on how you obtain this parameters, adding them directly to TIGRE may be fairly easy. Most parameters (except detector/image sizes) can be given per-projection as an array in TIGRE, so given a variable DSD / DSO you can just input it as an array. Similarly, uCT machines tend to have a Axis/center of rotation (COR) error, so as you say, they are posthoc estimated and corrected for that. You can do that with the (somehow redundant but convenient) geometry parameter geo.cor. It basically translates to a horizontal shift on the axis of rotation from the source-detector line. This parameter can also be an array, per projection.

I think adding these in ASTRA can be a bit more complicated, so maybe your best go is to directly put them into TIGRE from whichever code you have that estimates them, as TIGRE geometry is slightly more user intuitive (for a standard scan, at least).

sjmgarnier commented 2 years ago

@AnderBiguri Thanks, I'll look into that direction. We're using the standard estimateWorldCameraPose from Matlab for the calibration.

AnderBiguri commented 2 years ago

@sjmgarnier let me know how it goes. I am trying to get a vector2tigre (i.e. 3 vectors with location and orientation for detector+image+source) version working, but I am struggling with it lately, so if you need something like that I may either have it coded soon, or could use help!

sjmgarnier commented 2 years ago

@AnderBiguri I can try to use my very modest coding abilities to help, yes. Hopefully, I don't end up messing things up :-)

AnderBiguri commented 7 months ago

This is already done for Python in #515, available in master. MATLAB is missing.