# Fiber Diameter Analyzer for SEM (Electrospinning & Filters) (`jovianlabs/fiber-diameter-analyzer`) Actor

Fiber diameter distribution from SEM images of nanofiber mats, filter media and textiles: length-weighted mean with 95 % CI, D10/D50/D90, beads, alignment, quality checks and a PDF report.

- **URL**: https://apify.com/jovianlabs/fiber-diameter-analyzer.md
- **Developed by:** [Jovian Labs](https://apify.com/jovianlabs) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1,000.00 / 1,000 images

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Fiber Diameter Analyzer for SEM (Electrospinning & Filters)

Measure fiber diameters from scanning electron microscope images of electrospun nanofiber mats, filter media, nonwovens and technical textiles. Instead of drawing 100 lines by hand in ImageJ, upload the images and get the full length-weighted diameter distribution with its confidence interval, beads, fiber alignment, quality checks and a PDF report.

**Try it in one click:** leave the image list empty and press Start. The Actor generates four synthetic nanofiber images with known diameters and beads, analyses them and compares the result with the truth. Demo runs are free.

### What you get

| Output | Content |
|---|---|
| Dataset item | length-weighted mean diameter ± SD, 95 % confidence interval of the mean, median, D10/D50/D90, CV, fiber segments and length measured, beads, alignment index and main direction, coverage, quality status and checks |
| `REPORT.pdf` | main results, detection check image, length-weighted distribution, orientation histogram, results per image, method, quality checks, traceability |
| `segments.csv` | one row per fiber segment: length, mean and median diameter, orientation, position |
| `control-sheet.jpg` | every image with fiber outlines, measured axes (yellow), excluded crossings (grey) and beads (red) |
| `summary.json` | all statistics in machine-readable form |

### Who it is for

- Electrospinning labs tuning voltage, flow rate, concentration or humidity
- Filter media and membrane developers (air, water, face masks)
- Tissue engineering and biomaterials groups reporting scaffold fiber diameters
- Quality control of nonwovens and technical textiles
- AI agents that need fiber statistics from SEM images (callable through the Apify MCP server)

### How it works

1. The pixel size comes from the microscope metadata (Zeiss or Thermo Fisher TIFF), the scale bar of the data band, or the value you give.
2. The fiber axes are traced (skeleton of an inclusive fiber mask) and crossings are located.
3. **The diameter is measured like a CD-SEM measures a line width:** at each axis point, on the intensity profile perpendicular to the fiber, as the full width at half maximum between the local background and the peak, with sub-pixel interpolation. It does not depend on a threshold setting. On isolated fibers 8 to 40 pixels wide it reads within 0.6 pixel of the truth.
4. Crossings, fiber ends and beads are excluded, because no width can be measured there.
5. Statistics are weighted by length. Confidence intervals come from a bootstrap over fiber segments (not over pixels, which are not independent).
6. Beads (spindle-shaped defects) are counted with a prudent rule, so the count is a lower bound: beads on a crossing or under other fibers are not counted.
7. Fiber alignment is summarised by an index from 0 (random) to 1 (fully aligned) and a main direction.
8. Eight automatic checks rate the run green, amber or red: scale consistency, resolution, segments measured, precision, share of the axis excluded, consistency between images, contrast and saturation.

### Accuracy

On synthetic nanofiber mats with known diameters (blur, noise, depth, crossings and beads included):

| True length-weighted mean | Measured | 95 % CI of the mean |
|---|---|---|
| 295 nm (demo, 28 fibers per image) | 292 nm | 284–300 nm |
| 299 nm (dense mat, 38 fibers per image) | 295 nm | 287–304 nm |
| 148 nm (about 7 px per diameter) | 153 nm | 150–156 nm |
| 305 nm (aligned mat) | 302 nm | 293–311 nm |

Limit: in very dense mats of thick fibers, fibers partly hidden by others read too thin (−6 to −11 % on synthetic mats of 600 nm fibers); the run then flags a large share of excluded axis.

### Input example

```json
{
  "imageUrls": [
    "https://example.com/mat-A-1.tif",
    "https://example.com/mat-A-2.tif",
    "https://example.com/mat-A-3.tif"
  ],
  "scaleBarNm": 5000,
  "sampleName": "PCL-12pct-15kV"
}
```

Set `"reportLanguage": "fr"` for a report in French. Use `pixelSizeNm` when the images have no data band, or nothing at all for original Zeiss or Thermo Fisher TIFF files.

Use 3 to 10 images of the same sample at the same magnification, with at least 8 pixels across a typical fiber. Images must be direct download links (TIFF, PNG or JPG, up to 60 MB each).

### Pricing

You pay per image analysed. There is no charge for images that cannot be downloaded, and demo runs (no image URLs) are free.

### Good to know

- Fibers must be brighter than the background (the usual SEM case). Tick `fibersAreDark` for the opposite.
- Only visible fibers are measured. Fibers lying side by side along their whole length can read as one wider fiber.
- Hollow, ribbon-like or highly porous fibers are not distinguished.
- This is automated image analysis, not an accredited (ISO/IEC 17025) laboratory measurement.
- Need a report reviewed and signed by a materials imaging scientist? A verified analysis service is available on request (contact through the Actor's issues tab).

# Actor input Schema

## `imageUrls` (type: `array`):

Direct links to SEM images of ONE sample (TIFF, PNG or JPG), all at the same magnification, with at least 8 pixels across a typical fiber. 3 to 10 images usually give 100+ fiber segments. Leave empty to try the Actor on built-in synthetic nanofiber images (free).

## `scaleBarNm` (type: `string`):

Length printed on the scale bar of the image data band, in nanometres (e.g. 5000 for 5 µm). Optional for original Zeiss or Thermo Fisher (FEI) TIFF files: the pixel size is then read from the metadata.

## `pixelSizeNm` (type: `string`):

Use when the images have neither a data band nor microscope metadata, e.g. 20. Overrides everything else.

## `sampleName` (type: `string`):

Shown on the report.

## `fibersAreDark` (type: `boolean`):

Leave off for the usual SEM case (bright fibers on a darker background).

## `reportLanguage` (type: `string`):

Language of the PDF report and CSV headers.

## `maxImages` (type: `integer`):

Each analysed image is billed once.

## Actor input object example

```json
{
  "sampleName": "SAMPLE-01",
  "fibersAreDark": false,
  "reportLanguage": "en",
  "maxImages": 20
}
```

# Actor output Schema

## `results` (type: `string`):

Length-weighted mean diameter with its 95 % confidence interval, D10/D50/D90, beads, alignment and quality status.

## `report` (type: `string`):

Full report: diameters, confidence intervals, beads, orientation, detection check, per-image results, quality checks, method and traceability.

## `controlSheet` (type: `string`):

Every image with fiber outlines, measured axes, excluded crossings and beads.

## `segments` (type: `string`):

One row per fiber segment: length, mean and median diameter, orientation, position.

## `summary` (type: `string`):

All statistics in machine-readable form.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("jovianlabs/fiber-diameter-analyzer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("jovianlabs/fiber-diameter-analyzer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call jovianlabs/fiber-diameter-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jovianlabs/fiber-diameter-analyzer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/lrXh9MSU9gPZYlSbJ/builds/nuI0trGvhCge2YSeK/openapi.json
