function [MAP] = validateslipsurfacepixel4( MAP, index )

[row, col ] = ind2sub( size(MAP), index );


if (row>2  && col>2 && row<(size(MAP,1)) && col<(size(MAP,2)) ) 
   
    block = MAP( row-2:row+1, col-2:col+1 );

   %       2x2 centre block are all 1
   if all( block( 2:3, 2:3) )
      if all( block( [ 2, 14]) )
          block( [7,11] ) = 0 ;      
      elseif all( block( [ 3, 15]) )
          block( [6,10] ) = 0 ;
      elseif all( block( [ 5, 8 ]) )
          block( [ 10, 11 ] ) = 0;
      elseif all( block( [ 9, 12 ]) )
          block( [ 6, 7 ] ) = 0;
      elseif all( block( [ 1, 16 ]) )
          block( 7 ) = 0;    
      elseif all( block( [ 4, 13 ]) )
          block(  11  ) = 0;    
      elseif all( block( [ 4, 9 ]) )
          block(  11  ) = 0;            
      elseif all( block( [ 3, 9 ]) )
          block(  11  ) = 0;            
      elseif all( block( [ 8, 9 ]) )
          block(  11  ) = 0;            
      elseif all( block( [ 8, 14 ]) )
          block(  6  ) = 0;            
      elseif all( block( [ 8, 13 ]) )
          block(  6  ) = 0;           
      elseif all( block( [ 3, 14 ]) )
          block(  11  ) = 0;    
      elseif all( block( [ 3, 13 ]) )
          block(  11  ) = 0;    
      elseif all( block( [ 4, 14 ]) )
          block(  11  ) = 0;    
      elseif all( block( [ 2, 16 ]) )
          block(  10  ) = 0;       
      elseif all( block( [ 2, 15 ]) )
          block(  10  ) = 0;    
      elseif all( block( [ 1, 15 ]) )
          block(  10  ) = 0;    
      elseif all( block( [ 5, 15 ]) )
          block(  7  ) = 0;          
      elseif all( block( [ 2, 16 ]) )
          block(  10  ) = 0;      
      elseif all( block( [ 2, 12 ]) )
          block(  10  ) = 0;    
      elseif all( block( [ 5, 12 ]) )
          block(  10  ) = 0;   
      elseif all( block( [ 1, 12 ]) )
          block(  10  ) = 0;    
      end
   end
          
   MAP( row-2:row+1, col-2:col+1 ) = block  ;
end
      
