4.5.3 - Image Data - JdlImageData

John W. Campbell

4.5.3.1 Introduction

This class provides an object to hold details of an image to be passed between objects which use image data such as the JdlPXImage display object. Such an object may be returned from a JdlDiffractionImage object in the Jdl.JdlPX package. Details of a related background image may also be stored. The individual items may be accessed via public fields.

Class, fields and constructor:

Class Details
Accessible Fields
Constructor

4.5.3.2 Class Details

Package:
Jdl.JdlPX;
Class name:
JdlImageData
Class definition:
public class JdlImageData
Extends:
Object
Implements:
Cloneable
Actions:
none

4.5.3.3 Accessible Fields

The following accessible fields have been defined:

public int ns_ras
Number of rasters in image along slow moving axis.
public int nf_ras
Number of rasters in image along fast moving axis.
public int iorder
Axis order of the data in the image with respect to two local axes ax1, ax2 e.g. (xd, yd) as a number from 1 to 8:
= 1, +ax1 slow +ax2 fast (+xd, +yd)
= 2, +ax1 slow -ax2 fast (+xd, -yd)
= 3, -ax1 slow +ax2 fast (-xd, +yd)
= 4, -ax1 slow -ax2 fast (-xd, -yd)
= 5, +ax2 slow +ax1 fast (+yd, +xd)
= 6, +ax2 slow -ax1 fast (+yd, -xd)
= 7, -ax2 slow +ax1 fast (-yd, +xd)
= 8, -ax2 slow -ax1 fast (-yd, -xd)
public int type
Type of image data:
= 1, unsigned byte data
= 2, unsigned two-byte data
= 3, signed integer data
= 4, 'squashed i2' data if stored I<0 ipix = -i*8)
= 5, 'squashed i2' data if stored I<0 ipix = (I+32768)*8
= 6, 'squashed i2' data if stored I<0 ipix = (I+32768)*32
= 7, 'squashed i2' data if stored I<0 ipix = -(I+1)*256 + 32768
= 0, RGB data e.g. from a JPEG/GIF file
For RGB data 'iorder' should be set to 5 if it has been read in without reordering.
public Object imgdata
Reference to the image data in the format indicated by the 'type' parameter.
public int min_val
Minimum value of a pixel in the image. Used as a lower limit for minimum threshold used in the image display.
public int max_val
Maximum value of a pixel in the image. Used as upper limit for maximum threshold used in the image display.
public int null_pixel
Value representing a null pixel (assumed to be 0 unless otherwise set).
public int ovld_pixel
Value representing an overload pixel (if 0 the undefined).
public boolean ovfl_flag
Overflow flag (values exceeding storage type limit)
= false, Not set or no overflow values
= true, Overflow pixels found and reset to the maximum value which may be stored for the image type
public double pixsiz_x
Pixel size in mm. (along first local axis).
public double pixsiz_y
Pixel size in mm. (along second local axis).
public int o_ax1
The local 'ax1' (e.g.xd) origin pixel number (pixels numbered from 1 up) for the section of image to be displayed. (Reserved for use by the JdlPXImage object)
public int o_ax2
The local 'ax2' (e.g. yd) origin pixel number (pixels numbered from 1 up) for the section of image to be displayed. (Reserved for use by the JdlPXImage object)
public int nreq_ax1
Requested size along the first local axis (ax1) of the section of the image to be displayed. (Reserved for use by the JdlPXImage object)
public int nreq_ax2
Requested size along the second local axis (ax2) of the section of the image to be displayed. (Reserved for use by the JdlPXImage object)
public int bg_cmp
Compression factor of background image (if present) relative to full image. (may be 0).
public Object img_bg
Reference to the background image data. This will be in the same format as the main image though the size may be reduced. The background image will be ns_ras/bg_cmp times nf_ras/bg_cmp pixels in size (integer divisions so may cover a slightly smaller area than the main image. If no background image has been calculated, img_bg will be a null.

4.5.3.4 Constructor

4.5.3.4.1 Introduction

A single constructor is available.

Constructor:

Standard constructor

4.5.3.4.2 Standard constructor

Constructs a JdlImageData object

Constructor Definition:
public JdlImageData (int ns_ras, int nf_ras, int iorder, int type, Object imgdata, int min_val, int max_val, int null_pixel, int ovld_pixel, boolean ovfl_flag, double pixsiz_x, double pixsiz_y, int o_ax1, int o_ax2, int nreq_ax1, int nreq_ax2, int bg_cmp, Object img_bg)
Parameters List:
ns_ras
Number of rasters in image along slow moving axis.
nf_ras
Number of rasters in image along fast moving axis.
iorder
Axis order of the data in the image with respect to two local axes ax1, ax2 e.g. (xd, yd) as a number from 1 to 8:
= 1, +ax1 slow +ax2 fast (+xd, +yd)
= 2, +ax1 slow -ax2 fast (+xd, -yd)
= 3, -ax1 slow +ax2 fast (-xd, +yd)
= 4, -ax1 slow -ax2 fast (-xd, -yd)
= 5, +ax2 slow +ax1 fast (+yd, +xd)
= 6, +ax2 slow -ax1 fast (+yd, -xd)
= 7, -ax2 slow +ax1 fast (-yd, +xd)
= 8, -ax2 slow -ax1 fast (-yd, -xd)
type
Type of image data:
= 1, unsigned byte data
= 2, unsigned two-byte data
= 3, signed integer data
= 4, 'squashed i2' data if stored I<0 ipix = -i*8)
= 5, 'squashed i2' data if stored I<0 ipix = (I+32768)*8
= 6, 'squashed i2' data if stored I<0 ipix = (I+32768)*32
= 7, 'squashed i2' data if stored I<0 ipix = -(I+1)*256 + 32768
= 0, RGB data e.g. from a JPEG/GIF file
imgdata
Reference to the image data in the format indicated by the 'type' parameter.
min_val
Minimum value of a pixel in the image. Used as a lower limit for minimum threshold used in the image display.
max_val
Maximum value of a pixel in the image. Used as upper limit for maximum threshold used in the image display.
null_pixel
Value representing a null pixel (assumed to be 0 unless otherwise set).
ovld_pixel
Value for an overload pixel (0 if not set).
ovfl_flag
Overflow flag (values exceeding storage type limit)
= false, Not set or no overflow values
= true, Overflow pixels found and reset to the maximum value which may be stored for the image type
pixsiz_x
Pixel size in mm. (along first local axis).
pixsiz_y
Pixel size in mm. (along second local axis).
o_ax1
The local 'ax1' (e.g.xd) origin pixel number (pixels numbered from 1 up) for the section of image to be displayed.
o_ax2
The local 'ax2' (e.g. yd) origin pixel number (pixels numbered from 1 up) for the section of image to be displayed.
nreq_ax1
Requested size along the first local axis (ax1) of the section of the image to be displayed; the actual size may be reduced by up to ncmp-1 pixels if nreq_ax1 is not a multiple of ncmp where ncmp is the compression factor used when displaying the image. The actual size will be ncmp*(nreq_ax1/ncmp).
nreq_ax2
Requested size along the second local axis (ax2) of the section of the image to be displayed; the actual size may be reduced by up to ncmp-1 pixels if nreq_ax2 is not a multiple of ncmp where ncmp is the compression factor used when displaying the image. The actual size will be ncmp*(nreq_ax2/ncmp).
bg_cmp
Compression factor of background image (if present) relative to full image. (may be 0 if same size as main image).
img_bg
Reference to the background image data. This will be in the same format as the main image though the size may be reduced. The background image will be ns_ras/bg_cmp times nf_ras/bg_cmp pixels in size (integer divisions so may cover a slightly smaller area than the main image). If no background image has been calculated, img_bg must be set to null.

⇑ Up 2   ⇑ Up 1   ⇑ Top of this