def makeRaster(self): shape = self.mosaicimage.shape spacing = self.settings['raster spacing'] angledeg = self.settings['raster angle'] anglerad = math.radians(angledeg) rasterpoints = raster.createRaster(shape, spacing, anglerad) if self.settings['autofinder']: self.regionarrays=[] else: #if self.regionarrays is not defined, make it an empty array try: len(self.regionarrays) except TypeError: self.regionarrays=[] # if self.regionarrays is empty, check for manually picked region if (len(self.regionarrays) < 1 and self.settings['find section options']!='Regions from Centers') or not self.settings['autofinder']: manualregion = self.panel.getTargetPositions('region') if manualregion: manualregion = self.transpose_points(manualregion) manualregionarray = numpy.array(manualregion) self.regionarrays = [manualregionarray] if len(self.regionarrays) > 0: rasterpoints = self.insideRegionArrays(rasterpoints,spacing) else: if self.regionimage is not None: rasterpoints = self.insideRegionImage(rasterpoints) fullrasterdisplay = self.transpose_points(rasterpoints) self.setTargets(fullrasterdisplay, 'acquisition', block=True)
def makeRaster(self): shape = self.mosaicimage.shape spacing = self.settings['raster spacing'] angledeg = self.settings['raster angle'] anglerad = math.radians(angledeg) rasterpoints = raster.createRaster(shape, spacing, anglerad) if self.settings['autofinder']: self.regionarrays = [] else: #if self.regionarrays is not defined, make it an empty array try: len(self.regionarrays) except TypeError: self.regionarrays = [] # if self.regionarrays is empty, check for manually picked region if (len(self.regionarrays) < 1 and self.settings['find section options'] != 'Regions from Centers') or not self.settings['autofinder']: manualregion = self.panel.getTargetPositions('region') if manualregion: manualregion = self.transpose_points(manualregion) manualregionarray = numpy.array(manualregion) self.regionarrays = [manualregionarray] if len(self.regionarrays) > 0: rasterpoints = self.insideRegionArrays(rasterpoints, spacing) else: if self.regionimage is not None: rasterpoints = self.insideRegionImage(rasterpoints) fullrasterdisplay = self.transpose_points(rasterpoints) self.setTargets(fullrasterdisplay, 'acquisition', block=True)
def makeRaster(self): shape = self.currentimagedata['image'].shape spacing = self.settings['raster spacing'] angledeg = self.settings['raster angle'] anglerad = math.radians(angledeg) rasterpoints = raster.createRaster(shape, spacing, anglerad) regionrasters = [] fullrasterset = set() for region in self.regionarrays: regionraster = polygon.pointsInPolygon(rasterpoints, region) regionrasters.append(regionraster) fullrasterset = fullrasterset.union(regionraster) # set is unordered, so use original rasterpoints for order self.fullraster = [] for point in rasterpoints: if point in fullrasterset: self.fullraster.append(point) fullrasterdisplay = self.transpose_points(self.fullraster) self.setTargets(fullrasterdisplay, 'acquisition', block=False)