|
Download README.md from luohwu/SpineDepth_perframe: direct link, hf CLI and curl.
- Browser
- Download file 14.7 kB
-
https://huggingface.co/datasets/luohwu/SpineDepth_perframe/resolve/main/README.md
- Command line
-
hf download hf://datasets/luohwu/SpineDepth_perframe/README.md
-
curl -L -o README.md https://huggingface.co/datasets/luohwu/SpineDepth_perframe/resolve/main/README.md
14.7 kB
| 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<n<10K | |
| # SpineDepth per-frame: raw RGB-D frames, CT meshes and per-frame ground-truth poses | |
| This is a frame-wise release of the SpineDepth dataset (Liebmann et al., 2021) for CT to | |
| intraoperative RGB-D registration and vertebra pose estimation. It contains the raw per-frame | |
| data: RGB-D point clouds with a vertebra label on every point, the CT bone meshes, and the | |
| optical-tracking pose of every vertebra in every frame. A small script turns the raw data into | |
| per-vertebra point clouds in camera space and in CT space. | |
| ## How this differs from SpineDepth_segmented | |
| Our earlier release, | |
| [`luohwu/SpineDepth_segmented`](https://huggingface.co/datasets/luohwu/SpineDepth_segmented), | |
| contains merged point clouds. All tracked frames of a camera were fused into one downsampled | |
| CT-space cloud per vertebra, so each vertebra has two clouds, one per camera. It is a static | |
| registration set with no per-frame information. | |
| This release keeps every RGB-D frame as its own point cloud. The frames are consecutive frames | |
| of the original 30 Hz recordings. Each frame comes with the full raw scene in camera space, a | |
| vertebra label per point, and the pose of every vertebra in that frame. Nothing is fused, filtered | |
| or downsampled. Use SpineDepth_segmented for clean CT to RGB-D surface registration. Use this | |
| dataset when you need single depth frames, short temporal sequences, per-frame poses, the | |
| surrounding scene, or the raw sensor noise. | |
| Fully reconstructed per-frame files are large, so we ship the compact raw data together with the | |
| reconstruction script instead of prebuilt point clouds. Reconstructing one specimen takes a few | |
| minutes on a desktop machine. | |
| ## Quick start | |
| You need Python 3.8 or newer with numpy and open3d 0.15 or newer. The script finds `raw/` and | |
| writes `reconstructed/` relative to its own location, so the folder can be unpacked anywhere and | |
| no paths need editing. Run it from any working directory. | |
| ```bash | |
| pip install -r requirements.txt | |
| python reconstruct_frames.py # reconstructs specimen 2 (default) into ./reconstructed | |
| python reconstruct_frames.py --specimen 7 # one specimen (1..10) | |
| python reconstruct_frames.py --specimen all # all ten specimens (~35 GB, ~20 min with 12 workers) | |
| python reconstruct_frames.py --specimen 3 --workers 8 --out-root /some/other/folder | |
| ``` | |
| ## Dataset summary | |
| - 10 cadaveric specimens (IDs `1` to `10`), lumbar levels L1 to L5. | |
| - 50 CT bone meshes (`.stl`), one per specimen and level. | |
| - 2 RGB-D cameras (Stereolabs ZED Mini, 1920×1080, 30 Hz) per recording, 40 recordings per | |
| specimen (10 pedicle screws × 4 surgical steps). | |
| - Per frame: an RGB-D point cloud in camera space with a vertebra label on every point, and the | |
| pose of each of the five vertebrae (CT to camera). | |
| - Frames per recording and camera: 4 consecutive frames (`frame_0` to `frame_3`, the first four | |
| frames of each video). A few recording and camera pairs have fewer or no frames; see the | |
| per-specimen overview below. The full videos, several hundred frames per recording, are | |
| available as SVO files from the original SpineDepth release. | |
| ## Directory structure | |
| ``` | |
| SpineDepth_perframe/ | |
| ├── README.md | |
| ├── requirements.txt | |
| ├── reconstruct_frames.py # builds ./reconstructed from ./raw | |
| ├── raw/ # shipped | |
| │ └── Specimen_<s>/ # 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>/ # 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_<s>_recording_<r>_cam_<c>_frame_<f>.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_<s>/ | |
| ├── index.csv | |
| ├── CT/L1.stl … L5.stl # copied from raw | |
| ├── camera_0/ | |
| │ └── recording_<rr>/ # rr ∈ {00..39} | |
| │ └── frame_<f>/ | |
| │ ├── 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_<s>_recording_<r>_cam_<c>_frame_<f>.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_<c>.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<k>.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_<c>.txt`. Line *k* = vertebra L*k*. | | |
| | `L<k>_camera_space.ply` | binary PLY, as above | Points of the frame whose label equals *k*. Camera space. | | |
| | `L<k>_ct_space.ply` | binary PLY, as above | `L<k>_camera_space.ply` transformed by `inv(T_k)`. Overlays directly on `CT/L<k>.stl`. | | |
| | `CT/L<k>.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<k>_camera_space.ply` | | |
| | CT space of vertebra L<k> | Coordinate frame of `STL/L<k>.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<k>.stl`, `L<k>_ct_space.ply` | | |
| For vertebra L<k> 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<k>_ct_space = inv(T_k) @ L<k>_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_<c>.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_<c>.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} | |
| } | |
| ``` | |