How nicokiaru/limeseg works
Project Type and Purpose
– LimeSeg is a monolithic Java‐based plugin for the ImageJ/Fiji platform, implementing a modular 3D image‐segmentation algorithm (“SURFace ELements”).
– It provides both a Swing/JOGL GUI and a scripting interface (Groovy macros or IJ1 scripts), calls into a core optimizer, and offloads heavy compute to CUDA kernels.
File‐Structure Analysis
Top‐level build & CI:
• pom.xml (Maven build)
• .travis.yml, Travis scripts (CI)
Code and resources under src/main:
– java/eu/kiaru/limeseg/LimeSeg.java (entry point)
– commands/ (controller commands invoked by UI or scripts)
– gui/ (Swing + JOGL classes for 2D/3D rendering and tables)
– cudaHelper/ (GPU wrapper classes for FloatGpuArray, IntGpuArray, JNI utilities)
– opt/ (core segmentation optimizer, curvature computation, block of dots)
– struct/ (domain model: Cell, Vector3D, MeshConstructor, Skeleton2D)
– io/ (XML/PLY import‐export)
– ij1script/ (ImageJ1 scripting bridge)
– demos/ (demo scenarios)
Resources:
– CUDA kernels (.cu/.ptx under resources/CUDAkernels)
– shader source (GLSL under resources/shader)
– script templates (Groovy/.ijm)
Tests under src/test
update/jars: vendored ImageJ and third‐party dependencies
Architectural Patterns & Layers
– MVC‐like separation: gui (View) ↔ commands (Controller) ↔ core & struct (Model)
– Service layer: io and ij1script expose plugin functionality
– Infrastructure layer: cudaHelper + resources for GPU acceleration, external libraries via Maven/update jars
Main Components & Relationships
[Host/ImageJ Platform]
• Registers LimeSeg plugin, loads GUI or scripting hooks
[Presentation Layer]
• GUI classes (JFrameLimeSeg, JOGL3DCellRenderer, JTableCellsExplorer)
• Script templates & IJ1script bridge
↕
[Controller Layer]
• commands package – each user action or script command creates/invokes a Command object
↕
[Domain/Core Layer]
• LimeSeg.java orchestrates segmentation runs
• opt package – Optimizer, CurvaturesComputer, BlockOfDots
• struct package – in‐memory data models (Cell, MeshConstructor, Vector3D, etc.)
↕
[Infrastructure Layer]
• cudaHelper – loads kernels from resources, handles GPU memory buffers
• io – XML/PLY I/O
External libs – ImageJ, JOGL, Commons‐Math, Trove, etc.
[Auxiliary]
• demos – sample scenarios that exercise the system
• Travis CI & Maven – build, test, package
Key Technologies to Annotate
– Java 8+, Maven, Travis CI
– JOGL for OpenGL 3D rendering
– CUDA kernels via JNI wrappers
– Swing for controls, tables
– Groovy/.ijm script templates & ImageJ1 script bridge
– XML/PLY for persistence