Closed lokeaichirou closed 4 years ago
I see what you are trying to do.
The python interface is not very nice, but I guess what you want to achieve I would do with TomoP3D.ObjectSino
Notice that the paramenter objlist
is a list
with dictionaries describing each object in the phantom along these lines:
obj1 = {}
obj1['C0'] = c0
obj1['x0'] = x0
...
obj2 = {} ...
objlist = [obj1, obj2,]
I also see that the angles phi2 and phi3 will not be used, probably a bug.
I see what you are trying to do.
The python interface is not very nice, but I guess what you want to achieve I would do with
TomoP3D.ObjectSino
Notice that the paramenter
objlist
is alist
with dictionaries describing each object in the phantom along these lines:obj1 = {} obj1['C0'] = c0 obj1['x0'] = x0 ... obj2 = {} ... objlist = [obj1, obj2,]
I also see that the angles phi2 and phi3 will not be used, probably a bug.
Thanks for suggestion. I will do it. Since ph12 and phi3 will not be used (be zero in practice), it means the 3D projection images will still remain like the rectangular shapes without any tilting even I set phi2 and phi3 that makes phantom has a certain tilting angle? right?
Apparently yes. But it should be an easy fix.
I made a PR #88 which should fix the bug.
@lokeaichirou I just merged #88 which should fix the bug. It's being built now. In a few hours you should be able to find the updated version.
Please install as conda install -c ccpi/label/dev tomophantom
to get it.
Hi @lokeaichirou , I removed two of Euler angles on purpose. The reason is that the 3D analytical projection data generator is not finished so providing these angles to the function will not give you the right answer. It is a limitation at the moment but I might find some time to complete it.
The 3D phantom, however can be generated by providing all 3 Euler angles. The objects can be controlled fully. So to avoid errors with someone using all 3 angles for the phantom and for the data I have removed them. So it is a hack rather than a bug, sorry. If you really need a full 3D control (tilting, rolling, panning), then it is possible to pass all angles while generating a phantom and then use a numerical forward projector (e.g. Astra toolbox) to generate data. thanks
Hi @lokeaichirou , I removed two of Euler angles on purpose. The reason is that the 3D analytical projection data generator is not finished so providing these angles to the function will not give you the right answer. It is a limitation at the moment but I might find some time to complete it.
The 3D phantom, however can be generated by providing all 3 Euler angles. The objects can be controlled fully. So to avoid errors with someone using all 3 angles for the phantom and for the data I have removed them. So it is a hack rather than a bug, sorry. If you really need a full 3D control (tilting, rolling, panning), then it is possible to pass all angles while generating a phantom and then use a numerical forward projector (e.g. Astra toolbox) to generate data. thanks Hi @dkazanc . Many thanks to your answer, it;s helpful. May I ask is it possible to use the tomophantom to generate random 3D phantoms first and then use astra to make their projections?because my project requires me to generate random 3D phantoms, and tomophantom is a tool can do that.
Hi @lokeaichirou, sure you can do it with this piece of code This is to generate a 'foam' type phantoms i.e. with spheres, ellipses and Gaussians. One probably can make a similar random generation with cubes but it is not implemented.
You probably can modify it in a way that you generate objects using all 3 angles and then use Astra to generate projections.
Code that randomly generates 3D phantoms including elliptical cylinders only
Code that make projections of 3D randomly generated phantoms