Closed epapoutsellis closed 5 years ago
I think there may be around this. Look at the ASTRA release news for 1.8 and 1.7,
http://astra-toolbox.com/news.html
they mention reduced restrictions on volume geometries so that voxels no longer need to be size 1 or cubes. I think maybe the ASTRA documentation erroneously still states that voxels need to be size 1, but I think our implementation exploits the new feature. I may be wrong of course. What is the issue with the current implementation?
On Mon, 7 Oct 2019, 14:25 Vaggelis Papoutsellis, notifications@github.com wrote:
Assigned #38 https://github.com/vais-ral/CCPi-astra/issues/38 to @jakobsj https://github.com/jakobsj.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/vais-ral/CCPi-astra/issues/38?email_source=notifications&email_token=ACMDSCEGS2IHMU3UQZ5DZ4LQNM2F3A5CNFSM4I6EQCHKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOUBY5NPQ#event-2691815102, or mute the thread https://github.com/notifications/unsubscribe-auth/ACMDSCF6EKF6KQCQI2F4FZ3QNM2F3ANCNFSM4I6EQCHA .
@jakobsj , @epapoutsellis in our implementation (CCPi-astra/Wrappers/Python/ccpi/astra/utils/convert_geometry_to_astra.py )
we do not use voxel size
vol_geom = astra.create_vol_geom(volume_geometry.voxel_num_x, volume_geometry.voxel_num_y, volume_geometry.voxel_num_z, volume_geometry.get_min_x(), volume_geometry.get_max_x(), volume_geometry.get_min_y(), volume_geometry.get_max_y(), volume_geometry.get_min_z(), volume_geometry.get_max_z())
I also checked ASTRA source files (1.8.3 and 1.9). In both releases user cannot specify voxel size.
def create_vol_geom(*varargin):
"""Create a volume geometry structure.
This method can be called in a number of ways:
create_vol_geom(N)
:
:returns: A 2D volume geometry of size :math:N \\times N
.
create_vol_geom((Y, X))
:
:returns: A 2D volume geometry of size :math:Y \\times X
.
create_vol_geom(Y, X)
:
:returns: A 2D volume geometry of size :math:Y \\times X
.
create_vol_geom(Y, X, minx, maxx, miny, maxy)
:
:returns: A 2D volume geometry of size :math:Y \\times X
, windowed as :math:minx \\leq x \\leq maxx
and :math:miny \\leq y \\leq maxy
.
create_vol_geom((Y, X, Z))
:
:returns: A 3D volume geometry of size :math:Y \\times X \\times Z
.
create_vol_geom(Y, X, Z)
:
:returns: A 3D volume geometry of size :math:Y \\times X \\times Z
.
create_vol_geom(Y, X, Z, minx, maxx, miny, maxy, minz, maxz)
:
:returns: A 3D volume geometry of size :math:Y \\times X \\times Z
, windowed as :math:minx \\leq x \\leq maxx
and :math:miny \\leq y \\leq maxy
and :math:minz \\leq z \\leq maxz
.
"""
Hmm maybe I still don't understand but see also
for an example of voxels of a different size are specified. It seems to me that one does not specify Voxel size directly, but indirectly by passing the number of voxels and the left and right end points. Say, if you keep end points but double the number, you effectively half the voxel size.
On Mon, 7 Oct 2019, 15:28 evelinaametova, notifications@github.com wrote:
@jakobsj https://github.com/jakobsj , @epapoutsellis https://github.com/epapoutsellis in our implementation (CCPi-astra/Wrappers/Python/ccpi/astra/utils/convert_geometry_to_astra.py )
we do not use voxel size
vol_geom = astra.create_vol_geom(volume_geometry.voxel_num_x, volume_geometry.voxel_num_y, volume_geometry.voxel_num_z, volume_geometry.get_min_x(), volume_geometry.get_max_x(), volume_geometry.get_min_y(), volume_geometry.get_max_y(), volume_geometry.get_min_z(), volume_geometry.get_max_z())
I also checked ASTRA source files (1.8.3 and 1.9). In both releases user cannot specify voxel size.
def create_vol_geom(*varargin): """Create a volume geometry structure. This method can be called in a number of ways: create_vol_geom(N): :returns: A 2D volume geometry of size :math:N \times N. create_vol_geom((Y, X)): :returns: A 2D volume geometry of size :math:Y \times X. create_vol_geom(Y, X): :returns: A 2D volume geometry of size :math:Y \times X. create_vol_geom(Y, X, minx, maxx, miny, maxy): :returns: A 2D volume geometry of size :math:Y \times X, windowed as :math:minx \leq x \leq maxx and :math:miny \leq y \leq maxy. create_vol_geom((Y, X, Z)): :returns: A 3D volume geometry of size :math:Y \times X \times Z. create_vol_geom(Y, X, Z): :returns: A 3D volume geometry of size :math:Y \times X \times Z. create_vol_geom(Y, X, Z, minx, maxx, miny, maxy, minz, maxz): :returns: A 3D volume geometry of size :math:Y \times X \times Z, windowed as :math:minx \leq x \leq maxx and :math:miny \leq y \leq maxy and :math:minz \leq z \leq maxz . """
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vais-ral/CCPi-astra/issues/38?email_source=notifications&email_token=ACMDSCAMLZNGLL74G6J7253QNNBSNA5CNFSM4I6EQCHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAQRMLY#issuecomment-539039279, or mute the thread https://github.com/notifications/unsubscribe-auth/ACMDSCG3PI2K5WP52MNFIDTQNNBSNANCNFSM4I6EQCHA .
I see, this is indeed very confusing. In documentstion they say that minx, maxx, miny, maxy, minz, maxz give extent of the volume, i.e. you are right, you can inderectly specify voxel size. the question is in which units is minx, maxx, miny, maxy, minz, maxz. I guess, it is in 'voxel units'? In this example
vol_geom1 = astra.create_vol_geom(32, 16, 32, -64, 0, -64, 64, -64, 64) from https://github.com/astra-toolbox/astra-toolbox/blob/master/samples/python/s019_experimental_multires.py voxel size is multiple of 4 'voxel units'? does this make sense?
I think in this case it is only 4 voxel units because the second vol_geom has voxel size 1. I think the conclusion I came to previously was that we can actually pretend the minx, maxx etc are "physical" distances for which we can choose the units. If, say, we use mm as "base unit", and if we have 10 um = 0.010 mm voxel size and 1000 voxels in the x direction, that makes the total volume width equal to 1000*0.010mm=10mm, and I guess we would specify minx=-5.0, maxx=5.0. I think this is what is implemented?
We certainly do not want to ask the user to convert distances to voxel units. Our software should handle that for them.
On Mon, 7 Oct 2019 at 15:45, evelinaametova notifications@github.com wrote:
I see, this is indeed very confusing. In documentstion they say that minx, maxx, miny, maxy, minz, maxz give extent of the volume, i.e. you are right, you can inderectly specify voxel size. the question is in which units is minx, maxx, miny, maxy, minz, maxz. I guess, it is in 'voxel units'? In this example low res part (voxels of 4x4x4)
vol_geom1 = astra.create_vol_geom(32, 16, 32, -64, 0, -64, 64, -64, 64) from https://github.com/astra-toolbox/astra-toolbox/blob/master/samples/python/s019_experimental_multires.py voxel size is multiple of 4 'voxel units'? does this make sense?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vais-ral/CCPi-astra/issues/38?email_source=notifications&email_token=ACMDSCBFSCQQTRJVR33PIBLQNNDRNA5CNFSM4I6EQCHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAQTL5I#issuecomment-539047413, or mute the thread https://github.com/notifications/unsubscribe-auth/ACMDSCHSAY6CH75KPHEMJD3QNNDRNANCNFSM4I6EQCHA .
From what I can see here voxel size is determined by setting min, max
I think that is in agreement with what I am saying?
On Mon, 7 Oct 2019 at 21:27, Vaggelis Papoutsellis notifications@github.com wrote:
From what I can see 'here https://www.youtube.com/watch?v=zmkZuiLL54o voxel size is determined by setting min, max
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vais-ral/CCPi-astra/issues/38?email_source=notifications&email_token=ACMDSCEEKOVHI7NBUJBDHGTQNOLSTA5CNFSM4I6EQCHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEARWDRQ#issuecomment-539189702, or mute the thread https://github.com/notifications/unsubscribe-auth/ACMDSCHAELOYUVNFWQ4JOHTQNOLSTANCNFSM4I6EQCHA .
Sorry guys, it looks like I was confused by previous ASTRA releases and misinterpreted meaning of min, max attributes.
Closed by #33
In order to setup correct (astra) geometries we need to convert our physical info to no unit parameters that astra likes.
So, we have to do sth like https://github.com/vais-ral/CCPi-astra/blob/ADD_FBP/Wrappers/Python/ccpi/astra/test_AstraFBP3D_FDK.py#L169
And there are two options,