How orlyliba/oct_reconstruction_and_spectral_analysis works
Step 1: Identify the Main Components
• Data Input and Acquisition:
– The project is built to work with raw interferograms from Thorlabs OCT systems (e.g., Ganymede HR and Telesto).
– Include a “Data Input” component that represents the interferogram files and calibration files (like Chirp files mentioned in the README).
• Parameter & Configuration Setup:
– Parameter files (such as reconstructParams.m, spectralParamsV3_2D.m, spectralParamsV3_3D.m) allow users to configure system-specific variables.
– A “Parameter Setup” component that feeds into the reconstruction and analysis processes.
• Reconstruction Engine:
– The core functionality is contained in files like runReconstruct.m and runSpectralV3.m. This module is responsible for applying dispersion compensation and reconstructing OCT images.
• Spectral Analysis Module:
– This part covers spectral contrast, spectral-depth compensation, and speckle variance computations. Modules are partly integrated in the core routines (runSpectralV3.m) and functions (e.g., calcSpectral2.m, calcSpectral4.m) located within the “functions” directory.
• ROI & Statistical Analysis:
– The ROI_analysis folder contains a suite of scripts for further processing and extracting regions of interest from the OCT data.
– Include a component labeled “ROI Analysis & Statistical Processing” that indicates step-by-step operations like ROI creation and statistical analysis (e.g., createROIdata.m, getROIavg.m, statAnalysis_SEM.m, etc.).
• Visualization & Display:
– The display_functions directory contains tools for creating and exporting images (e.g., creation of Tiff stacks, PNG B-Scans, surface display functions).
– A “Display/Visualization Module” should be illustrated that receives processed data and converts it into visual representations (including colormap functions and stitching tools).
• Utility & Supporting Libraries:
– The “functions” directory houses several supportive functions for tasks like data reading, scaling, dispersion calculation, and file/folder management.
– The “xml_io_tools” directory provides XML read/write capabilities for parameter files or metadata.
– Also include “lymph_functions” (for specialized analysis possibly integrated with OCT imaging for lymphatic-related studies).
Step 2: Define Relationships and Data Flow
• That both “Reconstruction Engine” and “Spectral Analysis Module” output results to the “Display/Visualization Module” for creating final visual outputs.
• Finally, illustrate that “Utility & Supporting Libraries” interact with almost all main modules, providing elasticity and careful management of lower-level functions and I/O operations (including XML processing).
Step 3: Highlight Architectural Patterns & Technologies
• That the project uses a modular design structure. Each directory corresponds to a specific module or function—reconstruction, analysis, ROI, display, and supporting utilities.
• That the design leverages MATLAB scripting and function files extensively. Libraries for colormaps and image processing (e.g., mat2im, pmkmp, real2rgb) are important for the visualization aspect.
• Mention that the system design follows clear input-process-output phases (i.e., from raw data ingestion to parameter-based reconstruction, followed by spectral analysis, ROI processing, and visualization).
• Depending on the complexity, you might represent external dependencies like the underlying OCT hardware (Thorlabs systems) as an external block feeding data into the system.
• Use clear labels for each component, for instance:
• External inputs such as raw OCT data and external calibration/chirp files, marking how these feed into the Parameter Setup before proceeding to subsequent processing stages.
– The sequential flow of data processing.
– The modularity of various MATLAB components working together.
– How preprocessing, reconstruction, and spectral analysis map distinctly to separate modules.
– The ROI analysis and visualization functionality, which are crucial for interpreting and analyzing the OCT images.