Camecard
Purpose
Read Cameca Ion-Tof file into MATLAB.
Synopsis
images = camecard(filename,pixelrange,masses,varargin)
Description
Optional input (filename) is the file name to read. If omitted or empty [], a file selection dialog is used to locate the file to read. Optional input (pixelrange) is used to truncate the imported image specified spatial x,y pixel ranges:
[ x_low x_high; y_low y_high ]
Only the pixels from x_low to x_high and y_low to y_high will be read in. A value of [0] (zero) for pixelrange will return an empty image. This can be used to access the mass axis (see outputs below) without reading in the image data. Optional input (masses) is a vector indicating the mass centers to read. Only the masses with the centers specified in this vector will be read in. Either optional input can be omitted. By default, the entire image and all masses are returned. When input (pixelrange) is not [0] (zero), output (out) is an image dataset object containing the read image and the mass channels in axisscale{2}. Axisscale sets 1,2 and 3 are the middle, lower and upper mass values for each variable. When (pixelrange) is [0] (zero), (out) will be three row vectors listing the middle, lower and upper masses available in the file. If the function is called with no inputs or outputs, the file reading and saving is accomplished through dialog boxes. The function can also be used in the command line mode where filename is a text string indicating the file name and out is dataset object with appropriate axis scales.
Examples
myimages = camecard('myfile.bif');
See Also
Purpose
Perform automatic clustering of image using sample distances.
Synopsis
- [clas,basis,info,h] = cluster_img(x,nclusters,options);
- clas = cluster_img(x,basis,options);
Description
Automatically identifies unique pixels in a given image and classifies all other pixels as to which of the unique pixels they are closest to. Pixels are chosen using the DISTSLCT algorithm, the selected samples are normalized to unit length and the remaining pixels are projected onto that basis to determine distances. Although significantly faster, this algorithm returns slightly different results than knn clustering. Inputs take one of two forms: A) [clas,basis,info,h] = cluster_img(x,nclusters,options) The data to cluster (x), the total number of clusters to form (nclusters), and the optional options structure (see below), or B) clas = cluster_img(x,basis,options) The data to cluster (x), a previously calculated basis set returned by cluster_img (basis), and an optional options structure. Outputs are a vector of integer classes for each sample in x (clas), the corresponding normalized basis spectra (basis), information on the targets and correlations (info), and the handle (h) of a figure if created. The output (info) is a structure containing the following fields:
- corr : the correlation of each pixel to each target
- targets : the indices of the pixels used as targets
Options
options is a structure is a structure array with the following fields:
- plots: ['none'|{'final'}] governs level of plotting.
- algorithm: [{'distslct'}| 'classmean'] algorithm for determining classes.
- minarea: {1} minimum area (in %) that a class must account for to be retained as a unique class.
- preprocessing: {[]} preprocessing structure (see PREPROCESS).
- pca: [{'no'}|'yes'] When 'yes', A PCA model is calculated from the data and the scores are used to perform clustering. The output basis is in terms of the original variables.
- ncomp: [1] Number of PCs (components) to retain from the PCA model. Only used if options.pca is 'yes'.