changeset 771:61cf793fe122

*** empty log message ***
author david <david>
date Tue, 21 Feb 1995 13:20:13 +0000
parents 5bf93c6b3d1d
children 32437b7bfce4
files volume_io/Testing/create_grid_volume.c
diffstat 1 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/volume_io/Testing/create_grid_volume.c
+++ b/volume_io/Testing/create_grid_volume.c
@@ -13,8 +13,9 @@
     int                  ind[MAX_DIMENSIONS], sizes[MAX_DIMENSIONS];
     static  char         *dim_names[] = { MIxspace, MIyspace, MIzspace,
                                           MIvector_dimension };
-    Real                 value;
+    Real                 value, x, y, z, xt, yt, zt;
     Volume               volume;
+    General_transform    transform;
 
     if( argc < 2 )
     {
@@ -45,7 +46,7 @@
                 for_less( ind[Z+1], 0, sizes[Z+1] )
                 {
                     value = (Real) ind[ind[Z+1]] / (Real) sizes[ind[Z+1]];
-                    value = 4.0 * value - 2.0;
+                    value = 10.0 * value - 5.0;
                     value = CONVERT_VALUE_TO_VOXEL( volume, value );
                     SET_VOXEL( volume, ind[X], ind[Y], ind[Z], ind[Z+1], 0,
                                value );
@@ -54,6 +55,25 @@
         }
     }
 
+    create_grid_transform( &transform, volume );
+
+    print( "Enter x, y, z: " );
+    while( input_real( stdin, &x ) == OK &&
+           input_real( stdin, &y ) == OK &&
+           input_real( stdin, &z ) == OK )
+    {
+        general_transform_point( &transform, x, y, z, &xt, &yt, &zt );
+
+        print( "Forward: %g %g %g -> %g %g %g\n", x, y, z, xt, yt, zt );
+        x = xt;
+        y = yt;
+        z = zt;
+
+        general_inverse_transform_point( &transform, x, y, z, &xt, &yt, &zt );
+        print( "Inverse:          -> %g %g %g\n", xt, yt, zt );
+        print( "Enter x, y, z: " );
+    }
+
     status = output_volume( output_filename, NC_UNSPECIFIED, FALSE, 0.0, 0.0,
                             volume, "", NULL );