def GetImageData(self, frame_width, frame_height, x_center, y_center, z_plan, magnification): """Arguments: frame_width: long with the width in pixel. frame_height: long with the height in pixel. x_center: long with the physical X pos of the desired image in nm. y_center: long with the physical Y pos of the desired image in nm. z_plan: long with the physical Z (focal) pos of the desired image in nm. magnification: long with the objective magnification. """ if os.path.exists(self.filename): return HamaWrapper.getImageData( self.filename, frame_width, frame_height, x_center, y_center, z_plan, magnification ) else: print "Error: File not found!"
def GetImageDataNm(self, physical_width, physical_height, x_center, y_center, z_plan, magnification): """Arguments: physical_width: long with the width in nm. physical_height: long with the height in nm. x_center: long with the physical X pos of the desired image in nm. y_center: long with the physical Y pos of the desired image in nm. z_plan: long with the physical Z (focal) pos of the desired image in nm. magnification: long with the objective magnification. """ width = round(magnification * physical_width / self.CONV_FACT) + 1 height = round(magnification * physical_height / self.CONV_FACT) + 1 if os.path.exists(self.filename): return HamaWrapper.getImageData(self.filename, width, height, x_center, y_center, z_plan, magnification) else: print "Error: File not found!"
def GetImageNm(self, physical_width, physical_height, x_coord, y_coord, z_depth, magnification): """Arguments: physical_width: long with the width in nm. physical_height: long with the height in nm. x_center: long with the physical X pos of the desired image in nm. y_center: long with the physical Y pos of the desired image in nm. z_plan: long with the physical Z (focal) pos of the desired image in nm. magnification: long with the objective magnification. """ width = round(1.0 * magnification * physical_width / self.CONV_FACT) + 1 height = round(1.0 * magnification * physical_height / self.CONV_FACT) + 1 if os.path.exists(self.filename): arr = HamaWrapper.getImageData(self.filename, width, height, x_coord, y_coord, z_depth, magnification) im = Image.frombuffer("RGB", (arr.shape[2], arr.shape[1]), arr.data) return im else: print "Error: File not found!"
def GetImage(self, desired_frame_width, desired_frame_height, x_coord, y_coord, z_depth, magnification): """Arguments: frame_width: long with the width in pixel. frame_height: long with the height in pixel. x_center: long with the physical X pos of the desired image in nm. y_center: long with the physical Y pos of the desired image in nm. z_plan: long with the physical Z (focal) pos of the desired image in nm. magnification: long with the objective magnification. """ if os.path.exists(self.filename): arr = HamaWrapper.getImageData( self.filename, desired_frame_width, desired_frame_height, x_coord, y_coord, z_depth, magnification ) im = Image.frombuffer("RGB", (arr.shape[2], arr.shape[1]), arr.data) return im else: print "Error: File not found!"