// A practice to create mask by built-in function
// iradius, itheta, tert
image img:=RealImage("Mask",4,256,256)
// for STEM equivalent detector
image BF, ABF, LAADF, HAADF
BF=img*0
BF=(iradius<10)
BF.SetName("BF")
ABF=img*0
ABF=(iradius>=10 & iradius<20)
ABF.SetName("ABF")
LAADF=img*0
LAADF=(iradius>=60 & iradius <80)
LAADF.SetName("LAADF")
HAADF=img*0
HAADF=(iradius>=100 & iradius<135)
HAADF.SetName("HAADF")
BF.ShowImage()
ABF.ShowImage()
LAADF.ShowImage()
HAADF.ShowImage()
// for DPC detector, 4 segment
// set rotate angle
number ang=15
if(ang>=90)
{
ang=0
}
ang=pi()*ang/180
// Note that the itheta is varied counterclockwise from 0 to -pi() when y>0
// and clockwise from 0 to +pi() when y<0
image seg1, seg2, seg3, seg4
seg1=img*0
seg1=(iradius>10 & iradius<100 & itheta>=ang & itheta<=ang+pi()/2)
seg1.SetName("Segment_1")
seg2=img*0
seg2+=tert((iradius>10 & iradius<100 & itheta>=ang+pi()/2 & itheta<=pi()),1,0)
seg2+=tert((iradius>10 & iradius<100 & itheta>=-1*pi() & itheta<=ang-pi()),1,0)
seg2.SetName("Segment_2")
seg3=img*0
seg3=(iradius>10 & iradius<100 & itheta>=ang-pi() & itheta<=ang-pi()/2)
seg3.SetName("Segment_3")
seg4=img*0
seg4=(iradius>10 & iradius<100 & itheta>=ang-pi()/2 & itheta<=ang)
seg4.SetName("Segment_4")
seg1.ShowImage()
seg2.ShowImage()
seg3.ShowImage()
seg4.ShowImage()
// iradius, itheta, tert
image img:=RealImage("Mask",4,256,256)
// for STEM equivalent detector
image BF, ABF, LAADF, HAADF
BF=img*0
BF=(iradius<10)
BF.SetName("BF")
ABF=img*0
ABF=(iradius>=10 & iradius<20)
ABF.SetName("ABF")
LAADF=img*0
LAADF=(iradius>=60 & iradius <80)
LAADF.SetName("LAADF")
HAADF=img*0
HAADF=(iradius>=100 & iradius<135)
HAADF.SetName("HAADF")
BF.ShowImage()
ABF.ShowImage()
LAADF.ShowImage()
HAADF.ShowImage()
// for DPC detector, 4 segment
// set rotate angle
number ang=15
if(ang>=90)
{
ang=0
}
ang=pi()*ang/180
// Note that the itheta is varied counterclockwise from 0 to -pi() when y>0
// and clockwise from 0 to +pi() when y<0
image seg1, seg2, seg3, seg4
seg1=img*0
seg1=(iradius>10 & iradius<100 & itheta>=ang & itheta<=ang+pi()/2)
seg1.SetName("Segment_1")
seg2=img*0
seg2+=tert((iradius>10 & iradius<100 & itheta>=ang+pi()/2 & itheta<=pi()),1,0)
seg2+=tert((iradius>10 & iradius<100 & itheta>=-1*pi() & itheta<=ang-pi()),1,0)
seg2.SetName("Segment_2")
seg3=img*0
seg3=(iradius>10 & iradius<100 & itheta>=ang-pi() & itheta<=ang-pi()/2)
seg3.SetName("Segment_3")
seg4=img*0
seg4=(iradius>10 & iradius<100 & itheta>=ang-pi()/2 & itheta<=ang)
seg4.SetName("Segment_4")
seg1.ShowImage()
seg2.ShowImage()
seg3.ShowImage()
seg4.ShowImage()
Comments
Post a Comment