Module for the ‘Project’ class that handles a project instance.
- class core.Project(filename_full, debug_obj=None, species_dict=None)¶
The main API through which to build and access the data extracted from HAADF-STEM images.
filename_full (str) – The full path and/or relative path and filename of the .dm3 image to import. A project can be instantiated with filename_full=’empty’, but this is only meant to be used as a placeholder. Use Project.import(filename, file_type) to instantiate projects from other files than dm3.
debug_obj (GUI.MainUI()) – (Optional, default=None) An reference to an AutomAl 6000 GUI.MainUI() instance.
species_dict (dict) – (Optional, default=None) A species dictionary for the project. If none is provided, core.Project.default_species_dict is used.
Calculate the area averaged pixel intensity
Calculate average intensity for every vertex based on image information.
Calculate the average pixel intensity of the image.
- column_characterization(starting_index, search_type=0, ui_obj=None)¶
Column characterization algorithm.
Assumes a starting_index, that is taken to be an Al column in the matrix. The search_type enables access to the different sub-proccesses of the algorithm. These are:
The full column characterization
The most important parts of the algorithm
Finalize the parameter state
Identify edge columns
Not in use
Active model predictions from alpha angles
Calculate normalized gamma attributes
Evaluate advanced species
Active model predictions from all attributes
Reset all probability vectors
Reset user-set columns
Look for intersections
Not in use
Build the vertex maps of the graph (including out-neighbourhoods)
Build the vertex maps of the graph (excluding out-neighbourhoods)
Run untangling (including strong)
Run untangling (excluding strong)
Experimental zeta analysis
Calculate area gamma
Not in use
Not in use
Columns that have been set by the user will not be have their species changed by the algorithm. Apply
search_type=13to reset columns if needed.
starting_index (int) – Index of a vertex that is a part of the matrix.
search_type (int) – (optional, default=0) Which sub-process to access.
- column_characterization_2(starting_index, sub_method=0, ui_obj=None, indent='', supress_logging=False)¶
The full algorithm consist of many pieces, which through the interface of this method, can be accsessed as a full sequence, or induvitiualliy if needed.
Calling this method will do one of the following things:
————— ————————— —————————————————————– sub_method Method title descripiton ————— ————————— —————————————————————– o (default) Full algorithm Applies the full algorithm as intended 1 Initialization Applies the nessercary initialization of the image 2 recurring section Graphs and statistics will battle for convergence 3 Finalization section Make summaries and checks the integrity of the data 4 Spatial mapping Calculate projected separation matrix 5 Edge detection Label vertices close to the edge of the graph 6 Graph mapping Assign out-neighbourhoods 7 Apply alpha model Predict adv. species from alpha angles (zeta selected) 8 Apply full model Predict adv. species from all attributes 9 Precipitate detection Find precipitate 10 Calculate gamma Calculate normalized gamma 11 Zeta-analysis Determine zeta values (plane association) 12 Weak untangling Run weak untangling 13 Strong untangling Run strong untangling 14 Evaluate adv. species Determine adv. species from at. species 15 Reset probability vectors Reset probability vectors 16 Reset user-set columns Unset all user species determinations 17 Find intersections Find and terminate arc intersections 18 Graph mapping Map in-neighbourhoods only 19 Calculate area gamma Calculate alternative intensity measure 20 Refresh graph Refresh graph parameters 21 test version Experimental version 22 Zeta untangling Zeta untangling 23 Alpha (district) Alpha model from district angles 24 Alpha (partners) Alpha model from partner angles 25 Alpha (Out) Alpha model from out-neighbour angles ————— ————————— —————————————————————–
- column_detection(search_type='s', plot=False)¶
Column detection algorithm.
The search type indicates the termination condition of the column detection (see table).
———————————– —————————————————— search_type explanation ———————————– —————————————————— s Search until self.search_size columns are found. t Search until self.search_mat.max() < self.threshold. ———————————– ——————————————————
This algorithm will check the column state and continue appropriately if there are already columns present. It will also “roll back” columns if the threshold value is higher than the peak gamma of the already existing columns. This means that if the initial threshold is guessed too low, then it will remove columns.
search_type (str) – (Optional, default=’s’) The algorithm termination condition.
plot (bool) – (Optional, default=False) Plotting on/off.
Locate vertices that are close to the edge of the image.
These vertices get special treatment throughout the program because information about their surroundings will be incomplete. This method will find all vertices that are within a distance 6 * self.r from the edge, and set the field self.graph.vertices[i].is_edge_column = True.
Generate a string representation of the alloy based on the alloys present in the species dictionary.
:returns A species string on the form Al-Mg-Si. :rtype str:
Returns the a spatial length in image pixel length.
spatial_length (float) – A spatial length in pm
- Returns An image length in px
- Rtype float
Returns the an image length in spatial length.
spatial_length (float) – An image length in px
- Returns A spatial length in pm
- Rtype float
- static load(filename_full, supress_logging=False)¶
Load an instance from a pickle-file.
filename_full (str) – Path-name of the file to be loaded.
- Return type
- make_heat_map(attribute, kernel_size=1, kernel_step_size=1, measure_type='variance', kernel_type='square', title='heat map')¶
attribute (str) –
- Returns A heat map of the image
- Rtype numpy.array
Find the mean of the intensity of the Al-matrix, and scale all intensities.
Scale all intensities such that the mean of the Al-matrix is a fixed point. Store the result in each vertex i
Redraw the search matrix.
Build a string representation of the current instance.
- Returns A project summary
- Rtype str
Reset the graph (delete all vertices)
Reset graph (except all vertices and their 2D position)
- save(filename_full, supress_logging=False)¶
Save the current project as a pickle file.
filename_full (str) – Path and name of save-file. The project will be pickled as filename_full without any file-extension identifier.
- vertex_report(i, supress_log=False)¶
Build a string representation of vertex i.
- Returns A vertex summary
- Rtype str