DIALS

dials.algorithms.peak_finding

Table of Contents

class dials.algorithms.peak_finding.spot_finder.ExtractPixelsFromImage(imageset, threshold_image, mask, max_strong_pixel_fraction, region_of_interest)[source]

Bases: object

A class to extract pixels from a single image

Methods

__call__(index) Extract strong pixels from an image
class dials.algorithms.peak_finding.spot_finder.ExtractSpots(threshold_image, mask=None, mp_method='multiprocessing', nproc=1, mp_chunksize=1, max_strong_pixel_fraction=0.1, region_of_interest=None)[source]

Bases: object

Class to find spots in an image and extract them into shoeboxes.

Methods

__call__(imageset) Find the spots in the imageset
class dials.algorithms.peak_finding.spot_finder.Result(pixel_list)[source]

Bases: object

A class to hold the result from spot finding on an image.

When doing multi processing, we can process the result of each thread as it comes in instead of waiting for all results. The purpose of this class is to allow us to set the pixel list to None after each image to lower memory usage.

class dials.algorithms.peak_finding.spot_finder.SpotFinder(find_spots=None, filter_spots=None, scan_range=None, write_hot_mask=True)[source]

Bases: object

A class to do spot finding and filtering.

Methods

__call__(datablock) Do the spot finding.
dials.algorithms.peak_finding.spot_finder.batch_parallel_map(func=None, iterable=None, processes=None, callback=None, method=None, chunksize=1)[source]

A function to run jobs in batches in each process

class dials.algorithms.peak_finding.spotfinder_factory.BackgroundGradientFilter(background_size=2, gradient_cutoff=4)[source]

Bases: object

Methods

__call__(flags, **kwargs) Call the filter and print information.
run(flags[, sweep, shoeboxes])
run(flags, sweep=None, shoeboxes=None, **kwargs)[source]
class dials.algorithms.peak_finding.spotfinder_factory.CentroidResolutionFilter(d_min, d_max)[source]

Bases: object

Methods

__call__(flags, **kwargs) Call the filter and print information.
run(flags[, sweep, observations]) Run the filtering.
run(flags, sweep=None, observations=None, **kwargs)[source]

Run the filtering.

class dials.algorithms.peak_finding.spotfinder_factory.FilterRunner(filters=None)[source]

Bases: object

A class to run multiple filters in succession.

Methods

__call__(flags, **kwargs) Call the filters one by one.
check_flags(flags[, predictions, ...]) Check the flags are set, if they’re not then create a list of Trues equal to the number of items given.
check_flags(flags, predictions=None, observations=None, shoeboxes=None, **kwargs)[source]

Check the flags are set, if they’re not then create a list of Trues equal to the number of items given.

Parameters:
  • flags – The input flags
  • predictions – The predictions
  • observations – The observations
  • shoeboxes – The shoeboxes
Returns:

The filtered flags

class dials.algorithms.peak_finding.spotfinder_factory.MinPixelsFilter(num, code)[source]

Bases: object

Filter the reflections by the number of pixels in the shoeboxes.

Methods

__call__(flags, **kwargs) Call the filter and print information.
run(flags[, observations, shoeboxes]) Run the filtering.
run(flags, observations=None, shoeboxes=None, **kwargs)[source]

Run the filtering.

class dials.algorithms.peak_finding.spotfinder_factory.PeakCentroidDistanceFilter(maxd)[source]

Bases: object

Methods

__call__(flags, **kwargs) Call the filter and print information.
run(flags[, observations, shoeboxes]) Run the filtering.
run(flags, observations=None, shoeboxes=None, **kwargs)[source]

Run the filtering.

class dials.algorithms.peak_finding.spotfinder_factory.PowderRingFilter(crystal_symmetry, width=0.06)[source]

Bases: object

Methods

__call__(flags, **kwargs) Call the filter and print information.
run(flags[, sweep, observations])
run(flags, sweep=None, observations=None, **kwargs)[source]
class dials.algorithms.peak_finding.spotfinder_factory.SpotDensityFilter(nbins=50, gradient_cutoff=0.002)[source]

Bases: object

Methods

__call__(flags, **kwargs) Call the filter and print information.
run(flags[, sweep, observations])
run(flags, sweep=None, observations=None, **kwargs)[source]
class dials.algorithms.peak_finding.spotfinder_factory.SpotFinderFactory[source]

Bases: object

Factory class to create spot finders

Methods

configure_algorithm(params) Given a set of parameters, construct the spot finder
configure_filter(params) Get the filter strategy.
configure_threshold(params) Get the threshold strategy
from_parameters([params]) Given a set of parameters, construct the spot finder
load_image(filename_or_data) Given a filename, load an image.
static configure_algorithm(params)[source]

Given a set of parameters, construct the spot finder

Parameters:params – The input parameters
Returns:The spot finder instance
static configure_filter(params)[source]

Get the filter strategy.

Parameters:params – The input parameters
Returns:The filter algorithm
static configure_threshold(params)[source]

Get the threshold strategy

Parameters:params – The input parameters
Returns:The threshold algorithm
static from_parameters(params=None)[source]

Given a set of parameters, construct the spot finder

Parameters:params – The input parameters
Returns:The spot finder instance
static load_image(filename_or_data)[source]

Given a filename, load an image. If the data is already loaded, return it.

Parameters:filename_or_data – The input filename (or data)
Returns:The image or None
class dials.algorithms.peak_finding.spotfinder_factory.UntrustedPolygonFilter(polygons)[source]

Bases: object

Methods

__call__(flags, **kwargs) Call the filter and print information.
run(flags[, sweep, observations])
run(flags, sweep=None, observations=None, **kwargs)[source]
dials.algorithms.peak_finding.spotfinder_factory.generate_phil_scope()[source]
class dials.algorithms.peak_finding.spotfinder_factory.polygon(vertices)[source]

Bases: object

Methods

is_inside(x, y)
is_inside(x, y)[source]