2014 Laboratory D: Inverse Adding Doubling Data Analysis
Introduction: This lab has been split into 2 major parts:
- Analysis of simulated data
- Experimental measurement of a thin turbid sample
Analysis of Simulated Data
A) How to use the GUI:
- To launch the GUI interface used for this portion of the lab, locate the “IAD_simulated_data_GUI.m” in the “IAD lab” folder on the desktop. When Matlab opens, run this file from the editor window. The GUI should appear in a separate window.
- Load Sample Data Sets:
- click “tissue types” in the upper left hand corner to select the desired tissue data (Liver.mat or White_Matter.mat). These two tissues were selected for this study, given their contrasting optical properties. Namely, liver tissue exhibits relatively high absorption and low scattering properties, whereas brain white matter is characterized by low absorption and high scattering.
- Run through this sensitivity analysis procedure (sections B and C) with both tissue types.
- Once the desired tissue is selected, Click the “load” button. The simulated Reflectance (Blue or Cyan) and Transmittance (Red or Magenta) spectra will appear in the figure immediately to the right of this panel.
- click “tissue types” in the upper left hand corner to select the desired tissue data (Liver.mat or White_Matter.mat). These two tissues were selected for this study, given their contrasting optical properties. Namely, liver tissue exhibits relatively high absorption and low scattering properties, whereas brain white matter is characterized by low absorption and high scattering.
- Input Parameters
- In the panel below Load Sample Data Sets, the requisite sample input parameters are listed. For these exercises, all simulated data were generated with the following properties:
- Sample thickness (physical thickness): 1mm
- Index of refraction of the sample: 1.4
- Scattering anisotropy (g): 0.8
- In the panel below Load Sample Data Sets, the requisite sample input parameters are listed. For these exercises, all simulated data were generated with the following properties:
- Running the Inverse Adding-Doubling solver
- The “Calculate” button will submit the reflectance and transmittance spectra along with the input parameters into the IAD executable developed by Scott Prahl. Since this part of the lab uses simulated data, all the experimental considerations integrated in this executable have been disabled (which is not the case for the second part of this lab).
- This code will take a few seconds to run, but once completed:
- The calculated absorption and reduced scattering coefficients will be plotted in the two figures below the Reflectance and Transmittance plot.
- The error (% difference from ideal measurement as a function of wavelength) will be plotted in the top right figures. Using the correct input parameters will produce a 0% error, obviously.
- Fitting Absorption Spectrum to determine Chromophore Concentration
- Clicking the “Fit” button in the lower right panel will perform a Linear Least-Squares operation, fitting the calculated absorption spectrum to the spectral response from oxy- (HbO2) and deoxy- (Hb), water (H2O), and Lipids. The expected values represent the concentrations of these 4 chromophores used to generated this simulated dataset.
- Even under idealized conditions such as these, the fits for these chromophores are not exact even though the model used here is an exact solution to the RTE. Can you speculate why?
- While the top figure in this panel shows the calculated absorption spectrum and the scaled basis spectra for the 4 chomophores as determined by the least-squares fit, the bottom figure shows the residual from this fit. The single value for the “Mean Residual” is the Sum of Residuals-Squared, divided by the number of data points in the spectrum.
- Additional GUI features
- “Clear” buttons will clear the data from the adjacent figures
- “Reset” will clear all data loaded and plotted in the GUI
- “Add Noise” panel will be described later in “Effects of Measurement Noise” (section C)
B) Dependence of Optical Properties and Chromophore concentration determination to the precision of input parameters when using IAD
- Anisotropy: Tissue is typically described as having values of 0.7-0.99. It has also been documented that this value can slowly change as a function of wavelength over a large spectral range. However, when inverse solvers are used, a single invariant value for g is assumed and it is rarely measured directly from tissue.
- Change the value for Anisotropy in the Input Parameter panel to 0.7 and 0.9 and run the IAD solver at each value.
- How much error is accrued as a consequence of these erroneous values for g?
- How significantly does this alter the determination of chromophore concentrations? (keep the errors for each chromophore in mind going forward, as some chromophores may be more susceptible than others, and this may also be dependent on the composition of the tissue as well…)
- Sample Thickness: From an experimental perspective there are a number of factors to consider in terms of what an ideal sample thickness would be (optical thickness (expected optical properties), balancing signal to noise in both Reflectance and Transmittance measurements, side light losses, etc., as well as your ability to precisely measure the thickness of the sample). These considerations also only matters if you even have a choice in preparing the sample at the desired thickness.
- Change the sample thickness by +/- 10% and run IAD
- How are errors in sample thickness correlated with errors in the optical properties?
- How do these effect chromophore concentrations?
- Index of Refraction: Like anisotropy, the index of tissue is challenging to directly and accurately determine. Additionally, it is also (very) slowly varying as a function of wavelength. Given the lack of experimental ease of accessibility, this value is often assumed. In the context of IAD, it is useful to understand just how this parameter can affect the calculation of optical properties and any other determination downstream.
- Change the index of refraction by +/- 10% and run IAD
- How are errors correlated with errors in the optical properties?
- How do these effect chomophore concentrations?
C) Effects of Measurement Noise (and post-processing methods to mitigate noise
- From the “Add Noise to Data” panel, you have the opportunity to alter the simulated reflectance and transmittance data in two ways:
- Add quasi- “signal-dependent” noise (mimicking typical measurement shot-noise). As we are starting with simulated calibrated data, the noise inserted here is arbitrary, but an approximation of the how raw measurement noise might propagate through the calibration process. To that end, the values used to “add noise” are somewhat arbitrary. For the purposes of this lab, use values of 5 and 10.
- Use a filtering method to smooth out the noise from the underlying signal. While there are a wide variety of filters that can be employed to signal process spectral measurements (all with their own strengths and weaknesses), a simple box-car filter is used in this lab. Here the “smoothing window size” represents the sliding spectral band used to average all data within that band in order to reduce the random noise in that window relative to the mean signal at each data point. Whereas a larger window would provide larger data sampling to minimize the variance from random noise, it is at the consequence maintaining the spectral resolution of the measurement.
- Apply noise to the loaded data at levels of 5 and 10 and run the inverse solver. As noise is random, repeat this at least 3 times to better characterize the variance and consequences of this “level” of noise. Specifically, what becomes the variance in the chromophore concentration values?
- At a noise level of 10, apply a smoothing window of 20 and 40nm (at least 3 times each)
- What becomes the variance in the chromophore concentration values?
- Is there any apparent bias to the chromophore values? It is tissue optical property specific?
- Can you think of any other way to improve this? (think in terms of smoothing, fitting, and/or chromophore reference spectra)
Experimental measurement of a thin turbid sample
There are 2 experimental setups provided to make measurements of thin turbid samples (silicone sheets embedded with titanium dioxide (as a scattering agent) and Nigrosin dye (as the absorber)). The computers attached to these systems have both the data acquisition codes (LabView) and the data processing codes (Matlab) specific to the components used in each of these setups. NOTE: these systems (more specifically: the components) are NOT optimized for making robust IAD measurements.
A) Data acquisition
- There are 2 systems setup to acquire data:
- The BWtek system is the one covered by optical curtain (BWtek is the black spectrometer)
- The SSI system is the one with the framed box (SSI is the prototype red spectrometer)
- These setups have been prepared to simplify some of the more subtle, yet requisite, calibration steps, but the general data acquisition sequence is as follows:
- BWtek system
- Acquisition Code: In the “Lab D – IAD lab\Data Acquisition\” folder on the desktop, double click the IAD_acquire.vi to launch LabView.
- Make sure the Light Source is on (Grey box) with the manual shutter open (metal tab pulled all the way to the right)
- And the spectrometer power supply (on top of the desktop computer) is on
- Run the LabView VI (Arrow Button)
- Sphere Calibration
- With the lamp shutter open, click the auto expose button to determine the optimal exposure time for this measurement (also ensure the reflectance port is closed with the spectralon plug – so you are measuring “100% transmission”)
- Close the lamp shutter and click “dark noise”. This will acquire the “dark” measurement for the Sphere Calibration
- Open the Shutter and click “Scan” to acquire the Sphere Calibration (the dark noise will be automatically subtracted from this measurement)
- Save the data in a subfolder for running in matlab gui processing code
- Transmittance Measurement:
- Place the silicone sheet “sample” in front of the entrance port of the sphere and click auto expose (with the lamp shutter open)
- Close shutter and click “dark noise”
- Open shutter, click “scan” and save data
- Reflectance Measurement:
- Unscrew the reflectance port plug and affix the sample to this port, click auto expose
- Close shutter and click “dark noise”
- Open shutter, click “scan” and save
- Acquisition Code: In the “Lab D – IAD lab\Data Acquisition\” folder on the desktop, double click the IAD_acquire.vi to launch LabView.
- SSI system
- Acquisition Code: In the “Lab D – IAD lab\Data Acquisition\” folder on the desktop, double click the SSI_IAD_acquire.vi to launch LabView.
- Make sure the Light Source is on (Black box) and the intensity dial is at its highest setting
- Run the LabView VI (Arrow Button)
- Sphere Calibration
- Block the light source at the distal end of the fiber (inside the box) using the black fiber tip plug on the top of the system box. Be careful not to bump the other optical elements in the system (paraboloic mirror or iris) and click “dark noise”. This will acquire the “dark” measurement for the Sphere Calibration.
- Remove the block and click “Acquire” to acquire the Sphere Calibration (the dark noise will be automatically subtracted from this measurement)
- Save the data in a subfolder for running in matlab gui processing code.
- Transmittance Measurement:
- Place the silicone sheet “sample” in front of the entrance port of the sphere, block the beam, and click “dark noise”
- Remove block, click “scan” and save data
- Reflectance Measurement:
- Pull out the reflectance port plug and affix the sample to this port, block beam and click “dark noise”
- unblock, click “acquire” and save
- Acquisition Code: In the “Lab D – IAD lab\Data Acquisition\” folder on the desktop, double click the SSI_IAD_acquire.vi to launch LabView.
- Additional measurement parameters
- Beam diameter (defaulted in the processing code, so unless the iris is changed, it has been hard coded for 4mm)
- Sample thickness: Use calipers to measure the physical thickness of the sample
- Sphere parameters: Sphere Size, Reflectivity, reflectance, transmittance and detector port sizes, etc have been determined in advance. (hard coded in the specific computers processing gui)
- BWtek system
B) Data Processing
- In the same folder double click the IAD_processing.m file to launch Matlab. In the editor window click run and the GUI should appear as a separate window.
- Input parameters
- Enter g (anisotropy), Thickness (in mm) and Index (n). For these silicone phantoms, g is assumed to be 0.9 and n is 1.43.
- Data processing step size: Prahl’s IAD code has extensively considered a wide variety of experimental non-idealities and means to identify and compensate for them. As a result, there is an additional layer of minimization (based on Monte Carlo) to ensure that the optical properties determined from IAD will also account for the physical realities of the measurement (e.g. light losses outside of the integrating sphere, etc). This increases the processing time dramatically.
- Setting the data processing step size reduces the number of spectral data points (running only every nth data point collected) to reduce the computational burden of the code.
- There are 600 data points saved in the BWtek system (a step size of 10 should only take a few minutes to run)
- There are >2000 data points saved in the SSI system (a step size of 50 should only take a few minutes to run)
- Setting the data processing step size reduces the number of spectral data points (running only every nth data point collected) to reduce the computational burden of the code.
- There are 3 list boxes, one for the raw reflectance, transmittance and sphere calibration measurements respectively.
- Clicking the Select directory button will let you choose the data folder that contains all your measurement data, clicking the highlighted text in one of the 3 list boxes will populate them with the filenames in this data directory
- Selected (by clicking) the appropriate measurement from the list for each measurement type
- Click the “Calculate” button and keep your fingers crossed
- The above figure will plot the Calibrated Reflectance and Transmittance Spectra
- You can monitor the progress from the inverse solver in the command window of Matlab as it calculates the optical properties wavelength by wavelength
- Up on completion, the figure to the right will plot the calculated optical properties …
- Questions
- From your sensitivity analysis in the simulated data section, can you infer where the most likely source of error may have come? (are these sample or instrumentation related?)
- and if so, what would you change to either verify and/or minimize this error?
- Do you ever want to see an integrating sphere in your life …ever again?