! minor mod of 25 - Used for Sim02 ! corelation sim with blobs - UNEQUAL number/area of blobs ! uncorrelated blobs ! 3 measures ! all pixels ! either fluorophore ! both fluorophors ! ver 11a ! minor alteration to 11 - produce 2Dhis ! Unequal ufc=.5; ! fraction of red area used for green ! tidy up working space wp off 1,879 del 1,879; comp dev cd del 887,999 sz=512 bkn=16 ; ! uniform background rdred=5; ! radius red blob rdgrn=5; ! radius green blob ! Background R & G BKredPic=200; ! size of image create BKredPic siz sz value 16 int;ori bot left rnm=.123 ;typ 'random noise seed ',rnm noise BkRed dose 16 cal max(:bkred,0); copy bkred byt tit BKredPic text 'Back Red Pois 16'; dis Bkred to dis:2 BKgrnPic=400 cre BKgrnPic siz sz val 16 int;ori bot left; rnm=.321;typ 'second random noise seed ',rnm noise BkGrn dose 16 cal max(:bkGrn,0); cop bkGrn byt tit BKredPic text 'Back Green Pois 16'; dis Bkred to dis:3 ! Red Blobs - random positions PsRed=3; ! positions cre PsRed siz 8001,4 val 0 int; ori bot left rnm=.40093; typ rnm;noise PsRed wid sz uni ArRedPic=99; cre ArRedPic siz sz val 0 byt; ori bot left cop ArRedPic to 100 IrRed=6; ! random intensity for red blobs cre IrRed siz 8001,2 val 64 byt; ori bot left rnm=.600339 ;typ rnm; noise IrRed wid 190 uni ; ! his Ired to 999;! 999 to dis:2 min=0 max=255 dis BKredPic to dis:2 pre tarea=.05; ! target area % tinc=.05; ! increment in target area BsaRed=101; ! base for red area pics BsiRed=201; ! base for red intensity pics Ired=199; cop BKredPic to Ired;! red intensity ! Insert red blobs for n=0,8001; ! save images at inc of 5% total area sel PsRed; x=p(n,0); y=p(n,1); x1=p(n,2); y1=p(n,3) ! mar dis:2 rad rdred pos x,y sel ArRedPic; mas pos x,y ins val 1 rad rdred sel ArRedPic; mas pos x1,y1 ins val 1 rad rdred ! dis ArRedPic to dis:4 ! new blob with random intensity sel IrRed; v=p(n,0); v1=p(n,1) sel Ired; mas rad rdred pos x,y ins val v; mas rad rdred pos x1,y1 ins val v1 ver=0; sur ArRedPic full; ver=1 if mea.98 break loo ! Green Blobs - random positions typ; typ 'green seed ',.292, rnm=.1098 PsGrn=3; ! postions cre PsGrn siz 8001,4 val 0 int; ori bot left rnm=.292; noise PsGrn wid sz uni ArGrnPic=299; cre ArGrnPic siz sz val 0 byt; ori bot left cop ArGrnPic to 300 IrGrn=7; ! random intensity for red blobs cre IrGrn siz 8001,2 val 64 byt; ori bot left rnm=.1098; noise IrGrn wid 190 uni ; ! his IGrn to 999;!999 to dis:2 min=0 max=255 dis BKGrnPic to dis:2 pre tarea=.05*ufc; ! target area % tinc=.05*ufc; ! increment in target area BsaGrn=301; ! base for red area pics BsiGrn=401; ! base for red intensity pics IGrn=399; cop BKGrnPic to IGrn;! red intensity ! Insert green blobs for n=0,8001; ! save images at inc of 5% total area fill sel PsGrn; x=p(n,0); y=p(n,1); x1=p(n,2); y1=p(n,3) ! mar dis:2 rad rdred pos x,y sel ArGrnPic; mas pos x,y ins val 1 rad rdred;mas pos x1,y1 ins val 1 rad rdred ! dis ArGrnPic to dis:4 ! new blob with radom intensity sel IrGrn; v=p(n,0);v1=p(n,1) sel IGrn; mas rad rdred pos x,y ins val v mas rad rdred pos x1,y1 ins val v1 ver=0; sur ArGrnPic full; ver=1 if mea.98*ufc break loo wp 99,500 !------------------------------------------------- ! LOAD saved data ! ANALYSIS of images created above---------------------------------------------------------- f1pic=701 f2pic=702 mpic=1 cre 1 siz sz val 1 byt for g=1,5; ! all, or, and, and + back, background typ if g=1 typ 'All pixels' if g=2 typ 'Green OR Red' if g=3 typ 'Green AND Red' if g=4 typ 'Green AND Red plus background' if g=5 typ 'Background only' for n=200,219,1; ! go thru sequence of greater areas if g=2 & n=200 next n if g=3 & n=200 next n cop n to f1pic; ! red blobs gpic=n+200 cop gpic to f2pic; ! green blobs dis f1pic to dis:2 dis f2pic to dis:3 ! mask mpic=1 m1m=n-100; ! area of blobs m2m=n+100; ! area of blobs if g=1 cre mpic siz 512 val 1 byt; ! All if g=2 cal :m1m | :m2m to 1; ! Or if g=3 cal :m1m & :m2m to 1; ! And if g=4 cal :m1m + :m2m to 2; ! And plus the background if g=4 cal :2=1 if g=4 cre 1 siz sz val 1 byt if g=4 cal :1-:2 if g=5 cal :m1m | :m2m to 1; ! Or ver=0; sur 1; ver=1 if max=min next n if g=5 neg 1; ! background min=0 max=1 dis mpic to dis:4 pre lib rnkpic21; ! makes the colocalization measurements ver=0 sur mpic full ver=1 typ (n-200)*.05,r,rp,mea loo loo ! Make scattergrams f1pic=701 f2pic=702 mpic=1 cre 1 siz sz val 1 byt g=1 typ if g=1 typ 'All pixels' if g=2 typ 'Green OR Red' if g=3 typ 'Green AND Red' for n=200,219,2 if g=2 & n=200 next n if g=3 & n=200 next n cop n to f1pic gpic=n+200 cop gpic to f2pic dis f1pic to dis:2 dis f2pic to dis:3 ! mask mpic=1 m1m=n-100 m2m=n+100 if g=1 cre mpic siz 512 val 1 byt; ! All if g=2 cal or(:m1m,:m2m) to 1; ! Or if g=3 cal and(:m1m,:m2m) to 1; ! And min=0 max=1 dis mpic to dis:4 pre ! lib rnkpic21 ! typ r,rp r1pic=f1pic r2pic=f2pic lib rhis06ct; ! makes scattergrams loo ! Areas typ 'red area' for n=100,119 min=0 max=1; dis n to dis:2 pre ver=0; sur n full;ver=1; typ n,mea loo typ 'green area' for n=300,319 min=0 max=1; dis n to dis:2 pre ver=0; sur n full;ver=1; typ n,mea loo typ ' OR' for n=100,119 m1pic=n m2pic=n+200 cal or(:m1pic,:m2pic) to 999 ver=0; sur 999 full;ver=1; typ n,mea loo typ 'AND' for n=100,119 m1pic=n m2pic=n+200 cal AND(:m1pi,:m2pic) to 999 ver=0; sur 999 full;ver=1; typ n,mea loo ! Save stack 100,119 to 901; title 901 text 'red area' exa 901 out 901; del 901 stack 200,219 to 902; title 902 text 'green area' exa 902 out 902; del 902 stack 300,319 to 903; title 903 text 'red blobs' exa 903 out 903; del 903 stack 400,419 to 904; title 904 text 'green blobs' exa 904 out 904 ; del 904 ! run thru RHIS tdis=2 for n=703,723; dis n to tdis; tdis=rem(tdis+1,5);if tdis=0 tdis=2;typ tdis;uns for; wait;loo 706 hel func