fibresem/core/fibresem.py
def crop_square(self, copy=False, barheight=SEM_BAR_HEIGHT):
        """Crop to Square and omit the SEM meta bar"""

        newHeight = round(self.Data.shape[0] * (1 - barheight))
        left = round((self.Data.shape[1] - newHeight) / 2)
        right = self.Data.shape[1] - left

        try:
            cropped_image = self.Data[0:newHeight, left:right]
        except Exception as err:
            logging.error(f"Could not crop {self.Filename}")
            print(err)
            return False

        if copy:
            return cropped_image

        self.Data = cropped_image
        return True
Crop to Square and omit the SEM meta bar
Crop to Square and omit the SEM meta bar
Crop to Square and omit the SEM meta bar
def crop_square(self, copy=False, barheight=SEM_BAR_HEIGHT):
        newHeight = round(self.Data.shape[0] * (1 - barheight))
        left = round((self.Data.shape[1] - newHeight) / 2)
        right = self.Data.shape[1] - left
        try:
            cropped_image = self.Data[0:newHeight, left:right]
        except Exception as err:
            logging.error(f"Could not crop {self.Filename}")
            print(err)
            return False
        if copy:
            return cropped_image
        self.Data = cropped_image
        return True
def crop_square ( self , copy = False , barheight = SEM_BAR_HEIGHT ) : newHeight = round ( self . Data . shape [ 0 ] * ( 1 - barheight ) ) left = round ( ( self . Data . shape [ 1 ] - newHeight ) / 2 ) right = self . Data . shape [ 1 ] - left try : cropped_image = self . Data [ 0 : newHeight , left : right ] except Exception as err : logging . error ( f"Could not crop {self.Filename}" ) print ( err ) return False if copy : return cropped_image self . Data = cropped_image return True
Crop to Square and omit the SEM meta bar
Crop to Square and omit the SEM meta bar
"""Crop to Square and omit the SEM meta bar"""
self
copy
barheight