Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/DeMarcoLab/fibsem
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Cleeve committed Apr 25, 2023
2 parents 0590251 + 70852f9 commit bf61906
Show file tree
Hide file tree
Showing 8 changed files with 164 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ fibsem/segmentation/training/*
site/*
scratch/training/*
fibsem/_version.py
scratch/figure/wd_*/*
scratch/figure/wd_*/*
demo_*/*
4 changes: 3 additions & 1 deletion fibsem/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
MillingPattern.Polish: "polish_lamella",
MillingPattern.Flatten: "flatten_landing",
MillingPattern.Fiducial: "fiducial",
MillingPattern.SpotWeld: "spot_weld",
}

# MILLING UI
Expand All @@ -56,5 +57,6 @@
"needle_angle",
"percentage_roi_height",
"percentage_from_lamella_surface",
"cleaning_cross_section"
"cleaning_cross_section",
"number"
]
2 changes: 1 addition & 1 deletion fibsem/config/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ system:
stage:
rotation_flat_to_electron: 49 # degrees
rotation_flat_to_ion: 229 # degrees
tilt_flat_to_electron: 35 # degrees (pre-tilt)
tilt_flat_to_electron: 35 # degrees (pre-tilt)s
tilt_flat_to_ion: 52 # degrees
pre_tilt: 35
needle_stage_height_limit: 3.7e-3
Expand Down
8 changes: 7 additions & 1 deletion fibsem/patterning.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class MillingPattern(Enum):
Polish = 8
Flatten = 9
Fiducial = 10
SpotWeld = 11


############################## PATTERNS ##############################
Expand Down Expand Up @@ -74,16 +75,18 @@ def spot_weld_pattern(
) -> list[RectanglePattern]:
# ref: spotweld terminology https://www.researchgate.net/publication/351737991_A_Modular_Platform_for_Streamlining_Automated_Cryo-FIB_Workflows#pf14

n_patterns = protocol["number"]
n_patterns = int(protocol["number"])
mill_settings = MillingSettings.__from_dict__(protocol)
mill_settings.centre_x = point.x
mill_settings.centre_y = (
point.y - (n_patterns - 1) * (protocol["offset"] + protocol["height"]) / 2
)
mill_settings.cleaning_cross_section = bool(protocol["cleaning_cross_section"])

patterns = []
for i in range(n_patterns):
pattern = milling._draw_rectangle_pattern_v2(microscope, mill_settings)
pattern.scan_direction = protocol["scan_direction"]
patterns.append(pattern)
mill_settings.centre_y += protocol["offset"] + protocol["height"]

Expand Down Expand Up @@ -333,6 +336,9 @@ def create_milling_patterns(
mill_settings.centre_y = point.y
patterns = milling._draw_fiducial_patterns(microscope, mill_settings)

if milling_pattern_type == MillingPattern.SpotWeld:
patterns = spot_weld_pattern(microscope, milling_protocol, point)

# convert patterns is list
if not isinstance(patterns, list):
patterns = [patterns]
Expand Down
3 changes: 2 additions & 1 deletion fibsem/ui/FibsemDetectionUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def __init__(

# images
from fibsem.segmentation.utils import image_blend
self.image = image_blend(self.detected_features.image, self.detected_features.mask)
# self.image = image_blend(self.detected_features.image, self.detected_features.mask)
self.image = self.detected_features.image
self._USER_CORRECTED = False

# pattern drawing
Expand Down
2 changes: 1 addition & 1 deletion fibsem/ui/FibsemMillingUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def main():
protocol_path=liftout_config.protocol_path
)
settings.image.hfw = 150e-6
milling_pattern = MillingPattern.JCut
milling_pattern = MillingPattern.SpotWeld
point = None
change_pattern = True
validate = True
Expand Down
2 changes: 2 additions & 0 deletions fibsem/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def sputter_platinum(
microscope.imaging.set_active_view(original_active_view)
microscope.patterning.set_default_beam_type(BeamType.ION.value) # set ion beam
multichem.retract()

microscope.beams.electron_beam.turn_on()
logging.info("sputtering platinum finished.")


Expand Down
148 changes: 146 additions & 2 deletions scratch/notebook.ipynb

Large diffs are not rendered by default.

0 comments on commit bf61906

Please sign in to comment.