Collect data from an i1Pro Spectrophotometer or i1Display Pro Colorimeter
The following demo shows the use of our i1.mex tools specifically for the VPixx Technologies Version of the following tools:
Please note, you must have purchased these items from VPixx Technologies or one of their distributors. Tools purchased from XRite or third parties cannot be used with our MATLAB tools.
The API for our i1 tools is stored in a MATLAB executable called i1.mex. This tool is not a standard part of our software download. You can find a copy of i1.mex on the USB key provided with your XRite device purchase from VPixx. If you no longer have the USB key, please contact support@vpixx.com with your invoice number and we will supply you with a copy.
To install your i1.mex file, see the instructions provided along with the file.
function I1Demo()
% I1Demo()
%
% Basic demo showing how to use the I1Toolbox.
% -Detects i1
% -Calibrates i1 (i1Pro only)
% -Waits for user to press button on i1 (i1Pro) or press a key (i1 Display Pro)
% -Takes a single light measurement
% -Prints CIE Lxy coordinates for measurement
% -Plots raw spectral data for measurement (i1Pro only)
%
% History:
%
% Aug 23, 2012 paa Written
% Sep 9, 2021 lef Edited to allow for either i1Pro or i1 Display Pro
AssertOpenGL; % We use PTB-3
% Confirm that there is an i1 detected in the system
if I1('IsConnected') == 0
fprintf('\nNo i1 detected\n');
return;
end
% Confirm whether device is i1Pro spectrophotometer, or i1Display Pro colorimeter
i1Type = input('\nIs your X-Rite i1 device an i1Pro spectrophotometer, or an i1 Display Pro colorimeter? [p = i1Pro, d = i1 Display Pro] ', 's');
isPro = strcmp(i1Type, 'p');
if isPro
% i1Pro needs to be calibrated after plugging it in, and before doing any measurements.
fprintf('\nPlace i1Pro onto its white calibration tile, then press i1 button to continue: ');
while I1('KeyPressed') == 0
WaitSecs(0.01);
end
fprintf('Calibrating...');
I1('Calibrate');
end
% Now we can take any number of measurements, and collect CIE Lxy and (if using I1Pro) raw spectral data for each measurement.
% For demo purposes, we'll just collect a single datum, print the Lxy coordinates, and (if using I1Pro) plot the spectral data.
if isPro
fprintf('\nPlace i1Pro sensor over light source, then press i1 button to measure.');
while I1('KeyPressed') == 0
WaitSecs(0.01);
end
fprintf('Measuring...');
I1('TriggerMeasurement');
else
fprintf('\nPoint i1 Display Pro at light source and hit any key to take a measure.');
KbWait();
end
%Take Lxy measurement. L = luminance, x and y are the coordinates in in CIE 1931 colour space.
Lxy = I1('GetTriStimulus');
fprintf('\nCIE Lxy = (%g,%g,%g)\n', Lxy(1), Lxy(2), Lxy(3));
if isPro
fprintf('\nPlotting raw spectral data\n');
spectralData = I1('GetSpectrum');
wavelengths = [380:10:730];
plot(wavelengths, spectralData);
end