ROI_3D_ASSIGNNEIGHBORS-assignneighborstoadjacentROIsL_OUT=ROI_ASSIGNNEIGHBORS(L,IM,INDEXES_TO_SEARCH)SearchesthelabeledROImatrixLforunlabeledpixels(inINDEXES_TO_SEARCH),andassignsthesepixelsbepartofanimmediatelyneighboringROI.ThebrightestneighboringpixelinIMisusedtodeterminewhichROIwillbeassigned.ThisfunctionisusefulafterWATERSHEDresegmentation,whichleavesa1pixelboundarybetweentheresegmentedROIs.Example:A=zeros(6,6);A(3,2)=2;A(3,3)=1;A(3,4)=3;L=bwlabel(A)indexes_to_search=find(L);L2=L;L2(3,3)=0;L2(3,2)=2% segment the initial ROI into 2 with a 1 pixel border% might mimic output of WATERSHEDL_out=ROI_assignneighbors(L2,A,indexes_to_search)