Closed OHMYGODjack closed 3 months ago
hum, no idea. Is this the same for the Siddon one? That one should be faster too, I would recommend.
I can't see anything blatantly wrong. What I would suggest is to print the values of the variables (except image) before the call, and to compare that to the MATLAB/Python version, to try to see if anything is off, as the MATLAB/Python way of calling this should work.
For orientation, there is a compilation flag for IS_FOR_MATLAB_TIGRE
that will control the direction. Ultimately we use the same source for MATLAB and Python and one has Fortran memory ordering and the other one C, so with this flag the order of operations are changed and the result may come in a different shape.
When I call the siddon_ray_projection function to calculate projections, the first projection is correct, but the others are abnormal. During debugging, I compared the parameters in MATLAB and found that the geo parameters are the same. I'm unable to figure out where I made a mistake, which is frustrating.Notably, although the other angle projections are incorrect, they seem to exhibit structural textures.
the first angle projection:
the 41th angle projection:
the last angle projection:
Hum. It's quite hard to help without me setting up the project in the same way and start investigating the variables. It's almost certain that there is a big in your code, mostly because this works in python and MATLAB and I have myself called it directly from C++ before in some private projects, so I am certain it works.
Few things to try to figure out:
Are all the data types exactly the expected ones?
Are all the numerical values of the geoemtry exactly the ones that get passed into the function if you call it from standard Tigre?
Is it the first projection that always works, or the projection corresponding to that angle? Ie of you call it in a loop, do you get the right result?
These may help figure out what the issue is. Otherwise you may need to dig into the function and see what is being passed to individual calls. My guess is that some number is not what you think it is or that the memory is not being out in the right place (eg not allocated properly) . I say this because the code internslly computes several projections with the same GPU call, so it's strange that only 1 "computes". All of them must be properly being computed, but the geo data is wrong or the data is saved somewhere badly.
@OHMYGODjack did you find a solution?
I've found the issue.just as you said, I had set the geometric parameters incorrectly, with only the first angle's geometric parameter being set correctly. Thank you very much for your help.
I am trying to call the 'interpolation_projection' function in the 'ray_interpolated_projection.cu' file to implement forward projection, but the projection results I get are abnormal. I set 100 angles, but in the resulting projections, only the first angle has values, while the projection values for all other angles are entirely 0. Additionally, I am using the 'head_phantom' data, but it appears that the orientation of the object being projected is different from that in the TIGRE examples. I would like to know what caused the abnormal projection results. Could you help me figure out if I made any mistakes? Could you provide an example of how to correctly call the 'interpolation_projection' function? Thank you.
the first angle projection:
the 34th angle projection:
the last angle projection:
the head_phantom data:
Code to reproduce the problem (If applicable)
Specifications