The following sets of routines are available:
Film Image File Routines
Image-Plate Image File Routines
MAR Image-Plate File Routines
Axis Order Decoding Routines
These are routines for reading a film image binary file without header information and with one unsigned byte per pixel.
The following routines are available:
Open a film image file - xdl_open_film_file
Read a full film image file - xdl_read_full_film
Close a film image file - xdl_close_film_file
Fortran call: CALL XDLF_OPEN_FILM_FILE (XDLSTR(FILNAM), LENF, IFD, IERR)
Parameters: FILNAM (R) Character string holding the filename (see filename) ** Pass address using the XDLSTR routine ** LENF (R) Length of the filename string (see lenf) IFD (W) Returns the file descriptor (see fd) IERR (W) Returns the status from the xdl_open_film_file call
'C' call: int xdl_open_film_file (filename, lenf, fd)
Parameters: char * filename; /* The name of the film image file (R)*/ int lenf; /* Length of the file name. If the filename is a null terminated string then the length will be determined by the routine if lenf is 0 (R)*/ int * fd; /* Returns the file descriptor (W)*/
Return: =0 OK; =1 Unable to open the file;
Fortran call: CALL XDLF_READ_FULL_FILM (IFD, IORD, NXRASTS, NYRASTS, + IVH_BAR, IXROOT, IYROOT, IMG_FULL, + IERR)
Parameters: IFD (R) The file descriptor (see fd) IORD (R) Order of the data in the film image file (1 to 8) (see order) NXRASTS (R) The number of x rasters (see nxrasts) NYRASTS (R) The number of y rasters (see nyrasts) IVH_BAR (R) View-object handle for displaying a read progress bar >0 on 0 if none required (see vh_bar) IXROOT (R) x root position for progress bar display if required (see xroot) IYROOT (R) y root position for progress bar display if required (see yroot) IMG_FULL (W) Array to hold the read data (pass as an integer array sufficiently large to hold the returned image data) (see img_full) IERR (W) Returns the status from the xdl_read_full_film call
'C' call: int xdl_read_full_film (fd, order,nxrasts, nyrasts, vh_bar, xroot, yroot, img_full)
Parameters: int fd; /* The file descriptor of the opened film format file (R)*/ int order; /* Order of the data in the input film image file in terms of the xf, yf coordinate system as a number from 1 to 8. 1 +xf slow +yf fast 2 +xf slow -yf fast 3 -xf slow +yf fast 4 -xf slow -yf fast 5 +yf slow +xf fast 6 +yf slow -xf fast 7 -yf slow +xf fast 8 -yf slow -xf fast (R)*/ int nxrasts; /* The number of x rasters (R)*/ int nyrasts; /* The number of y rasters (R)*/ int vh_bar; /* View-object handle (>0) for display bar showing the progress of the read, 0 if none required (R) */ int xroot; /* The root x position for the top left of the display bar area if required (R)*/ int yroot; /* The root y position for the top left of the display bar area if required (R)*/ unsigned char img_full[]; /* Array returning the read image data; The slower moving index in the returned data is x going from low x to high x and the faster moving index is y going from low y to high y. (W)*/
Return: =0 OK; >0 Record number where a read error occurred; -1 unable to allocate temporary buffer space.
Fortran call: CALL XDLF_CLOSE_FILM_FILE (IFD, IERR)
Parameters: IFD (R) The file descriptor (see fd) IERR (W) Returns the status from the xdl_close_film_file call
'C' call: int xdl_close_film_file (fd)
Parameters: int fd; /* The file descriptor (R)*/
Return: =0 OK; =1 Unable to close the file;
These are routines for reading a image-plate image binary file without header information and with one unsigned two-byte integer per pixel.
The following routines are available:
Open an image plate (i2) file - xdl_open_i2
Read a full image-plate image file - xdl_read_full_i2
Close an image plate (i2) file - xdl_close_i2
Fortran call: CALL XDLF_OPEN_I2 (XDLSTR(FILNAM), LENF, IFD, IERR)
Parameters: FILNAM (R) Character string holding the filename (see filename) ** Pass address using the XDLSTR routine ** LENF (R) Length of the filename string (see lenf) IFD (W) Returns the file descriptor (see fd) IERR (W) Returns the status from the xdl_open_i2 call
'C' call: int xdl_open_i2 (filename, lenf, fd)
Parameters: char * filename; /* The name of the 'i2' format image file (R)*/ int lenf; /* Length of the file name. If the filename is a null terminated string then the length will be determined by the routine if lenf is 0 (R)*/ int * fd; /* Returns the file descriptor (W)*/
Return: =0 OK; =1 Unable to open the file, =2 error in reading the file header
Fortran call: CALL XDLF_READ_FULL_I2 (IFD, IORD, NXRASTS, NYRASTS, + IVH_BAR, IXROOT, IYROOT, IMG_FULL, + MINVAL, MAXVAL, IERR)
Parameters: IFD (R) The file descriptor (see fd) IORD (R) Order of the data in the film image file (1 to 8) (-IORD can be given to swap bytes in the data as well as re-order it ) (see order) NXRASTS (R) The number of x rasters (see nxrasts) NYRASTS (R) The number of y rasters (see nyrasts) IVH_BAR (R) View-object handle for displaying a read progress bar >0 on 0 if none required (see vh_bar) IXROOT (R) x root position for progress bar display if required (see xroot) IYROOT (R) y root position for progress bar display if required (see yroot) IMG_FULL (W) Array to hold the read data (pass as an integer array sufficiently large to hold the returned image data) (see img_full) MINVAL (W) The minimum pixel value in the image (see minval) MAXVAL (W) The maximum pixel value in the image (see maxval) IERR (W) Returns the status from the xdl_read_full_film call
'C' call: int xdl_read_full_i2 (fd, order, nxrasts, nyrasts, vh_bar, xroot, yroot, img_full, minval, maxval)
Parameters: int fd; /* The file descriptor of the opened film format file (R)*/ int order; /* Order of the data in the input film image file in terms of the xf, yf coordinate system as a number from 1 to 8. (-order can be given to byte swap the data as well as change the order) 1 +xf slow +yf fast 2 +xf slow -yf fast 3 -xf slow +yf fast 4 -xf slow -yf fast 5 +yf slow +xf fast 6 +yf slow -xf fast 7 -yf slow +xf fast 8 -yf slow -xf fast (R)*/ int nxrasts; /* The number of x rasters (R)*/ int nyrasts; /* The number of y rasters (R)*/ int vh_bar; /* View-object handle (>0) for display bar showing the progress of the read, 0 if none required (R) */ int xroot; /* The root x position for the top left of the display bar area if required (R)*/ int yroot; /* The root y position for the top left of the display bar area if required (R)*/ unsigned short img_full[]; /* Array returning the read image data; The slower moving index in the returned data is x going from low x to high x and the faster moving index is y going from low y to high y i.e. the same order as in the file. (W)*/ int *minval; /* Returns the minimum pixel value in the image (W)*/ int *maxval; /* Returns the maximum pixel value in the image (W)*/
Return: =0 OK; >0 Record number where a read error occurred.
Fortran call: CALL XDLF_CLOSE_I2 (IFD, IERR)
Parameters: IFD (R) The file descriptor (see fd) IERR (W) Returns the status from the xdl_close_i2 call
'C' call: int xdl_close_i2 (fd)
Parameters: int fd; /* The file descriptor (R)*/
Return: =0 OK; =1 Unable to close the file;
These are routines for reading a MAR image-plate system image file including the header information and overflow data.
The following routines are available:
Read a MAR image plate file - xdl_read_mar
Read and squash a MAR image plate file - xdl_rdsquash_mar
Read a Photon Factory Log Byte File - xdl_read_pfbyte
Fortran call: CALL XDLF_READ_MAR (IFD, IVH_BAR, IXROOT, IYROOT, + IMG_FULL, NXPIX, NYPIX, NS_RAS, NF_RAS, + MINVAL, MAXVAL, IERR)
Parameters: IFD (R) The file descriptor (see fd) IVH_BAR (R) View-object handle for displaying a read progress bar >0 on 0 if none required (see vh_bar) IXROOT (R) x root position for progress bar display if required (see xroot) IYROOT (R) y root position for progress bar display if required (see yroot) IMG_FULL (W) Array to hold the read data (pass as an integer array sufficiently large to hold the returned image data) (see img_full) NXPIX (W) Returns no. of 'x' pixels NYPIX (W) Returns no. of 'y' pixels NS_RAS (W) Returns no. of slow rasters NF_RAS (W) Returns no. of fast rasters MINVAL (W) The minimum pixel value in the image (see minval) MAXVAL (W) The maximum pixel value in the image (see maxval) IERR (W) Returns the status from the xdl_read_mar call
'C' call: int xdl_read_mar (fd, vh_bar, xroot, yroot, img_full, nxpix, nypix, ns_ras, nf_ras, minval, maxval)
Parameters: int fd; /* The file descriptor of the opened film format file (R)*/ int vh_bar; /* View-object handle (>0) for display bar showing the progress of the read, 0 if none required (R) */ int xroot; /* The root x position for the top left of the display bar area if required (R)*/ int yroot; /* The root y position for the top left of the display bar area if required (R)*/ int img_full[]; /* Array returning the read image data (W) */ int *nxpix; /* Returns the no. of 'x' pixels (W)*/ int *nypix; /* Returns the no. of 'y' pixels (W)*/ int *ns_ras; /* Returns the no. of 'slow' rasters */ int *nf_ras; /* Returns the no. of 'fast' rasters */ int *minval; /* Returns the minimum pixel value in the image (W)*/ int *maxval; /* Returns the maximum pixel value in the image (W)*/
Return: =0 OK; >0 Record number where a read error occurred. -1 error in allocating memory -2 error reading header -3 error reading overflow data
Fortran call: CALL XDLF_RDSQUASH_MAR (IFD, IVH_BAR, IXROOT, IYROOT, + IMG_FULL, NXPIX, NYPIX, NS_RAS, NF_RAS, + MINVAL, MAXVAL, IERR)
Parameters: IFD (R) The file descriptor (see fd) IVH_BAR (R) View-object handle for displaying a read progress bar >0 on 0 if none required (see vh_bar) IXROOT (R) x root position for progress bar display if required (see xroot) IYROOT (R) y root position for progress bar display if required (see yroot) IMG_FULL (W) Array to hold the read data (pass as an integer array sufficiently large to hold the returned image data) (see img_full) NXPIX (W) Returns no. of 'x' pixels NYPIX (W) Returns no. of 'y' pixels NS_RAS (W) Returns no. of slow rasters NF_RAS (W) Returns no. of fast rasters MINVAL (W) The minimum pixel value in the image (see minval) MAXVAL (W) The maximum pixel value in the image (see maxval) IERR (W) Returns the status from the xdl_rdsquash_mar call
'C' call: int xdl_rdsquash_mar (fd, vh_bar, xroot, yroot, img_full, nxpix, nypix, ns_ras, nf_ras, minval, maxval)
Parameters: int fd; /* The file descriptor of the opened film format file (R)*/ int vh_bar; /* View-object handle (>0) for display bar showing the progress of the read, 0 if none required (R) */ int xroot; /* The root x position for the top left of the display bar area if required (R)*/ int yroot; /* The root y position for the top left of the display bar area if required (R)*/ unsigned short img_full[]; /* Array returning the read image data as squashed two-byte data (W) */ int *nxpix; /* Returns the no. of 'x' pixels (W)*/ int *nypix; /* Returns the no. of 'y' pixels (W)*/ int *ns_ras; /* Returns the no. of 'slow' rasters */ int *nf_ras; /* Returns the no. of 'fast' rasters */ int *minval; /* Returns the minimum pixel value in the image (W)*/ int *maxval; /* Returns the maximum pixel value in the image (W)*/
Return: =0 OK; >0 Record number where a read error occurred. -1 error in allocating memory -2 error reading header -3 error reading overflow data
Fortran call: CALL XDLF_READ_PFBYTE (IFD, IORD, NXRASTS, NYRASTS, + IVH_BAR, IXROOT, IYROOT, IMG_FULL, + IERR)
Parameters: IFD (R) The file descriptor (see fd) IORD (R) Order of the data in the image file (1 to 8) (see order) NXRASTS (R) The number of x rasters (see nxrasts) NYRASTS (R) The number of y rasters (see nyrasts) IVH_BAR (R) View-object handle for displaying a read progress bar >0 on 0 if none required (see vh_bar) IXROOT (R) x root position for progress bar display if required (see xroot) IYROOT (R) y root position for progress bar display if required (see yroot) IMG_FULL (W) Array to hold the read data (pass as an integer array sufficiently large to hold the returned image data) (see img_full) IERR (W) Returns the status from the xdl_read_pfbyte call
'C' call: int xdl_read_pfbyte (fd, order, nxrasts, nyrasts, vh_bar, xroot, yroot, img_full)
Parameters: int fd; /* The file descriptor of the opened film format file (R)*/ int order; /* Order of the data in the input film image file in terms of the xf, yf coordinate system as a number from 1 to 8. 1 +xf slow +yf fast 2 +xf slow -yf fast 3 -xf slow +yf fast 4 -xf slow -yf fast 5 +yf slow +xf fast 6 +yf slow -xf fast 7 -yf slow +xf fast 8 -yf slow -xf fast (R)*/ int nxrasts; /* The number of x rasters (R)*/ int nyrasts; /* The number of y rasters (R)*/ int vh_bar; /* View-object handle (>0) for display bar showing the progress of the read, 0 if none required (R) */ int xroot; /* The root x position for the top left of the display bar area if required (R)*/ int yroot; /* The root y position for the top left of the display bar area if required (R)*/ unsigned short img_full[]; /* Array returning the read image data as two byte unsigned quantities; The slower moving index in the returned data is x going from low x to high x and the faster moving index is y going from low y to high y. (W)*/
Return: =0 OK; >0 Record number where a read error occurred; -1 unable to allocate temporary buffer space.
These are routines for decoding the axis order codes use to indicate the order of the data in an image file.
The following routines are available:
Interpret axis order string - xdl_axord
Fortran call: CALL XDLF_AXORD (STR, LEN, IORD, ISWAP, IERR)
Parameters: STR (R) Character string containing the axis order (and byte swapping option) definition (see str) ** Pass address using the XDLSTR routine ** LEN (R) The length of the character string IORD (W) Returns the axis order as a number from 1-8 (0 if not specified or syntax error) (see order) ISWAP (W) Returns the byte swap flag =1 no byte swap =2 byte swap data =0 not specified (or syntax error) IERR (W) Returns the status from the xdl_axord call
'C' call: int xdl_axord (str,len,order,swaptyp)
Parameters: char *str; /* String containing the axes order and byte swap flags (R)*/ int len; /* Length of the string; if 0 then assume a null terminated string was passed (R) */ int *order; /* Returns the axis order given as a number from 1 to 8 (If none specified (or syntax error) return 0) 1 +xf slow +yf fast 2 +xf slow -yf fast 3 -xf slow +yf fast 4 -xf slow -yf fast 5 +yf slow +xf fast 6 +yf slow -xf fast 7 -yf slow +xf fast 8 -yf slow -xf fast (W)*/ int *swaptyp; /* Returns byte swap type =1 do not swap bytes =2 swap bytes =0 not specified (or syntax error) (W)*/
Return: Error flag =0 no error; >0 syntax error =1 Only one axis defined. =2 Both axes the same. =3 More than two axes defined. =4 Byte swapping and no byte swapping defined.