Skip to content

Tutorial

Suman edited this page Jul 28, 2026 · 8 revisions

This walkthrough takes you from a clean folder to a finished FusionX report with the public tutorial dataset. It covers two small experiments (Exp1 and Exp2).

Dataset: FusionX tutorial dataset, 10.5281/zenodo.19129303

Use the Anaconda Prompt, not Command Prompt or PowerShell.

  1. Press the Windows key and type Anaconda Prompt.

  2. Open Anaconda Prompt (miniconda3), or (anaconda3) if that is what you installed.

A window opens with (base) at the start of the line. That prefix means conda is active, which is what makes the FusionX environment reachable. In a plain Command Prompt or PowerShell window, conda is usually not on the path, so every command below fails with “not recognized as an internal or external command”.

Open Terminal. Press Cmd and Space, type Terminal, then press Enter. It also lives in Applications ▸ Utilities.

If your prompt does not show (base), conda was installed without shell initialisation. Activate it by hand, and adjust the path to match your install:

source ~/miniconda3/bin/activate

Open a terminal.

Whichever system you are on, run:

conda --version

If it prints a version number, you are ready. If it reports that the command was not found, conda is not installed or not initialised. See Installation.

  1. Open the record page: zenodo.org/records/19129303.

  2. Scroll to the Files list. It holds four TIFFs: Exp1_membrane.tif, Exp1_nuclei.tif, Exp2_membrane.tif, and Exp2_nuclei.tif.

  3. Click Download on each one, or use Download all to get them in a single zip.

  4. Make a new folder called fusionx_tutorial somewhere easy to reach. Your Documents folder or Desktop works well.

  5. Move all four TIFFs into that folder. If you downloaded the zip, extract it there first and make sure the TIFFs sit directly inside fusionx_tutorial, not in an extra subfolder.

  6. Copy the folder’s full path. You use it in section 4. On Windows, click the File Explorer address bar. On macOS, hold Option, right click the folder, then choose Copy as Pathname. On Linux, press Ctrl and L.

Leave the filenames exactly as they are. The next section explains why.

FusionX does not take input paths as arguments. It scans the directory you launch it from for .tif files and pairs them by name:

  • A file that ends in _membrane.tif is the membrane or boundary channel, for example Exp1_membrane.tif.

  • A file that ends in _nuclei.tif is the nuclei channel, for example Exp1_nuclei.tif.

Everything before _membrane or _nuclei becomes the experiment name, so the sample data gives you two experiments: Exp1 and Exp2.

Three rules follow from this, and they cause most of the problems people hit on a first run:

  • Both halves are required. FusionX skips any experiment that has only a membrane file or only a nuclei file.

  • The suffixes are exact and case sensitive. FusionX does not pick up Exp1_Nuclei.tif or Exp1_nucleus.tif.

  • Only the current directory is scanned. FusionX ignores subfolders.

Four short commands: activate the environment you created during installation, move into the data folder, check that you are in the right place, then launch.

Step 1: activate the environment.

conda activate fusionx

Your prompt should now start with (fusionx) instead of (base). Running FusionX outside that environment is the most common setup problem, because Cellpose and the CellX weights are visible only from inside it.

Step 2: change into the data folder, using the path you copied in section 2. Paste it after cd. In Anaconda Prompt, a right click pastes.

Windows

cd /d "C:\Users\Documents\fusionx_tutorial"

macOS and Linux

cd ~/Documents/fusionx_tutorial

On Windows, you need the /d flag if the folder sits on a different drive from the one the prompt opened on, and the quotes matter if any part of the path contains a space.

Step 3: confirm you landed in the right place. This should list four .tif files.

Windows

dir *.tif

macOS and Linux

ls *.tif

If nothing is listed, you are in the wrong folder. FusionX looks only at the directory you launch it from, so fix this before you go further.

Step 4: launch.

FusionX

FusionX clears the terminal and prints one line per stage:

28/07/2026 14:02:11-FusionX: Welcome to FusionX
28/07/2026 14:02:11-FusionX: Number of experiment in this path: 2
28/07/2026 14:02:13-FusionX: Preprocessing experiments: 2/2
28/07/2026 14:03:47-FusionX: Segmenting nuclei: 2/2
28/07/2026 14:12:05-FusionX: Segmenting cells: 2/2
28/07/2026 14:14:38-FusionX: Validating segmentations: 2/2
28/07/2026 14:15:52-FusionX: Exporting results: 2/2
28/07/2026 14:15:56-FusionX: Cleaning up
28/07/2026 14:15:57-FusionX: Thank you for using FusionX

Number of experiment in this path: 2 confirms that FusionX found both experiments. If it says 1, stop and check the filenames.

Timings depend a lot on your hardware. Cell segmentation and nuclei recovery take most of the runtime, and both run much faster on a GPU.

Want a faster first run? Move the Exp2_*.tif files into a subfolder before you launch. FusionX then processes Exp1 only, and you can move them back later.

After the run, the working directory looks like this:

fusionx_tutorial/
├── Exp1_membrane.tif                    # your inputs, untouched
├── Exp1_nuclei.tif
├── Exp2_membrane.tif
├── Exp2_nuclei.tif
├── Exp1_FusionX_report.csv              # ← main result
├── Exp2_FusionX_report.csv              # ← main result
├── output.log
├── analysis_Exp1/
│   ├── Exp1_membrane.tif                # preprocessed copy used by the pipeline
│   ├── Exp1_nuclei.tif
│   ├── Exp1_cell_nuclei_count.parquet   # one row per cell and nucleus pair
│   ├── Exp1_nuclei_instances_COM.tif    # nuclei instance labels
│   ├── Exp1_cell_instances.tif          # cell instance labels
│   └── Exp1_unassigned_nuclei.tif       # nuclei not assigned to any cell
└── analysis_Exp2/
    └── ...

The cleanup step at the end of the run deletes the intermediate subfolders (membrane_tiles/, nuclei_segmentation/, segmentation_validation/, and nucleus_centric_cells/) once FusionX has written out the results above.

Exp1_FusionX_report.csv holds two tables side by side, separated by two empty columns.

Left block: distribution of nuclei per cell

  • nuclei_per_cell is the number of nuclei in a cell.

  • cell_count is how many cells have that many nuclei.

  • total_nuclei is the number of nuclei in those cells.

The last row of this block is labelled TOTAL and gives the total cells and the total assigned nuclei.

Right block: detail for each cell

  • cell_id is the cell instance ID. It matches *_cell_instances.tif.

  • nuclei_ids lists the nucleus IDs inside that cell, separated by commas.

  • nuclei_count is the length of that list.

Here are the first rows of the real Exp1_FusionX_report.csv:

nuclei_per_cell  cell_count  total_nuclei        cell_id  nuclei_ids  nuclei_count
1                25          25                  1        "1"         1
2                4           8                   2        "3"         1
3                1           3                   3        "7"         1
5                1           5                   4        "9,12,14"   3
10               1           10                  5        "10"        1
13               1           13                  6        "11"        1
TOTAL            33          64                  7        "13"        1
                                                 …        …           …

Read the left block like this: Exp1 contains 33 cells that hold 64 assigned nuclei. Twenty five cells are mononucleated and eight are syncytia: four with 2 nuclei, and one each with 3, 5, 10, and 13. The largest is cell 19, which pools 13 nuclei (33,34,35,36,39,40,42,43,44,45,47,50,51).

Exp2_FusionX_report.csv is built the same way and reports 69 cells and 97 nuclei: 58 mononucleated cells, 4 binucleated, 2 with 3 nuclei, 2 with 4, 2 with 5, and one cell with 7.

Three things to expect when you open these files:

  • Only observed counts appear. Exp1 jumps from 3 nuclei to 5 because no cell in that image has exactly 4.

  • The two blocks have different lengths. The left block ends at TOTAL. The right block keeps going for one row per cell, which is 33 rows for Exp1 and 69 for Exp2, so the cells on the left are blank below the total.

  • Cell IDs are not always consecutive. Exp2 runs from 1 to 71 with gaps, because FusionX drops some candidate cells during validation.

Open the outputs in Fiji or napari to see what the numbers correspond to:

  • Exp1_cell_instances.tif draws each cell with its own label value. Load it on top of Exp1_membrane.tif and colour it with a random LUT (in Fiji: Image ▸ Lookup Tables ▸ glasbey) to check that FusionX captures syncytia as single objects instead of splitting them apart.

  • Exp1_nuclei_instances_COM.tif holds the nuclei instances. It helps you check that Cellpose found roughly the right number of nuclei.

  • Exp1_unassigned_nuclei.tif holds the nuclei that never made it into a cell. A handful is normal, but a dense field of them means the membrane segmentation underperformed on that image.

FusionX logs every stage of the run in detail to output.log, in the same folder you launched it from. The console shows only the headline progress lines, so that file is the place to look when a run behaves unexpectedly. Search it for ERROR, and the first hit is usually the real cause.

FusionX overwrites output.log on every run, so copy it aside before you run again. If you open an issue, attach it along with the command you ran.

Go back to Home.

Clone this wiki locally