Doxygen Source Code Documentation
mri_swapbytes.c File Reference
#include "mrilib.h"Go to the source code of this file.
| Data Structures | |
| struct | eightbytes | 
| struct | fourbytes | 
| struct | twobytes | 
| Defines | |
| #define | SWAB16(x) ( ( ((x)&0x00ffU)<<8 ) | ( ((x)&0xff00U)>>8 ) ) | 
| Functions | |
| void | mri_swapbytes (MRI_IMAGE *im) | 
| void | swap_twobytes (int n, void *ar) | 
| void | swap_fourbytes (int n, void *ar) | 
| void | swap_eightbytes (int n, void *ar) | 
Define Documentation
| 
 | 
| 
 Definition at line 11 of file mri_swapbytes.c. Referenced by mri_swapbytes(). | 
Function Documentation
| 
 | 
| 
 Definition at line 13 of file mri_swapbytes.c. References ENTRY, MRI_IMAGE::im, MRI_IMAGE::kind, MRI_IMAGE::nvox, MRI_DATA::short_data, and SWAB16. Referenced by main(), mri_input_delay(), and mri_read_3D(). 
 00014 {
00015    register int ii , npix ;
00016 
00017 ENTRY("mri_swapbytes") ;
00018 
00019    if( im->kind != MRI_short ){
00020      fprintf( stderr , "mri_swapbytes called with non-short image kind\n" ) ;
00021      EXRETURN ;
00022    }
00023 
00024    npix = im->nvox ;
00025 
00026    for( ii=0 ; ii < npix ; ii++ )
00027      im->im.short_data[ii] = SWAB16( im->im.short_data[ii] ) ;
00028 
00029    EXRETURN ;
00030 }
 | 
| 
 | ||||||||||||
| 
 Definition at line 71 of file mri_swapbytes.c. References eightbytes::a, eightbytes::A, eightbytes::b, eightbytes::B, eightbytes::c, eightbytes::C, eightbytes::d, eightbytes::D, and tt. Referenced by T3D_read_images(), and T3D_swap_CB(). 
 00072 {
00073    register int ii ;
00074    register eightbytes * tb = (eightbytes *) ar ;
00075    register unsigned char tt ;
00076 
00077    for( ii=0 ; ii < n ; ii++ ){
00078       tt = tb[ii].a ; tb[ii].a = tb[ii].A ; tb[ii].A = tt ;
00079       tt = tb[ii].b ; tb[ii].b = tb[ii].B ; tb[ii].B = tt ;
00080       tt = tb[ii].c ; tb[ii].c = tb[ii].C ; tb[ii].C = tt ;
00081       tt = tb[ii].d ; tb[ii].d = tb[ii].D ; tb[ii].D = tt ;
00082    }
00083 }
 | 
| 
 | ||||||||||||
| 
 Definition at line 53 of file mri_swapbytes.c. References fourbytes::a, fourbytes::b, fourbytes::c, fourbytes::d, and tt. 
 00054 {
00055    register int ii ;
00056    register fourbytes * tb = (fourbytes *) ar ;
00057    register unsigned char tt ;
00058 
00059    for( ii=0 ; ii < n ; ii++ ){
00060       tt       = tb[ii].a ;
00061       tb[ii].a = tb[ii].d ;
00062       tb[ii].d = tt ;
00063       tt       = tb[ii].b ;
00064       tb[ii].b = tb[ii].c ;
00065       tb[ii].c = tt ;
00066    }
00067 }
 | 
| 
 | ||||||||||||
| 
 Definition at line 38 of file mri_swapbytes.c. References twobytes::a, twobytes::b, and tt. 
 | 
 
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
 
 
 
 
       
	   
	   
	   
	  