Data and code contained in this folder correspond to that which is presented in the paper: 'Time of flight 3D imaging through multimode optical fibres' -------------------------------------------------------------------------------------------- Contents -------------------------------------------------------------------------------------------- The folder structure is as follows: |-Code | |-Initialise.m | |-Process Figures | | |-Figure1.m | | |-Figure2.m | | |-Figure3.m | | |-Figure4.m | | |-FigureS3.m | | |-FigureS4.m | | |-VideoS1.m | | |-VideoS2.m | | |-VideoS3.m | | |-VideoS4.m | |-Process Raw | | |-AiryFit.m | | |-Head.m | | |-SignalToNoiseRatio.m | | |-PreprocessVideos.vi | |-Subroutines | | |-fitAiry2D.m | | |-makeVideo.m | | |-nanfix.m | | |-plotSeries.m | | |-ArrayToCube.vi | | |-CosCorrect.vi | | |-ExtractPeakInfo.vi | | |-PreprocessNew.vi | | |-PreprocessOld.vi | | |-SubtractBackground.vi | | |-ThresholdHistograms.vi |-Preprocessed Data | |-airyFitResults.mat | |-headData.mat | |-chessDistance.csv | |-chessReflectivity.csv | |-daanDistance.csv | |-daanReflectivity.csv | |-pendulumDistance.csv | |-pendulumReflectivity.csv | |-peterDistance.csv | |-peterReflectivity.csv | |-SNR_40.csv | |-SNR_80.csv | |-SNR_120.csv | |-SNR_160.csv | |-SNR_200.csv | |-white40Distance.csv | |-white40Reflectivity.csv | |-white80Distance.csv | |-white80Reflectivity.csv | |-white120Distance.csv | |-white120Reflectivity.csv | |-white160Distance.csv | |-white160Reflectivity.csv | |-white200Distance.csv | |-white200Reflectivity.csv | |-chess.mp4 | |-daan.mp4 | |-pendulum.mp4 | |-peter.mp4 |-Raw Data | |-headImage.csv | |-Mask.csv | |-scannedPatterns.dat | |-scannedSpots.dat | |-SNR_40.dat | |-SNR_80.dat | |-SNR_120.dat | |-SNR_160.dat | |-SNR_200.dat | |-For Labview | | |-chess.dat | | |-daan.dat | | |-pendulum.dat | | |-peter.dat | | |-white40.dat | | |-white80.dat | | |-white120.dat | | |-white160.dat | | |-white200.dat We advise the user to maintain files and folders in this organisational tree as many of the programmes refence subroutines and data across the folders. -------------------------------------------------------------------------------------------- Folder Descriptions -------------------------------------------------------------------------------------------- -Raw Data- contains the data used in this work as recorded by the sensors. Each of the files in this folder is stored in a way suited to the program which will perform the pre-processing. A separate folder stores the raw data to be pre-processed by LabVIEW VIs as the directory's properties themselves are used in the main pre-processing VI. -Preprocessed Data- contains the files after preliminary processing has been performed on the data so that the data are in a format from which some analysis could be performed and the figures seen in the paper could be generated. These files are predominantly CSV data containing arrays where each row is a frame of a 2D image which has be lexicographically vectorised. Some of the originally larger data sets have been stored as binary '.mat' files for post processing in MATLAB. -Code- contains the code which does the processing. This is split into three parts: -Subroutines-, which contains functions referenced by the main MATLAB and LabVIEW code, -Process Raw-, which reads files from Raw Data and pre-processes them to generate files which will be saved in Preprocessed Data, and -Process Figures-, which reads files from Preprocessed Data performs some of the analysis and generates the figures and videos used in this work. -------------------------------------------------------------------------------------------- Running the Code -------------------------------------------------------------------------------------------- After downloading the code and data extract all folders and ensure the extracted files and folders are organised as above. The data, both raw and pre-processed, should already be in the required folders so each script should run directly without prerequisites. Files in the -Subroutines- folder are simply functions called from the main files in -Process Raw- and -Process Figures-. These are not designed to be stand-alone and will therefore rarely execute without errors. Each script in -Process Figures- does some data analysis or denoising and generates a figure from the paper by the same title as the script. These can be run directly as they will call Initialise.m to add the required directories to the search path in MATLAB. In -Process Raw- each programme takes data from -Raw Data-, processes it, and writes files to -Preprocessed Data-. Note: running any code here will over write the downloaded data in the -Preprocessed Data- folder. This, however, should have no bearing on the performance or output of the code down the line. As before, MATLAB scripts in this folder call Initialise.m to add the necessary directories to the search path. Before running the LabVIEW code the first time LabVIEW will spend some time searching for the sub-VIs found in the -Subroutines- folder. If it cannot find these you can guide it to the right location by clicking 'Browse' and selecting the VI by the name written in LabVIEW's automatic search box. You may have to do this for each sub-VI the first time the ProcessVideos.vi is run but most likely LabVIEW will find the others after it has been shown the way to the first. -------------------------------------------------------------------------------------------- Versions and Benchmarking -------------------------------------------------------------------------------------------- MATLAB scripts were all written on MATLAB-2020a however the code is expected to give identical results for versions of MATLAB after 2019a and should run on versions from 2015b onwards. LabVIEW VIs were all made on SP1 2019. As it only makes use of the standard toolboxes, it should run on every future version of LabVIEW newer than this. If VIs for older versions of LabVIEW are needed please be in touch with the corresponding author (email found below and in the main paper). All code was run a Dell G5 15 with an Intel Core i7-9750H CPU at 2.60GHz and 16GB of RAM. The following run times were recorded reported to the nearest 5s. -Process Figures -Figure1.m <5s -Figure2.m <5s -Figure3.m <5s -Figure4.m 125s -FigureS3.m <5s -FigureS4.m <5s -VideoS1.m 50s -VideoS2.m 50s -VideoS3.m 65s -VideoS4.m 50s -Process Raw -AiryFit.m 1140s -Head.m 25s -SignalToNoiseRatio.m 5s -PreprocessVideos.vi 145s (for input: 'All') -------------------------------------------------------------------------------------------- Correspondence -------------------------------------------------------------------------------------------- Questions and comments are welcomed by the authors and can be directed to Prof. Miles Padgett at Miles.Padgett@glasgow.ac.uk