/***/
/* shuf3D.M: data shuffling macro for a non-default 3D acquisition order.
/*
/*   X-Axis = t3; Y-Axis = t1; Z-Axis = t2.
/*
/* | Input Order:                | Output Order:                |
/* |                             |                              |
/* | For t2Time = 1 to X         | For t2Time = 1 to X          |
/* |  For t1Time = 1 to Y        |  For t2Phase = real, imag    |
/* |   For t2Phase = real, imag  |   For t1Time = 1 to Y        |
/* |    For t1Phase = real, imag |    For t1Phase = real, imag  |
/* |     Acquire t3 complex FID  |     Acquire t3 complex FID   |
/*
/***/

/* Process only every pair of input planes, one real, one imaginary:  */

if (yLoc != 1)
   {
    exit( 0 );
   };

if (zLoc % 2)
   {
    exit( 0 );
   };

float planeRI[4*size*specnum], sliceRI[4*size];

/***/
/* Read a pair of planes.
/* Extract and write odd pairs of complex vectors for Z=real output plane.
/* Extract and write even pairs of complex vectors for Z=imag output plane.
/***/

(void) dReadB( inUnit, planeRI, wordLen*size*specnum*4 );

offset = 0;

for( iy = 0; iy < specnum/2; iy++ )
   {
    (void) vvCopyOff( sliceRI, planeRI, 4*size, 0, offset ); 
    (void) dWrite( outUnit, sliceRI, wordLen*4*size );

    offset += 8*size;
   }

offset = 4*size;

for( iy = 0; iy < specnum/2; iy++ )
   {
    (void) vvCopyOff( sliceRI, planeRI, 4*size, 0, offset ); 
    (void) dWrite( outUnit, sliceRI, wordLen*4*size );

    offset += 8*size;
   }
