This documentation page refers to a previous release of DIALS (2.2).
Click here to go to the corresponding page for the latest version of DIALS

dials.algorithms.spot_finding

class dials.algorithms.spot_finding.finder.ExtractPixelsFromImage(imageset, threshold_function, mask, region_of_interest, max_strong_pixel_fraction, compute_mean_background)[source]

Bases: object

A class to extract pixels from a single image

class dials.algorithms.spot_finding.finder.ExtractPixelsFromImage2DNoShoeboxes(imageset, threshold_function, mask, region_of_interest, max_strong_pixel_fraction, compute_mean_background, min_spot_size, max_spot_size, filter_spots)[source]

Bases: dials.algorithms.spot_finding.finder.ExtractPixelsFromImage

A class to extract pixels from a single image

class dials.algorithms.spot_finding.finder.ExtractSpots(threshold_function=None, mask=None, region_of_interest=None, max_strong_pixel_fraction=0.1, compute_mean_background=False, mp_method=None, mp_nproc=1, mp_njobs=1, mp_chunksize=1, min_spot_size=1, max_spot_size=20, filter_spots=None, no_shoeboxes_2d=False, min_chunksize=50, write_hot_pixel_mask=False)[source]

Bases: object

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

class dials.algorithms.spot_finding.finder.ExtractSpotsParallelTask(function)[source]

Bases: object

Execute the spot finder task in parallel

We need this external class so that we can pickle it for cluster jobs

class dials.algorithms.spot_finding.finder.PixelListToReflectionTable(min_spot_size, max_spot_size, filter_spots, write_hot_pixel_mask)[source]

Bases: object

Helper class to convert the pixel list to reflection table

class dials.algorithms.spot_finding.finder.PixelListToShoeboxes(min_spot_size, max_spot_size, write_hot_pixel_mask)[source]

Bases: object

A helper class to convert pixel list to shoeboxes

class dials.algorithms.spot_finding.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.spot_finding.finder.ShoeboxesToReflectionTable(filter_spots)[source]

Bases: object

A class to filter shoeboxes and create reflection table

class dials.algorithms.spot_finding.finder.SpotFinder(threshold_function=None, mask=None, region_of_interest=None, max_strong_pixel_fraction=0.1, compute_mean_background=False, mp_method=None, mp_nproc=1, mp_njobs=1, mp_chunksize=1, mask_generator=None, filter_spots=None, scan_range=None, write_hot_mask=True, hot_mask_prefix='hot_mask', min_spot_size=1, max_spot_size=20, no_shoeboxes_2d=False, min_chunksize=50)[source]

Bases: object

A class to do spot finding and filtering.

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

Bases: object

run(flags, sequence=None, shoeboxes=None, **kwargs)[source]
class dials.algorithms.spot_finding.factory.FilterRunner(filters=None)[source]

Bases: object

A class to run multiple filters in succession.

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.spot_finding.factory.PeakCentroidDistanceFilter(maxd)[source]

Bases: object

run(flags, observations=None, shoeboxes=None, **kwargs)[source]

Run the filtering.

class dials.algorithms.spot_finding.factory.SpotDensityFilter(nbins=50, gradient_cutoff=0.002)[source]

Bases: object

run(flags, sequence=None, observations=None, **kwargs)[source]
class dials.algorithms.spot_finding.factory.SpotFinderFactory[source]

Bases: object

Factory class to create spot finders

static configure_filter(params)[source]

Get the filter strategy.

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

Get the threshold strategy

Parameters:params – The input parameters
Returns:The threshold algorithm
static from_parameters(params=None, experiments=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
dials.algorithms.spot_finding.factory.generate_phil_scope()[source]