Image

Image — Data structure representing an image

Synopsis

#include "image.h"


struct              image;
typedef             ImageFeatureList;
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);
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_remove_feature                (ImageFeatureList *flist,
                                                         int idx);

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;

   UnitCell                *indexed_cell;
   UnitCell                *candidate_cells[MAX_CELL_CANDIDATES];
   int                     ncells;

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

   int                     id;

   double                  m;

   double                  lambda;
   double                  div;
   double                  bw;
   double                  osf;
   double                  profile_radius;
   int                     pr_dud;
   double                  diffracting_resolution;

   int                     width;
   int                     height;

   RefList                 *reflections;
   long long unsigned int  n_saturated;

   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.

candidate_cells is an array of unit cells directly returned by the low-level indexing system. ncells is the number of candidate unit cells which were found. The maximum number of cells which may be returned is MAX_CELL_CANDIDATES. indexed_cell contains the "correct" unit cell after cell reduction or matching has been performed. The job of the cell reduction is to convert the list of candidate cells into a single indexed cell, or NULL on failure.

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


ImageFeatureList

typedef struct _imagefeaturelist ImageFeatureList;

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);

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_remove_feature ()

void                image_remove_feature                (ImageFeatureList *flist,
                                                         int idx);