File Pulldown Menu

Save Matlab
Import ASCII
Import Binary
Batch Multiple Files

Spectral Preprocessing

Calculation of Derivative Spectra
Normalization (Vector, Offset)
Cut Spectra
Interpolate Spectra
Smooth Spectra
ABS ↔ TR Conversion
Spectral Quality Tests
Baseline Correction
Water Vapor Correction
Noise Reduction
Cosmic Spike Removal
Batch Preprocessing

Spatial Preprocessing

Replace NaNs
Filter Images
Edge Preserving Denoising

Univariate Imaging

Chemical Imaging
Chemical Movie
Frequency Imaging
FWHM Imaging

Multivariate Imaging

HCA Imaging
KMC Imaging
FCM Cluster Imaging
PCA Imaging
VCA Imaging
n-findr Imaging
ANN Imaging
Synthon Imaging
Imaging with Distance Values
Create Composite Images
HCA of Chemical Images


Display Spectra
Set Display Limits
Grid On/Off
Adapt Colormaps
Capture Images
Export Image Data
Image Statistics
Display Large Images
Define ROI
Display Colorbar
Swap Data Blocks
Rotate HSI
Flip HSI

File Information

Show History
Show Instrument Parameters
Show Measurement Parameters
Show Additional Parameters
Edit Parameters
Using the Help Function

Menu Bar 'Spatial Preprocessing'

Spatial Preprocessing Menu

Help is available for the following functions of the 'Spatial Preprocessing' menu bar:
replace NaNs
filter images
edge preserving denoising

Reference to the literature:
Lasch P. Spectral pre-processing for biomedical vibrational spectroscopy and microspectroscopic imaging. Chem Intell Lab Syst 2012 117:100-114
Download author's copy


Crop Images

The CytoSpec software allows to cut hyperspectral data in two different ways:
  • Cut spectra, i.e. cutting in the spectral domain, and
  • Crop images in the spatial domains.

This section describes the crop function which cuts hyperspectral data in the spatial dimensions.
crop (spatial dimension)
Cropping in the spatial (x,y) dimensions reduces the number of pixel spectra. Select the 'crop images' radiobutton and enter the respective values for the x- and y-spatial regions (in pixels) which should be retained. Then press 'crop' to proceed.
Note that the 'cut/crop' function overwrites all existing data blocks (see also Internal Data Organization, Table IV).
The parameter used for 'cut' are stored within the program workspace and are accessible through the File Info menu bar (File Info → File Manipulations → type of data block).


Interpolate in the Spatial Domain - Pixel Binning

CytoSpec's 'interpolation' routines offer two different methods for data interpolation:
  • interpolation in the spectral domain, and
  • interpolation in the spatial domains.

This section describes the interpolate images function which interpolates hyperspectral images (HSI) in the spatial dimensions.
interpolation /pixel binning (spatial dimension)
Interpolation in the spatial [x,y] dimensions changes the number of pixel spectra. The number of pixel spectra can be increased, or decreased (binning). For example, if the actual number of pixel spectra is 64 × 64 (cf. edit field '# of pixel in x/y') and the settings for 'new xdim/ydim' are 32 × 32, the program performs a two-dimensional interpolation in the spatial domains which will reduce the map size by a factor of 2 × 2. Note that spatial HSI dimensions can be changed to any sizes, e.g. spatial interpolation from an initial HSI size of 64 × 64 to a size of 30 × 32 will be possible. Note also that enlarged images may require a lot of memory ressources (RAM)
Select the 'interpolate in the spatial dimensions' radiobutton and enter the desired image size in x-direction. Then press 'enter' - the value in the field 'new ydim' will be automatically updated. To change the aspect ratio between the x- and y-dimensions uncheck the checkbox 'fix aspect ratio'. Then press 'interpolate' to proceed.
The 'interpolate / pixel binning' function overwrites all existing data blocks (see also Internal Data Organization, Table III).
The parameter used for interpolate are stored within the program workspace and are accessible through File Info menu (File Info → File Manipulations → type of data block). These parameters are also provided in the report window of CytoSpec.


Replace NaN's - Replacing Pixel Spectra by Average Spectra of their Neighbors

CytoSpec's function 'replace NaNs' (NaN - not a number): This function has been introduced with CytoSpec version 2.00.05. The function is useful to replace pixel spectra containing NaN data by means of average data obtained from neighboring [x,y] pixel spectra.
What are NaN spectra?
NaN spectra, also called 'bad pixel spectra', are produced by the quality test routine: If the quality test of a given spectrum is negative, the respective spectrum in the data block of preprocessed data is replaced by NaN (Not a Number) values.
In which cases the function 'replace NaN's will be useful?
Some imaging functions, such as edge preserving denoising, or 3D Fourier-self deconvolution do not accept NaN values as inputs. In such cases the 'replace NaN' function will be useful for spatial pre-processing hyperspectral data sets.
  • The [x,y] coordinates of NaN pixel spectra are identified. CytoSpec returns a warning message in cases where more than 15% of the pixel spectra are represented by NaN spectra.
  • CytoSpec determines whether the NaN spectra are located (i) at the the corners of the image, (ii) at the margins of the image, or (iii) in the center of an image.
  • The coordinates of the pixel neighbors are obtained and the number of non-NaN neighbors is determined.
  • Mean spectra are obtained from non-NaN neighbors if the number of non-NaN neighbor spectra is larger than zero (corner case i), one (edge case, ii), or two (center case, iii).
  • Mean spectra are used to replace the NaN spectra.
  • The algorithm is repeated until all NaN spectra are replaced by non-NaN mean spectra.

  1. This function should only be used to preprocess data prior to edge preserving denoising, 3D Fourier-self deconvolution, or spatial filtering.
  2. The function 'replace NaN' should ideally only be employed in cases were single NaN spectra prevent application of the above mentioned functions.
  3. Try to avoid replacing NaN spectra from large image regions.
  4. Do not interprete spectra from regions with interpolated data.


Filter Images

The function 'filter images' can be used to apply frequency filters in the [x,y] image domain. Frequency filters such as low or high pass (smoothing/sharpening) filters are appplied in the image domain to smooth, or sharpen chemical images. The target data block of filtering in the image domain will be the data block of (de)convolution spectra if the function is applied to original, or pre-processed spectra. If derivative data are filtered, the target data block will be the block of derivative spectra (see also Internal Data Organization, Table IX).
filter image data
Select the source data block by clicking the appropriate radio button, then select the spatial filter function and the size of the kernel. To finally apply the spatial filter function click on the 'filter' button.
Available filters:
  • Gaussian
  • Mean
  • Disk
  • Savitzky-Golay smoothing
  • Laplacian

Kernel size: indicates the size of the kernel filter function in pixels
The parameter used for 'filtering images' are stored within the program workspace and are accessible through the File Info menu bar (File Info → File Manipulations → type of data block). These parameters are also shown in the command line window.

Edge Preserving Denoising

CytoSpec's function 'Edge preserving denoising': This is a new function of CytoSpec version 2.00.05. Description to be continued


3D Fourier Self-Deconvolution (3D-FSD)

Basics of 3D-FSD and references to the literature:
The method of 3D deconvolution can be considered a technique of blind deconvolution, where the transfer function is unknown and a number of assumptions are made for recovering the target scene. 3D deconvolution allows Fourier self-deconvolution in the two spatial dimensions (x and y) and the spectral/frequency dimensions (z) to be performed at the same time. The method can be applied to enhance the spectral and/or spatial resolution and to increase the image contrast. Adapted from the 1-D algorithm described in:
J.K. Kauppinen, D.J. Moffat, H.H. Mantsch, D.G. Cameron, Fourier Self-Deconvolution: a method for resolving intrinsically overlapped bands. Appl Spectrosc. 35(3) 1981. 271-276.
J.K. Kauppinen, D.J. Moffat, H.H. Mantsch, D.G. Cameron, Self-deconvolution and first order derivatives using Fourier transforms. Anal Chem. 53(9) 1981. 1454-1457.
J.K. Kauppinen, D.J. Moffat, H.H. Mantsch, D.G. Cameron, Noise in Fourier self-deconvolution. Appl. Opt. 20(3) 1981. 1866-.
Procedure of 3D-FSD:
  • Spectra from the spectral hypercube are first baseline corrected.
  • A 3D exponential curve, normalized to the point spacing, is generated.
  • A 3D Bessel smoothing function is generated.
  • The 3D data file are Fourier transformed.
  • The result is multiplied in Fourier space by the product of the 3D exponential and smoothing functions.
  • Finally, the result is inverse Fourier transformed to get the deconvoluted data file.

The k-factor must lie between 0 and 0.95: the larger k, the more smoothing is applied to the data. CytoSpec allows to set different settings for k in the spatial (k-factor x or y) or spectral dimensions (k-factor z).
Gamma (the half-width at half maximium, gamma > 0) determines the power of deconvolution: The higher gamma, the higher the power of deconvolution.
3D deconvolution

Example: The example below shows the results of 3D-FSD (data acquired by the use of a 64 x 64 mid-infrared MCT focal plane array detector). For chemical imaging, the absorbance values at 1731 wavenumbers of the original spectral (upper image) and of the deconvolution data block (lower panel) were color encoded and plotted as a function of [x,y] position. The panel to the left displays the original (blue) spectra and FSD spectra (red).
Important :
3D Fourier self-deconvolution can be performed only from the original data (data block #1). This function is only suited for envelopes much broader than the spatial/spectral resolution. Avoid oscillatory patterns due to over-deconvolution!
Reference to the literature:
Lasch P. Naumann D. Spatial Resolution in Infrared Microspectroscopic Imaging of Tissues. Biochim Biophys Acta (BBA) - Biomembranes 2006 1758(7):814-29.



Copyright (c) 2000-2021 CytoSpec. All rights reserved.