# Example of automated re-analysis for widefield particle extinction using Extinction Suite v4.1.5 or higher

• Unzip AutoData.zip
• "AutoData.zip" contains 2 folders
• "Linear", which is treated as the primary analysis dataset
• "Radial", which will be used for automated re-analysis and is considered to be the secondary analysis dataset.
• "Linear" contains 3 folders: "ProcessedImages", "Processing", and "Results".
• In the case of this "Linear" dataset, the complete standard analysis has already been performed. Hence, these three folders comprise the outputs of both the Extinction Analysis and Particle Analysis modules. To be clear, the user does not need to analyse this dataset. It has been done for the user, so that the focus is put on automated re-analysis. It's important to understand that the user in fact only "requires" the folder "Processing" from the "Linear" dataset in this worked example. The folders "ProcessedImages" and "Results" are provided only for the user to compare to the eventual outputs of "Radial" dataset after completion of the following steps. Note that the dataset was taken for a sample of graphite nanoplatelets in silicone oil (index-matched conditions), though the experimental parameters for this dataset are not strictly relevant. Only the parameters of the experiment for the secondary dataset are important in the automated re-analysis.
• "ProcessedImages" contains the extinction images generated by the Extinction analysis module of Extinction suite: "Extinction_500_yyy.tif" to  "Extinction_600_yyy.tif", "Extinction_700_yyy.tif", where "yyy" indicates the polariser angle and in this dataset runs from 000 to 135 degrees in 045 degree steps. It also contains the images "InBand_Extinction.tif" and "LabeledParticles.tif", but are not relevant here directly.
• "Processing" contains four text files and several data-images output by the software after analysis of the primary dataset (and which are always output after running the Particle Analysis module). These files contain the positions of the peaks located in the extinction images, the location of the background points selected in the images, as well as the paramters chosen by the user in the original analysis of the primary dataset. The files are: "BGCoordinates.txt", "FilteredCoordinates.txt", PeakCoordinates.txt", and "Parameters.txt". These text files make the automated re-analysis possible. The user should not concern themselves with the data-images.
• "Results" contains the typical Extinction Suite results output for this polarisation-resolved dataset. The specific outputs are not strictly relevant.
• "Radial" contains 1 folder: "ProcessedImages".
• "ProcessedImages" contains the extinction images generated by the Extinction analysis module of Extinction suite: "Extinction_500.tif" to  "Extinction_600.tif", "Extinction_700.tif". It also contains the images "InBand_Extinction.tif" and "LabeledParticles.tif". The latter two can be deleted or ignored.
The data in this example analysis was taken by David Regan in the synchronously triggered stage-camera format using single recording over all color channels and using the shifted reference method. The recording settings are 128 images per signal position and 128 per reference position with 24 repetitions, yielding $$128\times2\times24=12288$$ total brightfield images per color channel.

### 1. Preparation for automated analysis

• Create a folder called "Processing" inside the folder "Radial".
• Copy only the text files from "Linear/Processing" into "Radial/Processing".
• Open "Radial/Processing/Parameters.txt" using a plain text editor.

• Adjust the parameters as needed to match the experimental parameters of the secondary dataset.
• The parameters currently in the document will match those of the primary dataset.
• Parameter values should always be separated from their associated label by a "tab" space after the colon. For a parameter whose value entry takes multiple numbers, for instance the names of the colour channels, all values of the entry should be separated from each other by commas with no spaces.
• For parameters which are not applicable to your experiment (in this case the radially polarised experiment), disregard them as they will not be used by the software. For instance, if the primary dataset is polarisation-resolved, as is the case here, but the secondary is not, then you do not need to worry about parameters relevant only in polarisation-resolved analysis. An example of such a parameter would be number 12 in the Parameters.txt file: Number of simulations for polarization fits.
• An important consideration to be made is that of the shift distances and drift.
• Let's assume that the primary dataset is both polarisation- and spectrally-resolved, and let's call the "reference" image of the primary dataset the image corresponding to the zeroth angle, $$\theta_0=000^\circ$$, and the "main" colour channel, $$\Lambda$$, of the primary dataset, assuming the experiment is polarisation-resolved and spectrally-resolved. Remember that the user chooses which colour channel is considered by the software to be the "main" channel.
• You can measure the drift manually. To do this:
1. Choose a diffraction-limited peak visible in the "main" image of the primary dataset and all of the images of the secondary dataset.
2. Measure the distance between the position of the peak in each image of the secondary dataset and its position in the primary dataset. Distance is measured here in units of pixels in both the x- and y- directions.
• The sign of the measured drift is important. Let's us call the x coordinate of a peak in the primary dataset $$x_1 (\Lambda,\theta_0)$$, and that of the peak at each colour channel, $$\lambda$$, and polariser angle, $$\theta$$, of the secondary dataset, $$x_2 (\lambda,\,\theta)$$, then the drift is determined in x-direction as $$\delta x=x_1 (\Lambda,\theta_0)-x_2 (\lambda,\,\theta)$$. The drift in y-direction, $$\delta y$$, is determined in the same way.
• Shift distances and direction are typically held constant between colour channels of a given experiment and practically speaking, are always held the same between polariser angles at a given channel in a given experiment. These are not requirements, the shifts can be different in all channels and at all angles, at the experimenter's discretion. Shifts will typically be the same in the primary and secondary datasets where the same field of view was measured, assuming the same objective was used in both experiments. In this case you would not need to change the shift values in the Parameters.txt file of the secondary dataset, unless there are a different number of colour channels between the two datasets. When the secondary dataset uses different shift distances than the primary dataset, the values in the Parameters.txt file of the secondary dataset will need to be adjusted.
1. Choose a diffraction-limited peak.
2. Measure the distance between the position of the bright image of the peak and its associated dark image in units of pixels in both the x- and y- directions.
3. Do this for each of the colour channels if there are more than one.
• The sign of the measured shift is important. Let's call the x-coordinate of the bright image of a diffraction-limited peak in any image of the secondary dataset, $$x_\mathrm{b}$$, and the x-coordinate of the dark image of the same peak in the same image, $$x_\mathrm{d}$$. The shift in the x-direction is determined as $$s_\mathrm{x}=x_\mathrm{b}-x_\mathrm{d}$$. The shift in the y-direction, $$s_\mathrm{y}$$, is determined the same way.
• For this dataset, we only need to change the values of parameters 39 & 40, i.e. the 'Drift detected in x direction (pixels)' and 'Drift detected in y direction (pixels)'.
• Delete all previous values found for parameter 39 and then enter  '0,1,1.5', ensuring there is a single tab space between the first value and the colon.
• Hence the line of text for parameter 39 should now read    39) Drift detected in x direction (pixels):    0,1,1.5
• Delete all previous values found for parameter 40 and then enter  '0,0,1', ensuring there is a single tab space between the first value and the colon.
• Hence the line of text for parameter 40 should now read    40) Drift detected in x direction (pixels):    0,0,1
• In this case, note there are 3 values per x and y direction, corresponding to the 3 channels in the secondary dataset (500nm, 600nm, 700nm).

### Run ExtinctionSuite v4.0.2+

• Plugins $$\rightarrow$$ ExtinctionSuite v4p0p2+
• Make sure no other images are open in ImageJ/Fiji, and then close the welcome prompt.

### 2. Mode Selection

• Choose Unpolarised. Remember the primary dataset is polarisation-resolved, but the secondary dataset is not.
• Choose Run Extinction Suite.

### 3. Module Selection

• Check "Perform Particle Analysis" only.

### 4. Choose Base Folder

• Navigate to the location of "Radial"