Centerline Data Structure
Centerlines define the path and orientation for CPR reconstruction. Each centerline consists of position coordinates and orientation matrices that describe how to unfold the curved structure.Basic Structure
name
(string) - Identifier for the centerline (e.g., “Aorta”, “Spine”, “Pulmonary Artery”)seriesIndex
(number) - Which image series this centerline belongs to (0-based index)centerline
(object) - Contains the position and orientation data
Position Data
The position array contains 3D coordinates that define the centerline path through the anatomical structure. Format: Flattened array of coordinates[x1, y1, z1, x2, y2, z2, x3, y3, z3, ...]
Coordinates must be in the same world/model space as your image volume. There
is no automatic unit conversion, so ensure your centerline coordinates match
the coordinate system of your medical images (typically millimeters for
medical imaging).
Orientation Data
The orientation array contains 4x4 transformation matrices that define the local coordinate system at each point along the centerline. Format: Flattened array of 4x4 matrices[m11, m12, m13, m14, m21, m22, ..., m44]
for each point
The number of orientation matrices should match the number of position points.
If you have N position points (length = 3N), you should have N orientation
matrices (length = 16N).
Uploading Centerline Data
The RedBrick viewer requires centerline data to be provided as inline JSON objects withposition
and orientation
arrays. You must include the complete centerline data directly in your task JSON.
Inline Centerline Data (Required Format)
Include the centerline data directly in your task JSON with the completeposition
and orientation
arrays:
You can include multiple centerlines per task, each with a unique name. This
is useful when visualizing multiple anatomical structures in the same scan.
The RedBrick viewer expects the
centerline
field to contain a parsed JSON
object with position
and orientation
arrays. URL strings in the
centerline
field are not automatically fetched or resolved by the viewer.Uploading via CLI
Once you’ve prepared your task JSON file with centerline data, upload it using the RedBrick CLI. Step 1: Save your task JSON to a file (e.g.,cpr_tasks.json
)
Step 2: Run the upload command:
Make sure you have the RedBrick SDK installed and configured. See
Installation and API Keys for setup
instructions.
Important Considerations
Series Index
TheseriesIndex
property indicates which image series in your task the centerline belongs to.
Always explicitly set
seriesIndex
in your task JSON. While the viewer may
default missing values to 0
during study setup, uploads via API/SDK require
this field to be specified.- Use
0
for the first (or only) series in your task - Use
1
,2
, etc. for subsequent series if you have multiple series per task - Multiple centerlines can reference the same
seriesIndex
Multiple Centerlines
You can include multiple centerlines for a single series, and the viewer will make them all available for CPR visualization:- Each centerline must have a unique
name
for identification - Common examples include: “Aorta”, “Pulmonary Artery”, “Spine”, “Airways”, “LAD”, “RCA”
- Users can select which centerline to visualize in the CPR view
Data Requirements
To ensure proper CPR rendering, your centerline data should follow these guidelines:Position Array
The position array length should be divisible by 3 to represent complete 3D points: Valid:[1, 2, 3, 4, 5, 6]
(2 complete points)
Invalid: [1, 2, 3, 4, 5]
(incomplete point - missing z coordinate)
Malformed position arrays may result in incorrect CPR rendering or missing
visualizations.
Orientation Array
The orientation array length should be divisible by 16 to represent complete 4x4 matrices: Valid:[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
(1 complete matrix)
Invalid: [1, 0, 0, 0, 0, 1, 0, 0]
(incomplete matrix - only 8 values)
Matching Counts
The number of orientation matrices should match the number of position points for proper CPR reconstruction.If position length = 3N (N points), orientation length should = 16N (N
matrices). Mismatches may cause rendering issues.
- 5 position points → position length = 15, orientation length should = 80
- 10 position points → position length = 30, orientation length should = 160
Numeric Values
- All values should be valid numbers (avoid
NaN
orInfinity
) - Position coordinates must match the world/model space of your image volume
- Orientation matrices should be valid 4x4 transformation matrices
Troubleshooting
Common Issues and Solutions
CPR view not rendering
If the CPR view doesn’t appear or renders incorrectly, check the following: Centerline format:- Ensure the
centerline
field contains a JSON object withposition
andorientation
arrays, not a URL string - Verify arrays are properly formatted (not empty or malformed)
Incomplete or malformed position data
Issue: CPR view renders incorrectly or shows artifacts Solution: Verify position array has complete 3D coordinates:Mismatched array lengths
Issue: CPR reconstruction appears distorted or incomplete Solution: Ensure you have one 4x4 orientation matrix (16 values) for each position point:Series index issues
Issue: CPR view doesn’t display for the correct image series Solution: VerifyseriesIndex
corresponds to an existing image series:
Coordinate space mismatch
Issue: CPR view shows the wrong anatomical region or appears offset Solution: Ensure centerline coordinates are in the same world/model space as your image volume. Check that:- Units match (typically millimeters for medical imaging)
- Origin and coordinate system match your image data
- There’s no mismatch between RAS/LPS coordinate conventions