--- license: cc-by-nc-4.0 pretty_name: "SpineDepth per-frame: raw RGB-D frames, CT meshes, per-frame poses and a reconstruction script" tags: - medical-imaging - rgbd - depth-camera - computed-tomography - spine - point-cloud - registration - pose-estimation - orthopedics size_categories: - 1K/ # s ∈ {1..10} │ ├── STL/ │ │ └── L1.stl L2.stl L3.stl L4.stl L5.stl # CT bone meshes, each in its own CT space │ ├── transformation_matrices.txt # unused by the script, see "Raw file formats" │ └── recordings/ │ └── recording/ # r ∈ {0..39} │ ├── Poses_0.txt # ground-truth poses for camera 0, every video frame │ ├── Poses_1.txt # ground-truth poses for camera 1, every video frame │ └── Specimen__recording__cam__frame_.npz # c ∈ {0,1}, f ∈ {0..3} └── reconstructed/ # created by reconstruct_frames.py (not shipped) ├── index.csv # one row per (specimen, camera, recording, frame, level) └── Specimen_/ ├── index.csv ├── CT/L1.stl … L5.stl # copied from raw ├── camera_0/ │ └── recording_/ # rr ∈ {00..39} │ └── frame_/ │ ├── frame_camera_space.ply # full raw RGB-D frame, camera space, RGB │ ├── frame_camera_space_labels.npy # int8 label per point of the file above │ ├── poses_ct_to_camera.txt # 5 rows (L1..L5), p_camera = T @ p_ct │ ├── L1_camera_space.ply … L5_camera_space.ply # labelled points, camera space, RGB │ └── L1_ct_space.ply … L5_ct_space.ply # same points in the CT space of that level └── camera_1/ └── (identical layout) ``` ## Raw file formats (`raw/`) | File | Format | Content | |---|---|---| | `Specimen__recording__cam__frame_.npz` | NumPy `.npz`, key `arr_0`, float64 array of shape `(N, 7)` | Columns `x, y, z` (millimetres, camera space), `r, g, b` (in `[0, 1]`), `label` (`0` background, `1` to `5` = L1 to L5). One file per video frame `f` of camera `c`. | | `Poses_.txt` | text, 16 comma-separated floats per line | Poses for every video frame of camera `c`, 5 lines per frame in the order L1..L5. Line `5*f + (k-1)` is the 4×4 matrix `T` of vertebra L*k* at frame `f`, flattened row-major, with `p_camera = T @ p_ct`. The file covers the whole video, so it has many more frames than there are npz files. | | `STL/L.stl` | binary STL | CT-segmented bone surface of vertebra L*k*, in its own CT space. | | `transformation_matrices.txt` | text, 4 lines × 16 floats | Four 4×4 matrices carried over verbatim from the original preprocessing. The reconstruction script does not use them and their meaning is not documented here. | ## Reconstructed file formats (`reconstructed/`) | File | Format | Notes | |---|---|---| | `frame_camera_space.ply` | binary PLY, `double x y z`, `uchar red green blue` | Every point of the npz frame: bone, soft tissue, instruments, hands, background. Camera space. | | `frame_camera_space_labels.npy` | NumPy `int8`, shape `(N,)` | Same point order as the ply above. `0` = background, `1` to `5` = L1 to L5. | | `poses_ct_to_camera.txt` | 5 lines × 16 comma-separated floats | The five pose rows of this frame, copied from `Poses_.txt`. Line *k* = vertebra L*k*. | | `L_camera_space.ply` | binary PLY, as above | Points of the frame whose label equals *k*. Camera space. | | `L_ct_space.ply` | binary PLY, as above | `L_camera_space.ply` transformed by `inv(T_k)`. Overlays directly on `CT/L.stl`. | | `CT/L.stl` | binary STL | Copy of the raw mesh, stored once per specimen. | | `index.csv` | CSV | Columns: `specimen, camera, recording, frame, level, num_points_level, num_points_frame, camera_space_ply, ct_space_ply, ct_mesh`. Paths relative to `reconstructed/`. | ## Coordinate spaces | Space | Definition | Files | |---|---|---| | camera space | Optical frame of the ZED Mini that captured the frame. Millimetres. Each camera and each recording has its own camera space, because the cameras were repositioned before every pedicle screw. | npz `x y z`, `frame_camera_space.ply`, `L_camera_space.ply` | | CT space of vertebra L | Coordinate frame of `STL/L.stl`. Millimetres. Each vertebra has its own CT space. The five CT spaces of one specimen are not aligned with each other, because every vertebra was tracked by its own optical marker. | `L.stl`, `L_ct_space.ply` | For vertebra L in a given frame, `p_camera = T_k @ p_ct`, where `T_k` is the pose line of that vertebra (4×4 homogeneous). Equivalently `L_ct_space = inv(T_k) @ L_camera_space`. ## Provenance The data start from the original SpineDepth recordings (stereo RGB-D video tracked by an optical tracking system) and the CT bone models. 1. Frame export. The first four frames of each recording and camera were exported from the SVO videos as RGB-D point clouds in camera space. These are the npz files. 2. Poses. For every video frame and every vertebra, the pose `T_k` (CT to camera) comes from the optical tracker. Each vertebra carried its own marker, fixed with K-wires and calibrated to the CT in the original SpineDepth work. The poses are stored in `Poses_.txt`. 3. Vertebra labels. The label column was derived from the tracked CT models; no model predicts it. The labels behave like a projected silhouette mask: every point along a camera pixel that falls inside the rendered outline of vertebra L*k* receives label *k*. So points of instruments, hands or soft tissue in front of the bone, and depth outliers, can carry a bone label. Typical distances between labelled points and the CT surface are a few millimetres, with a tail up to about 2 cm. The script applies no 3D distance filtering, so you can choose your own cleaning step, for example keeping only points within 5 mm of the CT surface. 4. Reconstruction. `reconstruct_frames.py` splits each npz by label, writes the per-vertebra clouds in camera space, and transforms them by `inv(T_k)` into CT space. ### Recording protocol (from Liebmann et al., 2021) Each specimen received ten pedicle screws (L1 to L5, both sides). For every screw, four surgical steps were recorded separately: (1) entry point with a luer, (2) canal preparation with an awl, (3) canal integrity check with a K-wire, (4) screw placement. Both cameras were repositioned and recalibrated before every screw, so recordings `4n` to `4n+3` share a camera pose and the camera pose jumps between such groups. Within a specimen the vertebrae barely move relative to each other. For specimen 2, the relative poses of adjacent levels vary by less than 0.3 mm and 0.2° over the whole procedure. The absolute pose drifts by up to a few millimetres within a recording as the surgeon works on the bone. The per-frame poses account for all of this. ## Per-specimen overview | Specimen | Exposure (orig. paper) | Screw order (orig. paper) | Recordings with frames | Recording/camera pairs (of 80) | npz frames | Video frames per camera | |---|---|---|---|---|---|---| | 1 | Midline approach, soft tissue intact | L1–L5 | 4 | 4 | 16 | 11,278 | | 2 | Full exposure | L1–L3, L4–L5 | 40 | 80 | 320 | 18,194 | | 3 | Full exposure | L1–L2, L3–L5 (LLL, RRR) | 40 | 79 | 313 | 16,747 | | 4 | Full exposure | L1–L5 | 40 | 79 | 307 | 18,746 | | 5 | Full exposure | L1–L3, L4–L5 | 40 | 80 | 320 | 15,649 | | 6 | Full exposure | L3–L4, L4–L5, L1–L2 | 40 | 68 | 272 | 15,126 | | 7 | Full exposure | L4–L5, L1–L3 | 40 | 80 | 320 | 12,871 | | 8 | Full exposure | L2–L4, L4–L5, L1–L2 | 40 | 80 | 320 | 13,844 | | 9 | Full exposure | L1–L5 | 40 | 74 | 276 | 12,202 | | 10 | Full exposure | L4–L5, L1–L3 | 30 | 55 | 220 | 12,825 | | Total | | | | | 2,684 | 147,482 | "Recording/camera pairs" counts the recording and camera combinations that have at least one npz frame; a complete specimen has 40 × 2 = 80. Most pairs have 4 frames; a handful in specimens 3, 4 and 9 have 1 to 3. "Video frames per camera" is the number of frames in the full original videos (the length of `Poses_.txt` divided by 5). Screw-order groups are separated by commas. Previously inserted screws were removed before the next group unless they reappear in it. Specimen 1 was instrumented through a standard midline approach with the soft tissue left intact. Its bone surface is largely occluded and only four recordings were exported. Reconstruction output is about 12.5 MB per frame, roughly 4 GB per full specimen and about 34 GB for all ten. ## Usage ```python import numpy as np, open3d as o3d root = "reconstructed/Specimen_2" frame = f"{root}/camera_0/recording_00/frame_0" # CT <-> RGB-D registration of L3 (already in a common frame): ct = o3d.io.read_triangle_mesh(f"{root}/CT/L3.stl") rgbd = o3d.io.read_point_cloud(f"{frame}/L3_ct_space.ply") # Pose estimation: predict T from camera-space points, compare against ground truth pts = o3d.io.read_point_cloud(f"{frame}/L3_camera_space.ply") T_gt = np.loadtxt(f"{frame}/poses_ct_to_camera.txt", delimiter=",").reshape(5, 4, 4)[2] # L3 # Place the CT model into the camera-space scene ct_in_camera = o3d.io.read_triangle_mesh(f"{root}/CT/L3.stl").transform(T_gt) scene = o3d.io.read_point_cloud(f"{frame}/frame_camera_space.ply") labels = np.load(f"{frame}/frame_camera_space_labels.npy") # Or work directly on the raw npz without reconstructing: raw = np.load("raw/Specimen_2/recordings/recording0/Specimen_2_recording_0_cam_0_frame_0.npz")["arr_0"] xyz, rgb, label = raw[:, :3], raw[:, 3:6], raw[:, 6].astype(int) poses = np.loadtxt("raw/Specimen_2/recordings/recording0/Poses_0.txt", delimiter=",").reshape(-1, 5, 4, 4) T_L3_frame0 = poses[0, 2] ``` ## License Released under CC BY-NC 4.0, following the original SpineDepth dataset. ## Citation If you use this dataset, please cite our work and the original SpineDepth paper: ```bibtex @article{wu2026neuralbonereg, title = {NeuralBoneReg: An instance-specific label-free point cloud-based method for multi-modal bone surface registration}, author = {Wu, Luohong and Seibold, Matthias and Cavalcanti, Nicola A. and Ao, Yunke and Flepp, Roman and Massalimova, Aidana and Calvet, Lilian and F{\"u}rnstahl, Philipp}, journal = {Medical Image Analysis}, year = {2026}, doi = {10.1016/j.media.2026.104133} } @article{liebmann2021spinedepth, title = {{SpineDepth}: A Multi-Modal Data Collection Approach for Automatic Labelling and Intraoperative Spinal Shape Reconstruction Based on {RGB-D} Data}, author = {Liebmann, Florentin and St{\"u}tz, Dominik and Suter, Daniel and Jecklin, Sascha and Snedeker, Jess G. and Farshad, Mazda and F{\"u}rnstahl, Philipp and Esfandiari, Hooman}, journal = {Journal of Imaging}, volume = {7}, number = {9}, pages = {164}, year = {2021}, doi = {10.3390/jimaging7090164} } ```