# RF NeRF Visualization System

## Overview

This project provides a comprehensive platform for visualizing Radio Frequency (RF) signal data in 3D space using advanced techniques like Neural Radiance Fields (NeRF), Neural Gaussian Splats, and Neural Correspondence Fields. It features a web-based frontend for interactive visualization and a robust backend for data management, processing, and job handling. The system is designed with performance in mind, leveraging CUDA Python for GPU acceleration of computationally intensive tasks.

## Key Features

*   **Multiple Visualization Techniques:** Supports Point Clouds, NeRF volumes, Gaussian Splats, and Correspondence Fields for diverse data representation.
*   **Interactive 3D Frontend:** Built with React and Three.js for a smooth and responsive user experience.
*   **Robust Backend:** Node.js/Express backend manages users, datasets, processing jobs, and real-time updates via WebSockets.
*   **GPU Acceleration:** Leverages CUDA, CuPy, and Numba via CUDA Python for significant performance improvements in data processing and rendering.
*   **Asynchronous Job Processing:** Uses a Redis-backed Bull queue for handling potentially long-running analysis tasks.
*   **Data Management:** Supports uploading, storing, and managing various RF and medical imaging data formats.
*   **User Authentication & Authorization:** Secure user management with JWT-based authentication.
*   **Subscription Tiers:** Basic support for different user subscription levels affecting resource limits and job priority.

## Technology Stack

*   **Frontend:** React, Three.js
*   **Backend:** Node.js, Express.js, MongoDB (with Mongoose), Redis (with Bull), WebSockets
*   **Processing Engine:** Python, PyTorch, NumPy, CuPy, Numba, CUDA Python
*   **Data Formats:** CSV, NPY, IQ, MAT, NIfTI, DICOM, etc.

## Project Structure

```
/
├── docs/                  # Documentation files (like this one)
├── cuda_nerf_renderer.py  # CUDA-accelerated NeRF rendering
├── cuda_rf_processor.py   # CUDA-accelerated RF data processing
├── express-backend.js     # Node.js/Express backend server
├── implementation-roadmap.mermaid # Project plan
├── nerf-rf-engine.py      # Core NeRF model and PyTorch renderer/processor
├── neural-correspondence.py # Neural Correspondence Field implementation
├── neural-gaussian-splats.py # Gaussian Splatting implementation
├── python-processing.py   # Main Python processing script entry point
├── system-architecture.svg # Visual representation of the system architecture
├── threejs-frontend.js    # React/Three.js frontend component
└── ... (Other configuration files, e.g., package.json, requirements.txt)
```

## Getting Started

1.  **Prerequisites:** Node.js, npm/yarn, Python (3.8+), pip, Conda (recommended), CUDA Toolkit (matching your GPU driver), MongoDB, Redis.
2.  **Backend Setup:**
    *   Navigate to the project root.
    *   Install Node.js dependencies: `npm install` or `yarn install`.
    *   Set up environment variables (e.g., `MONGODB_URI`, `REDIS_HOST`, `JWT_SECRET`).
    *   Start the backend server: `node express-backend.js`.
3.  **Python Engine Setup:**
    *   Create and activate a Python environment (e.g., using Conda):
        ```bash
        conda create -n rfnerf python=3.10
        conda activate rfnerf
        ```
    *   Install Python dependencies:
        ```bash
        pip install -r requirements.txt # Assuming a requirements.txt exists
        # Or install manually:
        pip install torch torchvision torchaudio numpy scipy pandas matplotlib scikit-learn pydicom nibabel bull redis
        # Install CUDA Python components (replace XX with your CUDA version, e.g., 11x or 12x)
        pip install cuda-python numba cupy-cudaXX
        ```
4.  **Frontend Setup:**
    *   Assuming the frontend is part of a larger React application, integrate the `RFVisualization` component.
    *   Ensure the frontend application is running and configured to communicate with the backend API.

## Further Reading

*   [Frontend Documentation](./frontend.md)
*   [Backend Documentation](./backend.md)
*   [Processing Engine Documentation](./processing.md)
*   [System Architecture Diagram](../system-architecture.svg)
