Image

Image — Data structure representing an image

Synopsis

#include "image.h"


struct              image;
typedef             ImageFeatureList;
enum                SpectrumType;
void                image_add_feature                   (ImageFeatureList *flist,
                                                         double x,
                                                         double y,
                                                         struct image *parent,
                                                         double intensity,
                                                         const char *name);
struct imagefeature * image_feature_closest             (ImageFeatureList *flist,
                                                         double fs,
                                                         double ss,
                                                         double *d,
                                                         int *idx,
                                                         struct detector *det);
int                 image_feature_count                 (ImageFeatureList *flist);
void                image_feature_list_free             (ImageFeatureList *flist);
ImageFeatureList *  image_feature_list_new              (void);
struct imagefeature * image_get_feature                 (ImageFeatureList *flist,
                                                         int idx);
void                image_add_crystal                   (struct image *image,
                                                         Crystal *cryst);
void                image_remove_feature                (ImageFeatureList *flist,
                                                         int idx);
void                free_all_crystals                   (struct image *image);

Description

The image structure represents an image, usually one frame from a large series of diffraction patterns, which might be from the same or different crystals.

Details

struct image

struct image;

struct image
{
   float                   *data;
   uint16_t                *flags;
   double                  *twotheta;

   Crystal                 **crystals;
   int                     n_crystals;
   IndexingMethod          indexed_by;

   struct detector         *det;
   struct beam_params      *beam;
   char                    *filename;
   const struct copy_hdf5_field *copyme;

   int                     id;

   double                  lambda;
   double                  div;
   double                  bw;

   int                     width;
   int                     height;

   long long int           num_peaks;
   long long int           num_saturated_peaks;
   ImageFeatureList        *features;
};

The field data contains the raw image data, if it is currently available. The data might be available throughout the processing of an experimental pattern, but it might not be available when simulating, scaling or merging patterns. Similarly, flags contains an array of the same dimensions as data to contain the bad pixel flags. twotheta likewise contains an array of 2*theta (scattering angle) values in radians, since these values are generated as a by-product of the scattering vector calculation and can be used later for calculating intensities from differential scattering cross sections.

crystals is an array of Crystal directly returned by the low-level indexing system. n_crystals is the number of crystals which were found in the image.

copyme represents a list of HDF5 fields to copy to the output stream.


ImageFeatureList

typedef struct _imagefeaturelist ImageFeatureList;

enum SpectrumType

typedef enum {
	SPECTRUM_TOPHAT,
	SPECTRUM_SASE,
	SPECTRUM_TWOCOLOUR
} SpectrumType;

A SpectrumType represents a type of X-ray energy spectrum to use for generating simulated data.

SPECTRUM_TOPHAT

A top hat distribution of wavelengths

SPECTRUM_SASE

A simulated SASE spectrum

SPECTRUM_TWOCOLOUR

A spectrum containing two peaks

image_add_feature ()

void                image_add_feature                   (ImageFeatureList *flist,
                                                         double x,
                                                         double y,
                                                         struct image *parent,
                                                         double intensity,
                                                         const char *name);

image_feature_closest ()

struct imagefeature * image_feature_closest             (ImageFeatureList *flist,
                                                         double fs,
                                                         double ss,
                                                         double *d,
                                                         int *idx,
                                                         struct detector *det);

image_feature_count ()

int                 image_feature_count                 (ImageFeatureList *flist);

image_feature_list_free ()

void                image_feature_list_free             (ImageFeatureList *flist);

image_feature_list_new ()

ImageFeatureList *  image_feature_list_new              (void);

image_get_feature ()

struct imagefeature * image_get_feature                 (ImageFeatureList *flist,
                                                         int idx);

image_add_crystal ()

void                image_add_crystal                   (struct image *image,
                                                         Crystal *cryst);

image_remove_feature ()

void                image_remove_feature                (ImageFeatureList *flist,
                                                         int idx);

free_all_crystals ()

void                free_all_crystals                   (struct image *image);