/***************************************************************************** Major portions of this software are copyrighted by the Medical College of Wisconsin, 1994-2000, and are released under the Gnu General Public License, Version 2. See the file README.Copyright for details. ******************************************************************************/ #include #include #include #include typedef struct { int npt , nall ; float * x , * y ; int * typ ; } mri_cohar ; #define DEL 0.001 void merge_cohar( mri_cohar * coh ) { int ii , jj; if( coh == NULL || coh->npt < 2 ) return ; /* mark duplicates for destruction */ for( ii=1 ; ii < coh->npt ; ii++ ){ for( jj=0 ; jj < ii ; jj++ ){ if( typ[jj] > 0 && typ[jj] == typ[ii] && fabs(x[jj]-x[ii]) < DEL && fabs(y[jj]-y[ii]) < DEL ){ typ[ii] = -1 ; break ; } } }