# Slicerdome help

Slicerdome puts a chat with an AI model next to [3D Slicer](https://www.slicer.org) running in your
browser ([SlicerWeb](https://github.com/lassoan/SlicerWeb)). You ask in plain words; the model
searches Slicer's code and forum, writes Python, runs it in the Slicer beside the chat, and tells
you what it found. You see every line of code it runs.

The source, and where to report problems: <https://github.com/pieper/Slicerdome>

## What it is for

- **Learning and exploring Slicer**: ask how something is done and watch it done on sample data
  or your own.
- **Research and teaching**: loading, measuring, segmenting and rendering images, and writing
  small scripts and modules to take to desktop Slicer.
- **Trying models**: seeing how well different AI models handle Slicer tasks, and what they cost.

It is an experiment. It can change, break or go away without notice. **It is not for clinical
use**: it is not a medical device, and nothing here is for diagnosis, treatment or any other
decision about a patient. You use it at your own risk, without any warranty. Anonymized data
about how the site is used may be recorded.

Models make mistakes. Check numbers that matter, and read the code before you trust a result.

## Getting started

1. Open the page in Chrome or Edge (Safari 26 works too). The first time, read the notice and
   press **I understand**.
2. Slicer loads on the right (about 70 MB, kept by the browser afterwards).
3. Type a request in the box at the bottom left and press **Send**. For example:
   - *Load MRHead and show it with volume rendering.*
   - *What is the voxel spacing of the loaded volume?*
   - *Load a chest CT from the Imaging Data Commons.*
4. Without a key of your own you start with **Free (Claude Haiku)**. To use other models, add a
   key in **Settings**.

## The toolbar

| Control | What it does |
|---|---|
| **Model menu** | Which model answers. Changing it starts a fresh context; the chat stays visible. |
| **Load model** | Shown for models that run in this browser: downloads and starts the chosen one. |
| **Models** | Search OpenRouter's models that can use tools, and pick one. Needs an OpenRouter key. |
| **Benchmarks** | How the models we tested did on Slicer tasks: score, time, steps and cost. |
| **Data** | Folders of your computer shared with the page: browse them, load scenes and files, save scenes. |
| **Modules** | Scripted modules kept in this browser: load, review, save to your computer, delete. |
| **Settings** | Keys, the reviewer model, the cost limit and other options. |
| **?** | This help. |
| **Status and money** | What Slicer or the model is doing, and what this tab has spent so far. |

## The chat

- **The microphone** beside Send lets you talk instead of typing. While it is on (red), what you
  say is written in the message box and sent when you pause for a moment; what you say while the
  model is working waits in the box and is sent when it has finished. Press it again to stop
  listening. Chrome and Edge recognize speech on your computer once they have fetched what they
  need for your language; until then, and in Safari, the browser sends the sound to its own speech
  service (Google's, Microsoft's or Apple's). Firefox has no speech recognition, so it shows no
  microphone.
- **Send** sends your request. The model answers in steps: each step can search, read a file or
  run Python in Slicer. Each tool call is shown, with its code and its result; click one to open it.
- **Stop** ends the current request. What Slicer has done so far stays.
- **New chat** starts over with an empty conversation. The scene in Slicer stays as it is.
- **Save transcript** downloads the conversation, with tool calls and timings, as JSON.
- Each answer ends with what the request cost. **Cost limit** in Settings stops a request that
  gets expensive.
- The chat is kept in the scene (a text node, "Slicerdome chat"), so saving the scene saves the
  chat, and opening it brings the chat back. This can be turned off in Settings.

## Free use

Without a key, the page uses Claude Haiku through Slicerdome's own proxy: up to 10 cents a month
for each visitor (roughly 80 simple tasks), while the month's budget for everyone lasts. Before
your first free request of a day, Cloudflare checks that you are not a bot; this usually shows
nothing. When your share is used up, the chat says so. Free chats are shorter than chats with
your own key: old tool results are dropped sooner.

## Your own keys

**Settings** takes a key from Anthropic (Claude models), from OpenRouter (hundreds of models), or
both. The **?** beside each says how to get one and how to cap what it can spend. OpenRouter also
has a sign-in button that makes a key for you.

Keys are kept in this browser and sent only to their provider. Use keys with a low spending limit
and an expiry date: code the model runs in the page could read them, and text it reads (forum
posts, files you load) could try to steer it into that. Watch the code it runs.

## Your data

There are three ways to get data into Slicer. In all of them the files are read into this
browser, not uploaded. What a model learns about them is what its code prints.

- **Drop** files or a folder anywhere on the page: NRRD, NIfTI, MetaImage, VTK, STL, OBJ,
  segmentations, markups, MRB scenes, or a folder of DICOM files (sorted into series, one volume
  each). The chat lists what was loaded.
- **Data** (Chrome and Edge):
  1. Press **Share a folder…** and choose a folder. The browser remembers it for this site. Tick
     **for saving too** first if the page may also write to the folder; **Allow saving** and
     **Make read only** change that later.
  2. Press **Browse** to look inside. In a later visit the browser first asks whether the page
     may use the folder again.
  3. Press **Load** beside a file, **Open scene** beside an `.mrb` or `.mrml` file, or **Load all
     of this folder** for a DICOM study. A folder with one `.mrml` file is a scene folder: **Open
     this scene** loads it.
  4. In a folder shared for saving, **Save the scene here as** saves what is in Slicer now, as a
     new scene folder or as one `.mrb` file. In a scene folder, **Save the scene here** saves over it.
  5. **Stop sharing** takes a folder off the list. Nothing on your computer is deleted.

  A model's code changes the scene in Slicer, and saving then writes those changes to the folder
  the scene is saved in. If that worries you for your source data, share that folder for reading
  only and share a second folder for saving. The browser asks you before the page writes to a
  folder shared for reading only.

  In Firefox and Safari, **Data** offers **Choose files…** and **Choose a folder…** to load once.
- **Ask the model** to fetch public data, such as Slicer's sample data or a series from the
  [Imaging Data Commons](https://imaging.datacommons.cancer.gov).

### Saving, and working with desktop Slicer

Slicer's own **Save** (in its Data panel, on the left of the Slicer view) saves the scene as an
`.mrb` file or as a scene folder, on your computer in Chrome and Edge and as a download elsewhere.
A scene opened from your computer is saved back to where it came from, and only what changed is
written. These are the formats desktop Slicer reads and writes, so a scene can go back and forth
between the two.

## Modules

Ask the model for a scripted module ("write a module that…"). It writes one as desktop Slicer has
them, keeps it in this browser and loads it into Slicer. **Modules** lists them:

- **Load** / **Reload** loads the module into Slicer and opens it.
- **Review** has another model (Settings → Agent → Reviewer) look for harmful code and suggest
  improvements. The review appears in the chat.
- **Save to computer…** writes the module's folder to your computer, after a warning: the code was
  written by a model, and desktop Slicer would run it with all of your permissions. Read it first.
  In desktop Slicer, add the folder under Application Settings → Modules → Additional module paths.
- **Open a module folder…** brings a module from your computer into this browser.
- **Delete** removes it from this browser.

## Where your messages go

A notice above the chat always says where. In short:

| You use | Your messages, the model's code and tool results go to |
|---|---|
| Free (Claude Haiku) | Slicerdome's proxy at Cloudflare, then OpenRouter, then Anthropic |
| A Claude model with your key | Anthropic |
| An OpenRouter model with your key | OpenRouter, and the provider it picks for the model |
| A model in this browser | Nowhere. These models are much weaker, and off unless turned on in Settings |

Searches of Slicer's code and forum read a public index and send nothing about you.

Other services see your requests to them, and may record them: GitHub, which delivers the page;
the sites that data and packages are downloaded from; and, when the microphone is on and the
browser does not recognize speech on your computer, the browser's speech service.

## When something goes wrong

- **Slicer does not start**: reload the page. The first load needs a good connection.
- **"You have used your free share"**: add your own key in Settings, or wait for next month.
- **The bot check does not finish**: a content blocker may be stopping it. Allow
  `challenges.cloudflare.com`, or add your own key.
- **The model goes in circles or gives a wrong answer**: press **Stop**, say what was wrong, or
  try a stronger model. **Benchmarks** shows which do best.
- **A package cannot be installed**: packages with compiled code that has not been built for the
  browser (SimpleITK, scikit-image, torch) do not work here.
- Anything else: [open an issue](https://github.com/pieper/Slicerdome/issues), and attach the
  transcript (**Save transcript**) if you can.

More detail, for people who want to run or change Slicerdome, is in the
[README](https://github.com/pieper/Slicerdome#readme).
