Skip to content

PolyVision is a cross-platform software that can be used to generate, analyze, and visualize polymer images for scientists without using any forms of laboratory equipment.

Notifications You must be signed in to change notification settings

pramishpy/PolyVision

Repository files navigation

Polymer Image Analyzer

A comprehensive cross-platform desktop application for polymer image analysis, generation, and visualization built with Qt Framework.

Features

Image Analysis

  • Histogram Analysis: Calculate and visualize intensity distributions
  • Edge Detection: Sobel edge detection algorithm
  • Particle Analysis: Detect and analyze individual polymer particles
    • Area calculation
    • Perimeter measurement
    • Circularity computation
    • Centroid detection
  • Image Processing:
    • Grayscale conversion
    • Binary thresholding
    • Gaussian blur
    • Heatmap generation

Image Generation

  • Polymer Pattern Generation: Generate synthetic polymer chain structures
  • Fiber Pattern: Create random fiber network patterns
  • Crystalline Patterns: Generate polygonal crystalline structures
  • Perlin Noise: Generate natural-looking noise patterns
  • Voronoi Diagrams: Create cellular patterns

Visualization

  • Interactive Charts: Built with QCustomPlot
    • Histograms
    • Line graphs
    • Scatter plots
    • Bar charts
  • Zoom and Pan: Interactive image viewing with mouse controls
  • Dockable Panels: Customizable workspace layout

Requirements

Qt Framework

  • Qt 5.15+ or Qt 6.x
  • Modules required:
    • Qt Core
    • Qt Gui
    • Qt Widgets
    • Qt Charts
    • Qt PrintSupport

Build Tools

  • CMake 3.16+ or qmake
  • C++17 compatible compiler:
    • MSVC 2019+ (Windows)
    • GCC 7+ (Linux)
    • Clang/Apple Clang (macOS)

Building the Application

Method 1: Using CMake (Recommended)

Windows

# Install Qt (if not already installed)
# Download from https://www.qt.io/download

# Create build directory
mkdir build
cd build

# Configure (adjust Qt path as needed)
cmake .. -DCMAKE_PREFIX_PATH="C:/Qt/6.5.0/msvc2019_64"

# Build
cmake --build . --config Release

# Run
.\Release\PolymerAnalyzer.exe

macOS

# Install Qt using Homebrew
brew install qt

# Create build directory
mkdir build && cd build

# Configure
cmake .. -DCMAKE_PREFIX_PATH="/usr/local/opt/qt"

# Build
cmake --build . --config Release

# Run
open ./PolymerAnalyzer.app

Linux

# Install Qt
sudo apt-get install qt6-base-dev qt6-charts-dev  # Ubuntu/Debian
# or
sudo dnf install qt6-qtbase-devel qt6-qtcharts-devel  # Fedora

# Create build directory
mkdir build && cd build

# Configure
cmake ..

# Build
cmake --build .

# Run
./PolymerAnalyzer

Method 2: Using Qt Creator

  1. Open Qt Creator
  2. File → Open File or Project
  3. Select PolymerAnalyzer.pro or CMakeLists.txt
  4. Configure the project with your Qt kit
  5. Build and Run (Ctrl+R or Cmd+R)

Method 3: Using qmake

# Generate Makefile
qmake PolymerAnalyzer.pro

# Build
make  # or nmake on Windows with MSVC
# or mingw32-make on Windows with MinGW

# Run
./PolymerAnalyzer  # or PolymerAnalyzer.exe on Windows

Installation

Windows

After building, the executable will be in the build/Release or build/Debug directory. You can create an installer using tools like Inno Setup or NSIS.

macOS

The application bundle will be created in the build directory. To create a DMG:

macdeployqt PolymerAnalyzer.app -dmg

Linux

Install to system:

sudo cmake --install . --prefix /usr/local

Usage

Loading Images

  1. File → Open Image or click the "Open" button
  2. Supported formats: PNG, JPG, JPEG, BMP, TIF, TIFF

Analyzing Images

  1. Load an image
  2. Use the Analysis menu or toolbar:
    • Histogram: View intensity distribution
    • Particle Analysis: Detect and measure particles
    • Measure Dimensions: Interactive measurement tools

Processing Images

  1. Load an image
  2. Use the Process menu:
    • Grayscale: Convert to grayscale
    • Edge Detection: Apply Sobel edge detection
    • Threshold: Apply binary threshold

Generating Patterns

  1. Generate → Generate Polymer Pattern
  2. Synthetic polymer patterns will be created and displayed

Visualization

  • Analysis results appear in the Analysis Results dock
  • Charts and graphs appear in the Visualization dock
  • Use Properties dock for quick access to tools

Navigation

  • Mouse Wheel: Scroll to pan
  • Ctrl + Mouse Wheel: Zoom in/out
  • Middle Mouse Button: Drag to pan
  • View Menu: Show/hide dock widgets

Project Structure

PolymerAnalyzer/
├── CMakeLists.txt          # CMake build configuration
├── PolymerAnalyzer.pro     # qmake project file
├── README.md               # This file
├── src/
│   ├── main.cpp            # Application entry point
│   ├── mainwindow.h/cpp    # Main window implementation
│   ├── imageviewer.h/cpp   # Image display widget
│   ├── analysisengine.h/cpp    # Image analysis algorithms
│   ├── imagegenerator.h/cpp    # Pattern generation
│   ├── visualizationwidget.h/cpp   # Plotting widget
│   └── qcustomplot.h/cpp   # Plotting library
├── ui/
│   └── mainwindow.ui       # Qt Designer UI file
└── resources/
    └── resources.qrc       # Qt resources

Adding QCustomPlot

QCustomPlot is included for advanced plotting. To add it:

  1. Download from https://www.qcustomplot.com/
  2. Extract qcustomplot.h and qcustomplot.cpp
  3. Place them in the src/ directory

Or download directly:

# Windows PowerShell
Invoke-WebRequest -Uri "https://www.qcustomplot.com/release/2.1.1/QCustomPlot.tar.gz" -OutFile "QCustomPlot.tar.gz"

# macOS/Linux
wget https://www.qcustomplot.com/release/2.1.1/QCustomPlot.tar.gz
tar -xzf QCustomPlot.tar.gz
cp qcustomplot-source/qcustomplot.* src/

Keyboard Shortcuts

  • Ctrl+O: Open Image
  • Ctrl+S: Save Image
  • Ctrl+Q: Quit Application

Troubleshooting

Qt not found

  • Ensure Qt is installed and CMAKE_PREFIX_PATH is set correctly
  • On Windows, make sure Qt bin directory is in PATH

Missing modules

# Install missing Qt modules
# Ubuntu/Debian:
sudo apt-get install qt6-charts-dev libqt6charts6

# macOS:
brew install qt

Build errors

  • Ensure C++17 is supported by your compiler
  • Check Qt version (5.15+ or 6.x required)
  • Verify all source files are present

Future Enhancements

  • Advanced filtering (median, bilateral)
  • 3D visualization support
  • Machine learning-based analysis
  • Batch processing
  • Plugin system
  • Export to various formats (CSV, Excel, PDF)
  • Measurement calibration
  • Image stitching

License

This project is provided as-is for educational and research purposes.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

Contact

For questions and support, please open an issue on the project repository.

About

PolyVision is a cross-platform software that can be used to generate, analyze, and visualize polymer images for scientists without using any forms of laboratory equipment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published