dicom-series-to-volume

Convert a single-series DICOM directory into a HU-scaled NIfTI volume with affine and JSON summary.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/sayalinvidia/sayali-skills-test --skill dicom-series-to-volume
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dicom-series-to-volume
Source: https://github.com/sayalinvidia/sayali-skills-test/tree/main/skills/dicom-series-to-volume
Command: npx skills add https://github.com/sayalinvidia/sayali-skills-test --skill dicom-series-to-volume

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pydicom, nibabel, numpy, typer, and includes scripts (resource) components.

What problem does it solve?

The skill automates engineering verification of single-series DICOM data by converting a directory of CT DICOM slices into a HU-scaled NIfTI volume with an affine pose and a JSON summary for downstream validation.

Core Features & Use Cases

  • Single-series DICOM to volume conversion with automatic sorting by ImagePositionPatient.
  • affine calculation from ImageOrientationPatient and PixelSpacing, producing a robust NIfTI header.
  • Outputs the volume (NIfTI) and a structured JSON summary including shape, spacing, and axcodes for verification tasks.
  • Use Case: Engineering verification of orientation gates and geometry in synthetic CT fixtures.

Quick Start

Convert a single-series DICOM directory to a HU NIfTI volume by running the script and supplying the input directory.

Frequently Asked Questions about dicom-series-to-volume

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a DICOM series to a HU-scaled NIfTI volume?

To convert a DICOM series to a HU-scaled NIfTI volume, provide a single-series CT DICOM directory to the conversion script. It outputs a HU-scaled volume.nii.gz file and a JSON summary containing affine, spacing, and axcodes.

What is the best way to get affine orientation data from CT DICOM files?

Getting affine orientation data from CT DICOM files involves calculating the pose from ImageOrientationPatient and PixelSpacing. This process produces a robust NIfTI header and outputs axcodes for geometry verification tasks.

Can I use this DICOM to NIfTI conversion for synthetic CT verification workflows?

You can use this DICOM to NIfTI conversion for engineering verification of synthetic CT fixtures. It outputs structured JSON metadata including shape, spacing, and axcodes specifically designed for validating orientation gates and geometry.

What metadata is included when converting a DICOM directory to NIfTI?

When converting a DICOM directory to NIfTI, the output includes a structured JSON summary with n_slices, spacing, affine, and axcodes. This metadata supports downstream validation of the HU-scaled volume geometry.

Does this tool support multi-series DICOM directories?

This tool does not support multi-series DICOM directories, as it is specifically designed for single-series inputs. It converts a single-series DICOM directory into a HU-scaled NIfTI volume for engineering verification workflows.