Skip to content
Back to skills

Io And Data

ASecurity

"Read and write SimpleITK images and transforms, choose ImageIO

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
developmentpythongorailsapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill io-and-data --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Io And Data?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Io And Data
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-io-and-data/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-io-and-data)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: io-and-data
description: "Read and write SimpleITK images and transforms, choose ImageIO
  backends, discover DICOM series, inspect metadata, and validate safe IO round
  trips."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# SimpleITK IO and Data

Use this sub-skill when a task mentions `ReadImage`, `WriteImage`, `ImageFileReader`, `ImageFileWriter`, `ImageSeriesReader`, DICOM series, metadata tags, ImageIO backends, transform IO, or file formats such as MHA, NRRD, NIfTI, PNG, TIFF, JPEG, and DICOM.

## Route by Task

- For procedural and object-oriented image reads/writes, `outputPixelType`, suffix choices, compression, explicit `imageIO`, and registered backend discovery, read [image-io](references/image-io.md).
- For DICOM directory discovery, series IDs, sorted filenames, metadata dictionaries, tag inspection, and multi-series pitfalls, read [dicom-series](references/dicom-series.md).
- For `ReadTransform`/`WriteTransform` workflows, transform format choices, and displacement-field storage caveats, read [transform-io](references/transform-io.md).
- For missing ImageIO backends, empty DICOM discovery, directory-vs-file mistakes, lossy casts, compression surprises, and transform IO failures, read [troubleshooting](references/troubleshooting.md).
- To validate an installed SimpleITK environment with generated data only, run [io_roundtrip_smoke.py](scripts/io_roundtrip_smoke.py).

## Core APIs

- Import the Python package as `import SimpleITK as sitk`; the package distribution is `simpleitk`.
- `sitk.ReadImage(fileName, outputPixelType=-1, imageIO='')` reads a single image file or an ordered filename sequence; use `outputPixelType` only for deliberate casts such as registration float inputs.
- `sitk.WriteImage(image, fileName, useCompression=False, compressionLevel=-1, *, imageIO='', compressor='')` writes one image file or a filename sequence when writing a series.
- `sitk.ImageFileReader()` and `sitk.ImageFileWriter()` provide `SetFileName`, `SetImageIO`, metadata probing, output pixel type selection, compression settings, and registered ImageIO discovery.
- Discover ImageIO backends with `sitk.ImageFileReader().GetRegisteredImageIOs()` or `sitk.ImageFileWriter().GetRegisteredImageIOs()`; do not use a module-level helper for this.
- `sitk.ImageSeriesReader.GetGDCMSeriesIDs(directory)` and `sitk.ImageSeriesReader.GetGDCMSeriesFileNames(directory, seriesID)` discover and sort DICOM slices before `ImageSeriesReader.Execute()` reads them.
- `sitk.ReadTransform(filename)` and `sitk.WriteTransform(transform, filename)` round-trip transforms through supported transform IO formats.

## Boundaries

- For image construction, pixel containers, spacing/origin/direction fundamentals, indexing, and NumPy views, route to `../image-core/SKILL.md`.
- For filters, segmentation, intensity transforms, and algorithms that consume loaded images, route to `../filtering-segmentation/SKILL.md`.
- For registration-generated transforms, transform composition, resampling, displacement-field interpretation, and optimizer-specific output, route to `../registration-transforms/SKILL.md`.
- Optional `ElastixImageFilter` and `TransformixImageFilter` are build-dependent; do not assume they exist in a SimpleITK install.

## Guardrails

- Prefer `.mha` or `.nrrd` for deterministic smoke tests and metadata-preserving examples; avoid JPEG for pixel equality because it is lossy.
- Use DICOM series discovery for directories; do not pass a directory to `ReadImage` and expect a volume.
- Treat DICOM metadata as potentially identifying; inspect or copy only tags required by the task.
- Keep runtime workflows self-contained; examples here use generated data or user-supplied paths and do not depend on the original repository checkout.

Files in this skill

  • SKILL.md3.7 KB
  • references/dicom-series.md5.2 KB
  • references/image-io.md5.8 KB
  • references/transform-io.md3 KB
  • references/troubleshooting.md5.3 KB
  • scripts/io_roundtrip_smoke.py7.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.