Skip to content

Turn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 250,000+ scientists worldwide. 177 ready-to-use validated skills plus 100+ scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Pi, Antigravity, and the open Agent Skills standard.

update imaging-data-commons skill to 1.5.0

Andrey Fedorov002d766225e9
diff --git a/scientific-skills/imaging-data-commons/SKILL.md b/scientific-skills/imaging-data-commons/SKILL.md
index ef55896c..1ec5ad7c 100644
--- a/scientific-skills/imaging-data-commons/SKILL.md
+++ b/scientific-skills/imaging-data-commons/SKILL.md
@@ -3,9 +3,9 @@ name: imaging-data-commons
description: Query and download public cancer imaging data from NCI Imaging Data Commons using idc-index. Use for accessing large-scale radiology (CT, MR, PET) and pathology datasets for AI training or research. No authentication required. Query by metadata, visualize in browser, check licenses.
license: This skill is provided under the MIT License. IDC data itself has individual licensing (mostly CC-BY, some CC-NC) that must be respected when using the data.
metadata:
- version: 1.3.1
+ version: 1.4.0
skill-author: Andrey Fedorov, @fedorov
- idc-index: "0.11.9"
+ idc-index: "0.11.14"
idc-data-version: "v23"
repository: https://github.com/ImagingDataCommons/idc-claude-skill
---
@@ -25,7 +25,7 @@ Use the `idc-index` Python package to query and download public cancer imaging d
```python
import idc_index
-REQUIRED_VERSION = "0.11.9" # Must match metadata.idc-index in this file
+REQUIRED_VERSION = "0.11.14" # Must match metadata.idc-index in this file
installed = idc_index.__version__
if installed < REQUIRED_VERSION:
@@ -97,6 +97,7 @@ print(stats)
| `digital_pathology_guide.md` | Slide microscopy (SM), annotations (ANN), pathology workflows |
| `bigquery_guide.md` | Full DICOM metadata, private elements (requires GCP) |
| `cli_guide.md` | Command-line tools (`idc download`, manifest files) |
+| `parquet_access_guide.md` | Direct Parquet queries via GCS (no idc-index install needed) |
## IDC Data Model
@@ -138,6 +139,8 @@ The `idc-index` package provides multiple metadata index tables, accessible via
| `ann_index` | 1 row = 1 DICOM ANN series | fetch_index() | Microscopy Bulk Simple Annotations series metadata; references annotated image series |
| `ann_group_index` | 1 row = 1 annotation group | fetch_index() | Detailed annotation group metadata: graphic type, annotation count, property codes, algorithm |
| `contrast_index` | 1 row = 1 series with contrast info | fetch_index() | Contrast agent metadata: agent name, ingredient, administration route (CT, MR, PT, XA, RF) |
+| `volume_geometry_index` | 1 row = 1 CT/MR/PT series | fetch_index() | 3D volume geometry validation for single-frame CT, MR, and PT series; boolean checks for orientation, spacing, dimensions, and slice positions; composite `regularly_spaced_3d_volume` flag |
+| `rtstruct_index` | 1 row = 1 RTSTRUCT series | fetch_index() | RT Structure Set metadata: total ROI count, ROI names, generation algorithms, interpreted types, and the referenced image series UID |
**Auto** = loaded automatically when `IDCClient()` is instantiated
**fetch_index()** = requires `client.fetch_index("table_name")` to load
@@ -159,6 +162,8 @@ The `idc-index` package provides multiple metadata index tables, accessible via
| `SeriesInstanceUID` | index, seg_index, ann_index, ann_group_index, contrast_index | Link segmentation/annotation/contrast series to its index metadata |
| `segmented_SeriesInstanceUID` | seg_index → index | Link segmentation to its source image series (join seg_index.segmented_SeriesInstanceUID = index.SeriesInstanceUID) |
| `referenced_SeriesInstanceUID` | ann_index → index | Link annotation to its source image series (join ann_index.referenced_SeriesInstanceUID = index.SeriesInstanceUID) |
+| `SeriesInstanceUID` | index, volume_geometry_index | Link series to its 3D geometry validation result (join index.SeriesInstanceUID = volume_geometry_index.SeriesInstanceUID) |
+| `SeriesInstanceUID` / `referenced_SeriesInstanceUID` | index, rtstruct_index | Join RTSTRUCT series to its metadata (index.SeriesInstanceUID = rtstruct_index.SeriesInstanceUID); use rtstruct_index.referenced_SeriesInstanceUID to find the source image series |
**Note:** `Subjects`, `Updated`, and `Description` appear in multiple tables but have different meanings (counts vs identifiers, different update contexts).
@@ -184,6 +189,7 @@ See `references/clinical_data_guide.md` for detailed workflows including value m
| Method | Auth Required | Best For |
|--------|---------------|----------|
| `idc-index` | No | Key queries and downloads (recommended) |
+| Direct Parquet (GCS) | No | Quick queries without installing idc-index; always uses latest data |
| IDC Portal | No | Interactive exploration, manual selection, browser-based download |
| BigQuery | Yes (GCP account) | Complex queries, full DICOM metadata |
| DICOMweb proxy | No | Tool integration via DICOMweb API |
@@ -214,6 +220,12 @@ IDC data is available via DICOMweb interface (Google Cloud Healthcare API implem
See `references/dicomweb_guide.md` for endpoint URLs, code examples, supported operations, and implementation details.
+**Direct Parquet access**
+
+All idc-index metadata tables are published as Parquet files to a public GCS bucket (`idc-index-data-artifacts`) with unrestricted CORS. This enables DuckDB or pandas queries without installing idc-index, including cross-table joins and queries against `volume_geometry_index` and `rtstruct_index`.
+
+See `references/parquet_access_guide.md` for URL patterns, available files, and DuckDB query examples.
+
## Installation and Setup
**Required (for basic access):**
@@ -229,7 +241,7 @@ print(client.get_idc_version()) # Should return "v23"
```
If you see an older version, upgrade with: `pip install --upgrade idc-index`
-**Tested with:** idc-index 0.11.9 (IDC data version v23)
+**Tested with:** idc-index 0.11.14 (IDC data version v23)
**Optional (for data analysis):**
```bash
@@ -649,6 +661,13 @@ See `references/bigquery_guide.md` for setup, table schemas, query patterns, pri
Common specialized indices: `seg_index` (segmentations), `ann_index` / `ann_group_index` (microscopy annotations), `sm_index` (slide microscopy), `collections_index` (collection metadata). Only use BigQuery if you need private DICOM elements or attributes not in any index.
+**Use cases that require BigQuery (no idc-index equivalent):**
+- **Per-segment anatomy search** — `seg_index` gives series-level SEG metadata, but the BigQuery `segmentations` table exposes each segment individually with its DICOM coded structure name (e.g., find all SEG series containing a "Liver" or "Neoplasm" segment)
+- **Quantitative measurements from SR** — the `quantitative_measurements` BigQuery table contains pre-extracted radiomics features (volume, diameter, shape descriptors, texture, intensity statistics) from DICOM SR TID1500 objects; no idc-index equivalent
+- **Qualitative measurements from SR** — the `qualitative_measurements` BigQuery table contains coded assessments (malignancy rating, calcification, texture, margin) from DICOM SR TID1500; no idc-index equivalent
+
+See `references/bigquery_guide.md` for schemas, column descriptions, and query examples for these tables.
+
### 8. Tool Selection Guide
| Task | Tool | Reference |
diff --git a/scientific-skills/imaging-data-commons/references/bigquery_guide.md b/scientific-skills/imaging-data-commons/references/bigquery_guide.md
index 77cdfa69..e4923f1c 100644
--- a/scientific-skills/imaging-data-commons/references/bigquery_guide.md
+++ b/scientific-skills/imaging-data-commons/references/bigquery_guide.md
@@ -25,6 +25,9 @@ Use BigQuery instead of `idc-index` when you need:
- DICOM sequence attributes (nested structures)
- Queries on fields not in the idc-index mini-index
- Private DICOM elements (vendor-specific tags in OtherElements column)
+- **Per-segment detail from DICOM Segmentation objects** — `idc-index` `seg_index` gives series-level metadata, but not individual segment anatomy codes; use `segmentations` BigQuery table to query by structure name
+- **Quantitative measurements from DICOM SR** — radiomics features (volume, diameter, shape descriptors) without downloading and parsing SR files; no idc-index equivalent
+- **Qualitative measurements from DICOM SR** — coded evaluations (malignancy rating, texture, margin) without parsing SR files; no idc-index equivalent
## Accessing IDC in BigQuery
@@ -67,16 +70,17 @@ LIMIT 10
### Derived Tables
-**segmentations** - DICOM Segmentation objects
-```sql
-SELECT *
-FROM `bigquery-public-data.idc_current.segmentations`
-LIMIT 10
-```
+These tables are derived from DICOM objects (Segmentation and Structured Report) and have **no equivalent in idc-index**. Use them to query per-segment anatomy, radiomics features, and qualitative assessments without downloading DICOM files.
+
+**segmentations** — one row per segment within a DICOM SEG object. Lets you search by anatomical structure name or DICOM coded concept. The `idc-index` `seg_index` gives series-level metadata; this table gives per-segment detail.
+
+**measurement_groups** — one row per SR TID1500 measurement group. The parent grouping for quantitative and qualitative measurements; links measurements to segmentations and source images.
+
+**quantitative_measurements** — one row per numeric measurement within an SR TID1500 group. Contains radiomics features (volume, diameter, shape descriptors, texture) extracted from DICOM SR without downloading or parsing SR files.
-**measurement_groups** - SR TID1500 measurement groups
-**qualitative_measurements** - Coded evaluations
-**quantitative_measurements** - Numeric measurements
+**qualitative_measurements** — one row per coded evaluation within an SR TID1500 group. Contains assessed findings (malignancy likelihood, texture, margin type) using coded concept values.
+
+See the [Derived Tables: Detailed Documentation](#derived-tables-detailed-documentation) section below for schemas, column descriptions, and query examples.
### Collection Metadata
@@ -165,6 +169,304 @@ WHERE src.collection_id = 'qin_prostate_repeatability'
LIMIT 10
```
+## Derived Tables: Detailed Documentation
+
+### segmentations
+
+One row per segment within a DICOM Segmentation (SEG) object. Unlike `idc-index` `seg_index` (one row per SEG series), this table exposes each labeled region individually so you can search by anatomical structure or finding type.
+
+**Key columns:**
+
+| Column | Type | Description |
+|--------|------|-------------|
+| `SeriesInstanceUID` | STRING | SEG series UID |
+| `SOPInstanceUID` | STRING | SEG instance UID |
+| `PatientID` | STRING | Patient identifier |
+| `StudyInstanceUID` | STRING | Study UID |
+| `SegmentNumber` | INTEGER | Segment index within the SEG (starting from 1) |
+| `SegmentedPropertyCategory` | RECORD | Coded category (e.g., "Anatomical Structure", "Morphologically Altered Structure") |
+| `SegmentedPropertyType` | RECORD | Specific structure (e.g., "Liver", "Kidney", "Neoplasm") |
+| `AnatomicRegion` | RECORD | Optional anatomic region modifier |
+| `SegmentAlgorithmType` | STRING | AUTOMATIC, SEMIAUTOMATIC, or MANUAL |
+| `SegmentAlgorithmName` | STRING (REPEATED) | Algorithm name array (e.g., ["TotalSegmentator"]) |
+| `TrackingUID` | STRING | Links segment to SR measurements |
+| `TrackingID` | STRING | Human-readable tracking label |
+| `segmented_SeriesInstanceUID` | STRING | Source image series UID — join to `dicom_all` to get collection/modality |
+| `viewer_url` | STRING | Direct IDC viewer link for the SEG |
+
+`SegmentedPropertyCategory` and `SegmentedPropertyType` are RECORD types with sub-fields `CodeValue`, `CodingSchemeDesignator`, and `CodeMeaning`. Use `.CodeMeaning` for human-readable filtering.
+
+**idc-index gap:** `seg_index` in idc-index has `total_segments`, `AlgorithmName`, and aggregated codes, but does not expose individual segment anatomy per row. Use this BigQuery table when you need to find SEG series that contain a specific structure (e.g., all series with a "Liver" segment).
+
+**Discover what structures are segmented across IDC:**
+
+```sql
+SELECT
+ SegmentedPropertyCategory.CodeMeaning AS category,
+ SegmentedPropertyType.CodeMeaning AS structure,
+ SegmentAlgorithmType,
+ COUNT(DISTINCT SeriesInstanceUID) AS seg_series_count
+FROM `bigquery-public-data.idc_current.segmentations`
+GROUP BY 1, 2, 3
+ORDER BY seg_series_count DESC
+LIMIT 20
+```
+
+**Find all SEG series containing a specific structure, with source image context:**
+
+```sql
+SELECT
+ seg.SeriesInstanceUID AS seg_series,
+ seg.SegmentNumber,
+ seg.SegmentedPropertyType.CodeMeaning AS structure,
+ seg.SegmentAlgorithmType,
+ seg.SegmentAlgorithmName,
+ img.collection_id,
+ img.PatientID,
+ img.Modality,
+ seg.viewer_url
+FROM `bigquery-public-data.idc_current.segmentations` seg
+JOIN `bigquery-public-data.idc_current.dicom_all` img
+ ON seg.segmented_SeriesInstanceUID = img.SeriesInstanceUID
+WHERE seg.SegmentedPropertyType.CodeMeaning = 'Liver'
+ AND seg.SegmentAlgorithmType = 'AUTOMATIC'
+LIMIT 20
+```
+
+**Find all segment types present in a collection:**
+
+```sql
+SELECT
+ seg.SegmentedPropertyType.CodeMeaning AS structure,
+ seg.SegmentAlgorithmType,
+ COUNT(DISTINCT seg.SeriesInstanceUID) AS seg_series_count
+FROM `bigquery-public-data.idc_current.segmentations` seg
+JOIN `bigquery-public-data.idc_current.dicom_all` img
+ ON seg.segmented_SeriesInstanceUID = img.SeriesInstanceUID
+WHERE img.collection_id = 'nlst'
+GROUP BY 1, 2
+ORDER BY seg_series_count DESC
+```
+
+**Link segments to SR measurements using TrackingUID:**
+
+```sql
+-- Find segments that have corresponding SR measurements
+SELECT
+ seg.SeriesInstanceUID AS seg_series,
+ seg.SegmentNumber,
+ seg.SegmentedPropertyType.CodeMeaning AS structure,
+ qm.Quantity.CodeMeaning AS measurement,
+ ROUND(CAST(qm.Value AS FLOAT64), 2) AS value,
+ qm.Units.CodeMeaning AS units
+FROM `bigquery-public-data.idc_current.segmentations` seg
+JOIN `bigquery-public-data.idc_current.quantitative_measurements` qm
+ ON seg.SeriesInstanceUID = qm.segmentationSeriesUID
+ AND seg.SegmentNumber = qm.segmentationSegmentNumber
+WHERE seg.SegmentedPropertyType.CodeMeaning = 'Neoplasm'
+ AND qm.Quantity.CodeMeaning = 'Volume from Voxel Summation'
+LIMIT 10
+```
+
+---
+
+### quantitative_measurements
+
+One row per numeric measurement in a DICOM SR TID1500 Measurement Report. Contains radiomics features (shape, intensity, texture) and clinical measurements (volume, diameter, SUV). These measurements are pre-extracted from SR — no download or DICOM parsing needed.
+
+**No idc-index equivalent.** This table is only accessible via BigQuery.
+
+**Key columns:**
+
+| Column | Type | Description |
+|--------|------|-------------|
+| `SOPInstanceUID` | STRING | SR instance UID |
+| `SeriesInstanceUID` | STRING | SR series UID — join to `dicom_all` for collection/modality |
+| `SeriesDescription` | STRING | SR series description (e.g., "TotalSegmentator(v1.5.6) shape Measurements") |
+| `PatientID` | STRING | Patient identifier |
+| `measurementGroup_number` | INTEGER | Group index within the SR (0-based); join key with `measurement_groups` and `qualitative_measurements` |
+| `Quantity` | RECORD | What was measured — `CodeValue`, `CodingSchemeDesignator`, `CodeMeaning` (e.g., "Volume from Voxel Summation") |
+| `Value` | NUMERIC | The numeric measurement value |
+| `Units` | RECORD | Units — `CodeMeaning` (e.g., "cubic millimeter", "no units", "Hounsfield Unit") |
+| `derivationModifier` | RECORD | How the value was derived (e.g., "Mean", "Minimum", "Maximum") |
+| `lateralityModifier` | RECORD | Laterality qualifier |
+| `finding` | RECORD | What finding was measured — `CodeMeaning` (e.g., "Nodule", "Organ", "Anatomical Structure") |
+| `findingSite` | RECORD | Where the finding is — `CodeMeaning` (e.g., "Liver", "Esophagus", "Lung") |
+| `trackingIdentifier` | STRING | Human-readable tracking label (e.g., "Nodule 1", "Measurements group 26") |
+| `trackingUniqueIdentifier` | STRING | Tracking UID — links back to `segmentations.TrackingUID` |
+| `segmentationInstanceUID` | STRING | SOPInstanceUID of the referenced SEG object |
+| `segmentationSeriesUID` | STRING | SeriesInstanceUID of the referenced SEG object |
+| `segmentationSegmentNumber` | INTEGER | Segment number within the SEG — join to `segmentations.SegmentNumber` |
+| `sourceSegmentedSeriesUID` | STRING | Source image series — join to `dicom_all.SeriesInstanceUID` |
+
+**Discover available measurement types:**
+
+```sql
+SELECT
+ Quantity.CodeMeaning AS measurement,
+ Units.CodeMeaning AS units,
+ COUNT(*) AS measurement_count,
+ COUNT(DISTINCT SeriesInstanceUID) AS sr_series_count
+FROM `bigquery-public-data.idc_current.quantitative_measurements`
+GROUP BY 1, 2
+ORDER BY measurement_count DESC
+LIMIT 20
+```
+
+**Query measurements for a specific structure (e.g., liver volume across collections):**
+
+```sql
+SELECT
+ qm.PatientID,
+ ROUND(CAST(qm.Value AS FLOAT64) / 1000, 1) AS volume_cm3,
+ img.collection_id,
+ qm.segmentationSeriesUID
+FROM `bigquery-public-data.idc_current.quantitative_measurements` qm
+JOIN `bigquery-public-data.idc_current.dicom_all` img
+ ON qm.sourceSegmentedSeriesUID = img.SeriesInstanceUID
+WHERE qm.Quantity.CodeMeaning = 'Volume from Voxel Summation'
+ AND qm.findingSite.CodeMeaning = 'Liver'
+ORDER BY volume_cm3 DESC
+LIMIT 20
+```
+
+**Retrieve all measurements for a specific patient and finding:**
+
+```sql
+SELECT
+ qm.measurementGroup_number,
+ qm.finding.CodeMeaning AS finding,
+ qm.findingSite.CodeMeaning AS finding_site,
+ qm.lateralityModifier.CodeMeaning AS laterality,
+ qm.Quantity.CodeMeaning AS feature,
+ ROUND(CAST(qm.Value AS FLOAT64), 3) AS value,
+ qm.Units.CodeMeaning AS units
+FROM `bigquery-public-data.idc_current.quantitative_measurements` qm
+WHERE qm.PatientID = 'LIDC-IDRI-0001'
+ AND qm.finding.CodeMeaning = 'Nodule'
+ORDER BY qm.measurementGroup_number, qm.Quantity.CodeMeaning
+```
+
+---
+
+### qualitative_measurements
+
+One row per coded evaluation in a DICOM SR TID1500 Measurement Report. Instead of numeric values, these record assessed characteristics using coded concept pairs (e.g., Quantity="Malignancy", Value="4 out of 5 (Moderately Suspicious for Cancer)").
+
+**No idc-index equivalent.** This table is only accessible via BigQuery.
+
+**Key columns:**
+
+| Column | Type | Description |
+|--------|------|-------------|
+| `SOPInstanceUID` | STRING | SR instance UID |
+| `SeriesInstanceUID` | STRING | SR series UID — join to `dicom_all` for collection/modality |
+| `PatientID` | STRING | Patient identifier |
+| `measurementGroup_number` | INTEGER | Group index within the SR — join key with `quantitative_measurements` |
+| `Quantity` | RECORD | What was assessed — `CodeMeaning` (e.g., "Malignancy", "Calcification", "Texture") |
+| `Value` | RECORD | The coded answer — `CodeMeaning` (e.g., "4 out of 5 (Moderately Suspicious for Cancer)") |
+| `finding` | RECORD | What finding was assessed — `CodeMeaning` (e.g., "Nodule") |
+| `findingSite` | RECORD | Anatomic site — `CodeMeaning` (e.g., "Lung") |
+| `trackingIdentifier` | STRING | Human-readable tracking label |
+| `segmentationInstanceUID` | STRING | SOPInstanceUID of the referenced SEG object |
+| `segmentationSeriesUID` | STRING | SeriesInstanceUID of the referenced SEG object |
+| `segmentationSegmentNumber` | INTEGER | Segment number within the referenced SEG |
+| `sourceSegmentedSeriesUID` | STRING | Source image series — join to `dicom_all.SeriesInstanceUID` |
+
+**Discover available qualitative features and their values:**
+
+```sql
+SELECT
+ Quantity.CodeMeaning AS feature,
+ Value.CodeMeaning AS assessed_value,
+ finding.CodeMeaning AS finding,
+ COUNT(*) AS count
+FROM `bigquery-public-data.idc_current.qualitative_measurements`
+GROUP BY 1, 2, 3
+ORDER BY count DESC
+LIMIT 20
+```
+
+**Find all nodules with a specific malignancy rating:**
+
+```sql
+SELECT
+ qm.PatientID,
+ qm.trackingIdentifier AS nodule_id,
+ qm.Value.CodeMeaning AS malignancy_rating,
+ img.collection_id
+FROM `bigquery-public-data.idc_current.qualitative_measurements` qm
+JOIN `bigquery-public-data.idc_current.dicom_all` img
+ ON qm.SeriesInstanceUID = img.SeriesInstanceUID
+WHERE qm.Quantity.CodeMeaning = 'Malignancy'
+ AND qm.Value.CodeMeaning LIKE '%Suspicious%'
+ORDER BY qm.PatientID
+LIMIT 20
+```
+
+---
+
+### measurement_groups
+
+The parent table for TID1500 measurement groups. Each row represents one measurement group within an SR, with references to the segmentation and source image but without the individual measurement values. Use this table when you need to enumerate groups or check what was tracked, without pulling all measurement values.
+
+**Key columns:** `SOPInstanceUID`, `SeriesInstanceUID`, `PatientID`, `measurementGroup_number`, `trackingIdentifier`, `trackingUniqueIdentifier`, `finding`, `findingSite`, `segmentationInstanceUID`, `segmentationSeriesUID`, `segmentationSegmentNumber`, `sourceSegmentedSeriesUID`, `contentSequence` (raw SR content sequence).
+
+In most workflows, join `quantitative_measurements` and `qualitative_measurements` directly using `SOPInstanceUID` + `measurementGroup_number` rather than going through `measurement_groups`.
+
+---
+
+### Combining quantitative and qualitative measurements
+
+The primary use case requiring both tables: correlate numeric features (volume, diameter) with coded assessments (malignancy, texture) for the same finding. Join on `SOPInstanceUID` + `measurementGroup_number`.
+
+**Example: LIDC-IDRI lung nodule analysis — malignancy rating with volume and diameter:**
+
+```sql
+SELECT
+ qual.PatientID,
+ qual.trackingIdentifier AS nodule_id,
+ qual.Value.CodeMeaning AS malignancy_rating,
+ ROUND(CAST(vol.Value AS FLOAT64), 1) AS volume_mm3,
+ ROUND(CAST(diam.Value AS FLOAT64), 1) AS diameter_mm
+FROM `bigquery-public-data.idc_current.qualitative_measurements` qual
+JOIN `bigquery-public-data.idc_current.quantitative_measurements` vol
+ ON qual.SOPInstanceUID = vol.SOPInstanceUID
+ AND qual.measurementGroup_number = vol.measurementGroup_number
+JOIN `bigquery-public-data.idc_current.quantitative_measurements` diam
+ ON qual.SOPInstanceUID = diam.SOPInstanceUID
+ AND qual.measurementGroup_number = diam.measurementGroup_number
+WHERE qual.Quantity.CodeMeaning = 'Malignancy'
+ AND vol.Quantity.CodeMeaning = 'Volume'
+ AND diam.Quantity.CodeMeaning = 'Diameter'
+ORDER BY qual.PatientID, qual.trackingIdentifier
+LIMIT 20
+```
+
+**Joining all three derived tables to get full segment context:**
+
+```sql
+SELECT
+ seg.SegmentedPropertyType.CodeMeaning AS structure,
+ qual.Quantity.CodeMeaning AS qualitative_feature,
+ qual.Value.CodeMeaning AS qualitative_value,
+ qm.Quantity.CodeMeaning AS quantitative_feature,
+ ROUND(CAST(qm.Value AS FLOAT64), 3) AS numeric_value,
+ qm.Units.CodeMeaning AS units,
+ img.collection_id
+FROM `bigquery-public-data.idc_current.segmentations` seg
+JOIN `bigquery-public-data.idc_current.qualitative_measurements` qual
+ ON seg.SeriesInstanceUID = qual.segmentationSeriesUID
+ AND seg.SegmentNumber = qual.segmentationSegmentNumber
+JOIN `bigquery-public-data.idc_current.quantitative_measurements` qm
+ ON qual.SOPInstanceUID = qm.SOPInstanceUID
+ AND qual.measurementGroup_number = qm.measurementGroup_number
+JOIN `bigquery-public-data.idc_current.dicom_all` img
+ ON seg.segmented_SeriesInstanceUID = img.SeriesInstanceUID
+WHERE seg.SegmentedPropertyType.CodeMeaning = 'Neoplasm'
+LIMIT 10
+```
+
## Private DICOM Elements
Private DICOM elements are vendor-specific attributes not defined in the DICOM standard. They often contain essential acquisition parameters (like diffusion b-values, gradient directions, or scanner-specific settings) that are critical for image interpretation and analysis.
diff --git a/scientific-skills/imaging-data-commons/references/clinical_data_guide.md b/scientific-skills/imaging-data-commons/references/clinical_data_guide.md
index eea34524..0c427795 100644
--- a/scientific-skills/imaging-data-commons/references/clinical_data_guide.md
+++ b/scientific-skills/imaging-data-commons/references/clinical_data_guide.md
@@ -162,6 +162,11 @@ merged = pd.merge(
```python
# SQL join approach
+# Clinical tables loaded via get_clinical_table() are not automatically
+# registered in DuckDB. Register the DataFrame manually before joining.
+nlst_canc_df = client.get_clinical_table("nlst_canc")
+client._duckdb_conn.register("nlst_canc", nlst_canc_df)
+
query = """
SELECT
index.PatientID,
diff --git a/scientific-skills/imaging-data-commons/references/digital_pathology_guide.md b/scientific-skills/imaging-data-commons/references/digital_pathology_guide.md
index ecf0be5b..c574074c 100644
--- a/scientific-skills/imaging-data-commons/references/digital_pathology_guide.md
+++ b/scientific-skills/imaging-data-commons/references/digital_pathology_guide.md
@@ -1,6 +1,6 @@
# Digital Pathology Guide for IDC
-**Tested with:** IDC data version v23, idc-index 0.11.9
+**Tested with:** IDC data version v23, idc-index 0.11.10
For general IDC queries and downloads, use `idc-index` (see main SKILL.md). This guide covers slide microscopy (SM) imaging, microscopy bulk simple annotations (ANN), and segmentations (SEG) in the context of digital pathology in IDC.
@@ -10,7 +10,7 @@ Five specialized index tables provide curated metadata without needing BigQuery:
| Table | Row Granularity | Description |
|-------|-----------------|-------------|
-| `sm_index` | 1 row = 1 SM series | Slide Microscopy series metadata: lens power, pixel spacing, image dimensions |
+| `sm_index` | 1 row = 1 SM series | Slide Microscopy series metadata: container/slide ID, tissue type, anatomic structure, diagnosis, lens power, pixel spacing, image dimensions |
| `sm_instance_index` | 1 row = 1 SM instance | Instance-level (SOPInstanceUID) metadata for individual slide images |
| `seg_index` | 1 row = 1 SEG series | DICOM Segmentation metadata: algorithm, segment count, reference to source series. Used for both radiology and pathology — filter by source Modality to find pathology-specific segmentations |
| `ann_index` | 1 row = 1 ANN series | Microscopy Bulk Simple Annotations series metadata; includes `referenced_SeriesInstanceUID` linking to the annotated slide |
@@ -57,6 +57,109 @@ client.sql_query("""
""")
```
+### Filter by specimen preparation
+
+The `sm_index` includes staining, embedding, and fixative metadata. These columns are **arrays** (e.g., `[hematoxylin stain, water soluble eosin stain]` for H&E) — use `array_to_string()` with `LIKE` or `list_contains()` to filter.
+
+```python
+# Find H&E-stained slides in a collection
+client.fetch_index("sm_index")
+client.sql_query("""
+ SELECT
+ i.PatientID,
+ s.staining_usingSubstance_CodeMeaning as staining,
+ s.embeddingMedium_CodeMeaning as embedding,
+ s.tissueFixative_CodeMeaning as fixative
+ FROM sm_index s
+ JOIN index i ON s.SeriesInstanceUID = i.SeriesInstanceUID
+ WHERE i.collection_id = 'tcga_brca'
+ AND array_to_string(s.staining_usingSubstance_CodeMeaning, ', ') LIKE '%hematoxylin%'
+ LIMIT 10
+""")
+```
+
+```python
+# Compare FFPE vs frozen slides across collections
+client.sql_query("""
+ SELECT
+ i.collection_id,
+ s.embeddingMedium_CodeMeaning as embedding,
+ COUNT(*) as slide_count
+ FROM sm_index s
+ JOIN index i ON s.SeriesInstanceUID = i.SeriesInstanceUID
+ GROUP BY i.collection_id, embedding
+ ORDER BY i.collection_id, slide_count DESC
+""")
+```
+
+## Identifying Tumor vs Normal Slides
+
+The `sm_index` table provides two ways to identify tissue type:
+
+| Column | Use Case |
+|--------|----------|
+| `primaryAnatomicStructureModifier_CodeMeaning` | Structured tissue type from DICOM specimen metadata (e.g., `Neoplasm, Primary`, `Normal`, `Tumor`, `Neoplasm, Metastatic`). Works across all collections with SM data. |
+| `ContainerIdentifier` | Slide/container identifier. For TCGA collections, contains the [TCGA barcode](https://docs.gdc.cancer.gov/Encyclopedia/pages/TCGA_Barcode/) where the [sample type code](https://gdc.cancer.gov/resources-tcga-users/tcga-code-tables/sample-type-codes) (positions 14-15) encodes tissue origin: `01`-`09` = tumor, `10`-`19` = normal. |
+
+### Using structured tissue type metadata
+
+```python
+from idc_index import IDCClient
+client = IDCClient()
+client.fetch_index("sm_index")
+
+# Discover tissue type values across all SM data
+client.sql_query("""
+ SELECT
+ s.primaryAnatomicStructureModifier_CodeMeaning as tissue_type,
+ COUNT(*) as slide_count
+ FROM sm_index s
+ WHERE s.primaryAnatomicStructureModifier_CodeMeaning IS NOT NULL
+ GROUP BY tissue_type
+ ORDER BY slide_count DESC
+""")
+```
+
+#### Example: Tumor vs normal slides in TCGA-BRCA
+
+```python
+# Tissue type breakdown for TCGA-BRCA
+client.sql_query("""
+ SELECT
+ s.primaryAnatomicStructureModifier_CodeMeaning as tissue_type,
+ COUNT(*) as slide_count,
+ COUNT(DISTINCT i.PatientID) as patient_count
+ FROM sm_index s
+ JOIN index i ON s.SeriesInstanceUID = i.SeriesInstanceUID
+ WHERE i.collection_id = 'tcga_brca'
+ GROUP BY tissue_type
+ ORDER BY slide_count DESC
+""")
+# Returns: Neoplasm, Primary (2704 slides), Normal (399 slides)
+```
+
+### Using TCGA barcode (TCGA collections only)
+
+For TCGA collections, `ContainerIdentifier` contains the slide barcode (e.g., `TCGA-E9-A3X8-01A-03-TSC`). Extract the sample type code to classify tissue:
+
+```python
+# Parse sample type from TCGA barcode
+client.sql_query("""
+ SELECT
+ SUBSTRING(SPLIT_PART(s.ContainerIdentifier, '-', 4), 1, 2) as sample_type_code,
+ s.primaryAnatomicStructureModifier_CodeMeaning as tissue_type,
+ COUNT(*) as slide_count
+ FROM sm_index s
+ JOIN index i ON s.SeriesInstanceUID = i.SeriesInstanceUID
+ WHERE i.collection_id = 'tcga_brca'
+ GROUP BY sample_type_code, tissue_type
+ ORDER BY sample_type_code
+""")
+# Returns: 01 → Neoplasm, Primary (2704), 06 → None (8), 11 → Normal (399)
+```
+
+The barcode approach catches cases where structured metadata is NULL (e.g., `06` = Metastatic slides have `primaryAnatomicStructureModifier_CodeMeaning` = NULL in TCGA-BRCA).
+
## Annotation Queries (ANN)
DICOM Microscopy Bulk Simple Annotations (Modality = 'ANN') are annotations **on** slide microscopy images. They appear in `ann_index` (series-level) and `ann_group_index` (group-level detail). Each ANN series references the slide it annotates via `referenced_SeriesInstanceUID`.
@@ -134,6 +237,52 @@ client.sql_query("""
""")
```
+## Finding Pre-Computed Analysis Results
+
+IDC hosts derived datasets (nuclei segmentations, TIL maps, AI annotations) identified by `analysis_result_id` in the main `index` table. Use `analysis_results_index` to discover what's available for pathology.
+
+```python
+from idc_index import IDCClient
+client = IDCClient()
+client.fetch_index("analysis_results_index")
+
+# Find analysis results that include pathology annotations or segmentations
+client.sql_query("""
+ SELECT
+ ar.analysis_result_id,
+ ar.analysis_result_title,
+ ar.Modalities,
+ ar.Subjects,
+ ar.Collections
+ FROM analysis_results_index ar
+ WHERE ar.Modalities LIKE '%ANN%' OR ar.Modalities LIKE '%SEG%'
+ ORDER BY ar.Subjects DESC
+""")
+```
+
+### Find analysis results for a specific slide
+
+```python
+# Find all derived data (annotations, segmentations) for TCGA-BRCA slides
+client.fetch_index("ann_index")
+client.sql_query("""
+ SELECT
+ i.analysis_result_id,
+ i.PatientID,
+ a.referenced_SeriesInstanceUID as source_slide,
+ g.AnnotationGroupLabel,
+ g.NumberOfAnnotations,
+ g.AlgorithmName
+ FROM ann_group_index g
+ JOIN ann_index a ON g.SeriesInstanceUID = a.SeriesInstanceUID
+ JOIN index i ON a.SeriesInstanceUID = i.SeriesInstanceUID
+ WHERE i.collection_id = 'tcga_brca'
+ LIMIT 10
+""")
+```
+
+Annotation objects can also contain per-annotation **measurements** (e.g., nucleus area, eccentricity) stored within the DICOM file. These are not in the index tables — extract them after download using [highdicom](https://github.com/ImagingDataCommons/highdicom) (`ann.get_annotation_groups()`, `group.get_measurements()`). See the [microscopy_dicom_ann_intro](https://github.com/ImagingDataCommons/IDC-Tutorials/blob/master/notebooks/pathomics/microscopy_dicom_ann_intro.ipynb) tutorial for a worked example including spatial analysis and cellularity computation.
+
## Filter by AnnotationGroupLabel
`AnnotationGroupLabel` is the most direct column for finding annotation groups by name or semantic content. Use `LIKE` with wildcards for text search.
diff --git a/scientific-skills/imaging-data-commons/references/index_tables_guide.md b/scientific-skills/imaging-data-commons/references/index_tables_guide.md
index 0ec6dabe..02c8b791 100644
--- a/scientific-skills/imaging-data-commons/references/index_tables_guide.md
+++ b/scientific-skills/imaging-data-commons/references/index_tables_guide.md
@@ -1,6 +1,6 @@
# Index Tables Guide for IDC
-**Tested with:** idc-index 0.11.9 (IDC data version v23)
+**Tested with:** idc-index 0.11.14 (IDC data version v23)
This guide covers the structure and access patterns for IDC index tables: programmatic schema discovery, DataFrame access, and join column references. For the overview of available tables and their purposes, see the "Index Tables" section in the main SKILL.md.
@@ -109,6 +109,8 @@ Most common columns in the primary `index` table (use `indices_overview` for com
| `license_short_name` | STRING | No | License type (CC BY 4.0, CC BY-NC 4.0, etc.) |
| `series_size_MB` | FLOAT | No | Size of series in megabytes |
| `instanceCount` | INTEGER | No | Number of DICOM instances in series |
+| `SOPClassUID` | STRING | Yes | DICOM SOP Class UID (identifies the object/service class, e.g., CT Image Storage) |
+| `TransferSyntaxUID` | STRING | Yes | DICOM Transfer Syntax UID (encoding/compression method) |
**DICOM = Yes**: Column value extracted from the DICOM attribute with the same name. Refer to the [DICOM standard](https://dicom.nema.org/medical/dicom/current/output/chtml/part06/chapter_6.html) for numeric tag mappings. Use standard DICOM knowledge for expected values and formats.
@@ -125,6 +127,9 @@ Use this table to identify join columns between index tables. Always call `clien
| `ann_index` | `ann_group_index` | `ann_index.SeriesInstanceUID = ann_group_index.SeriesInstanceUID` |
| `index` | `clinical_index` | `index.collection_id = clinical_index.collection_id` (then filter by patient) |
| `index` | `contrast_index` | `index.SeriesInstanceUID = contrast_index.SeriesInstanceUID` |
+| `index` | `volume_geometry_index` | `index.SeriesInstanceUID = volume_geometry_index.SeriesInstanceUID` |
+| `index` | `rtstruct_index` | `index.SeriesInstanceUID = rtstruct_index.SeriesInstanceUID` |
+| `rtstruct_index` | `index` (source images) | `rtstruct_index.referenced_SeriesInstanceUID = index.SeriesInstanceUID` |
For complete query examples using these joins, see `references/sql_patterns.md`.
diff --git a/scientific-skills/imaging-data-commons/references/parquet_access_guide.md b/scientific-skills/imaging-data-commons/references/parquet_access_guide.md
new file mode 100644
index 00000000..99e3fd9b
--- /dev/null
+++ b/scientific-skills/imaging-data-commons/references/parquet_access_guide.md
@@ -0,0 +1,196 @@
+# Direct Parquet Access Guide for IDC
+
+**Tested with:** idc-index-data 23.10.1, DuckDB 1.x
+
+All idc-index metadata tables are published as Parquet files to a public GCS bucket with unrestricted CORS access. This enables metadata queries with DuckDB or pandas without installing idc-index — useful for quick exploration or environments where pip install is unavailable.
+
+**Limitation:** download helpers (`download_from_selection()`), viewer URLs (`get_viewer_URL()`), and citation generation require the idc-index client and are not available from raw Parquet files.
+
+## When to Use This Guide
+
+Load this guide when you need to:
+- Query IDC metadata without installing idc-index
+- Run ad-hoc DuckDB queries against the latest index files
+- Access `volume_geometry_index` or `rtstruct_index` for geometry validation or RT structure queries
+
+For full API access (downloads, viewer, citations), use idc-index as documented in the main SKILL.md.
+
+## URL Pattern
+
+```
+https://storage.googleapis.com/idc-index-data-artifacts/current/release_artifacts/{filename}.parquet
+```
+
+`current/` always resolves to the latest data release. To pin to a specific version, replace `current` with the data version number (e.g., `23.10.1`).
+
+## Available Files
+
+| File | Approximate Size | Description |
+|------|-----------------|-------------|
+| `idc_index.parquet` | ~70 MB | Primary index (all DICOM series metadata) |
+| `volume_geometry_index.parquet` | ~5 MB | 3D geometry validation for CT/MR/PT series |
+| `rtstruct_index.parquet` | ~2 MB | RT Structure Set ROI metadata |
+| `seg_index.parquet` | ~6 MB | DICOM Segmentation cross-references |
+| `sm_index.parquet` | ~2 MB | Slide microscopy series metadata |
+| `contrast_index.parquet` | ~1 MB | Contrast agent metadata |
+| `ann_index.parquet` | ~0.2 MB | Microscopy annotation series metadata |
+| `ann_group_index.parquet` | ~0.5 MB | Annotation group metadata |
+| `collections_index.parquet` | — | Collection-level metadata |
+| `analysis_results_index.parquet` | — | Derived dataset metadata |
+| `clinical_index.parquet` | ~0.2 MB | Clinical data column dictionary |
+| `prior_versions_index.parquet` | — | Series from previous IDC releases |
+
+**Note:** the main index file is named `idc_index.parquet`, not `index.parquet`. Reference it with an alias in SQL queries (e.g., `FROM read_parquet(...) AS index`).
+
+## Prerequisites
+
+```bash
+pip install duckdb
+# or: uv add duckdb
+```
+
+DuckDB reads Parquet directly from HTTPS URLs using HTTP range requests — no GCS client library or authentication required.
+
+## Basic Queries
+
+```python
+import duckdb
+
+BASE = "https://storage.googleapis.com/idc-index-data-artifacts/current/release_artifacts"
+
+# Discover modalities and series counts
+duckdb.sql(f"""
+ SELECT Modality, COUNT(*) as series_count, ROUND(SUM(series_size_MB)/1000, 1) as size_GB
+ FROM read_parquet('{BASE}/idc_index.parquet')
+ GROUP BY Modality
+ ORDER BY series_count DESC
+""").df()
+
+# Collections with CT data, ordered by size
+duckdb.sql(f"""
+ SELECT collection_id,
+ COUNT(DISTINCT PatientID) as patients,
+ COUNT(*) as series,
+ ROUND(SUM(series_size_MB)/1000, 1) as size_GB
+ FROM read_parquet('{BASE}/idc_index.parquet')
+ WHERE Modality = 'CT'
+ GROUP BY collection_id
+ ORDER BY size_GB DESC
+ LIMIT 10
+""").df()
+```
+
+## Volume Geometry Validation
+
+`volume_geometry_index` covers single-frame CT, MR, and PT series. Each row has boolean checks for orientation, spacing, dimensions, and slice positions, plus a composite `regularly_spaced_3d_volume` flag.
+
+```python
+import duckdb
+
+BASE = "https://storage.googleapis.com/idc-index-data-artifacts/current/release_artifacts"
+
+# CT series that form a valid 3D volume (can be loaded without resampling)
+duckdb.sql(f"""
+ SELECT i.collection_id, i.SeriesInstanceUID, i.BodyPartExamined,
+ v.obliquity_degrees, v.regularly_spaced_3d_volume
+ FROM read_parquet('{BASE}/idc_index.parquet') i
+ JOIN read_parquet('{BASE}/volume_geometry_index.parquet') v
+ ON i.SeriesInstanceUID = v.SeriesInstanceUID
+ WHERE i.Modality = 'CT'
+ AND v.regularly_spaced_3d_volume = TRUE
+ LIMIT 10
+""").df()
+
+# Fraction of 3D-valid series per collection and modality
+duckdb.sql(f"""
+ SELECT i.collection_id, i.Modality,
+ COUNT(*) as total,
+ SUM(CASE WHEN v.regularly_spaced_3d_volume THEN 1 ELSE 0 END) as valid_3d,
+ ROUND(100.0 * SUM(CASE WHEN v.regularly_spaced_3d_volume THEN 1 ELSE 0 END) / COUNT(*), 1) as pct_valid
+ FROM read_parquet('{BASE}/idc_index.parquet') i
+ JOIN read_parquet('{BASE}/volume_geometry_index.parquet') v
+ ON i.SeriesInstanceUID = v.SeriesInstanceUID
+ WHERE i.Modality IN ('CT', 'MR', 'PT')
+ GROUP BY i.collection_id, i.Modality
+ ORDER BY total DESC
+ LIMIT 10
+""").df()
+```
+
+Key columns in `volume_geometry_index`:
+
+| Column | Type | Description |
+|--------|------|-------------|
+| `SeriesInstanceUID` | STRING | Join key |
+| `single_orientation` | BOOLEAN | All instances share the same ImageOrientationPatient |
+| `orthogonal_orientation` | BOOLEAN | Orientation direction cosines are orthogonal |
+| `unique_slice_positions` | BOOLEAN | No duplicate or overlapping slices |
+| `consistent_pixel_spacing` | BOOLEAN | All instances share the same PixelSpacing |
+| `consistent_image_dimensions` | BOOLEAN | All instances share the same Rows and Columns |
+| `uniform_slice_spacing` | BOOLEAN | Spacing between consecutive slices is constant |
+| `obliquity_degrees` | FLOAT | Angle between slice normal and nearest cardinal axis (0 = pure axial/sagittal/coronal) |
+| `regularly_spaced_3d_volume` | BOOLEAN | Composite: TRUE if all checks pass |
+
+## RT Structure Sets
+
+`rtstruct_index` has one row per RTSTRUCT series with aggregated ROI metadata.
+
+```python
+import duckdb
+
+BASE = "https://storage.googleapis.com/idc-index-data-artifacts/current/release_artifacts"
+
+# RTSTRUCT series with ROI details
+duckdb.sql(f"""
+ SELECT i.collection_id, i.SeriesInstanceUID,
+ r.total_rois, r.ROINames, r.RTROIInterpretedTypes,
+ r.referenced_SeriesInstanceUID
+ FROM read_parquet('{BASE}/idc_index.parquet') i
+ JOIN read_parquet('{BASE}/rtstruct_index.parquet') r
+ ON i.SeriesInstanceUID = r.SeriesInstanceUID
+ WHERE i.Modality = 'RTSTRUCT'
+ LIMIT 5
+""").df()
+
+# Collections with the most RTSTRUCT series
+duckdb.sql(f"""
+ SELECT i.collection_id,
+ COUNT(*) as rtstruct_series,
+ ROUND(AVG(r.total_rois), 1) as avg_rois_per_struct
+ FROM read_parquet('{BASE}/idc_index.parquet') i
+ JOIN read_parquet('{BASE}/rtstruct_index.parquet') r
+ ON i.SeriesInstanceUID = r.SeriesInstanceUID
+ GROUP BY i.collection_id
+ ORDER BY rtstruct_series DESC
+ LIMIT 10
+""").df()
+```
+
+Key columns in `rtstruct_index`:
+
+| Column | Type | Description |
+|--------|------|-------------|
+| `SeriesInstanceUID` | STRING | Join key (the RTSTRUCT series) |
+| `total_rois` | INTEGER | Number of ROIs in the structure set |
+| `ROINames` | STRING (array) | Distinct ROI names (e.g., `["GTV", "Heart", "PTV"]`) |
+| `ROIGenerationAlgorithms` | STRING (array) | Distinct generation algorithms (e.g., `["AUTOMATIC", "MANUAL"]`) |
+| `RTROIInterpretedTypes` | STRING (array) | Distinct ROI types (e.g., `["GTV", "ORGAN", "PTV"]`) |
+| `referenced_SeriesInstanceUID` | STRING | SeriesInstanceUID of the referenced source image series |
+
+## Pinning to a Specific Version
+
+```python
+import duckdb
+
+# Use a specific data release instead of 'current'
+VERSION = "23.10.1"
+BASE = f"https://storage.googleapis.com/idc-index-data-artifacts/{VERSION}/release_artifacts"
+
+duckdb.sql(f"SELECT COUNT(*) FROM read_parquet('{BASE}/idc_index.parquet')").df()
+```
+
+## Resources
+
+- idc-index-data releases: https://github.com/ImagingDataCommons/idc-index-data/releases
+- idc-index documentation: https://idc-index.readthedocs.io/
+- IDC Portal: https://portal.imaging.datacommons.cancer.gov/
diff --git a/scientific-skills/imaging-data-commons/references/sql_patterns.md b/scientific-skills/imaging-data-commons/references/sql_patterns.md
index bb862cfe..2032cfc0 100644
--- a/scientific-skills/imaging-data-commons/references/sql_patterns.md
+++ b/scientific-skills/imaging-data-commons/references/sql_patterns.md
@@ -1,6 +1,6 @@
# SQL Query Patterns for IDC
-**Tested with:** idc-index 0.11.9 (IDC data version v23)
+**Tested with:** idc-index 0.11.14 (IDC data version v23)
Quick reference for common SQL query patterns when working with IDC data. For detailed examples with context, see the "Core Capabilities" section in the main SKILL.md.
@@ -12,6 +12,8 @@ Load this guide when you need quick-reference SQL patterns for:
- Querying slide microscopy and annotation data
- Estimating download sizes before download
- Linking imaging data to clinical data
+- Filtering by 3D volume geometry validity (volume_geometry_index)
+- Finding RT Structure Set series and ROI metadata (rtstruct_index)
For table schemas, DataFrame access, and join column references, see `references/index_tables_guide.md`.
@@ -199,9 +201,86 @@ See `references/clinical_data_guide.md` for complete patterns including value ma
- **Cause:** NULL values in join columns or no matching records
- **Solution:** Use `LEFT JOIN` to include rows without matches, check for NULLs with `IS NOT NULL`
+## Volume Geometry Validation
+
+`volume_geometry_index` covers single-frame CT, MR, and PT series. Fetch it before querying.
+
+```python
+client.fetch_index("volume_geometry_index")
+
+# Series that form a regularly-spaced 3D volume (no resampling needed)
+client.sql_query("""
+ SELECT i.collection_id, i.SeriesInstanceUID, i.BodyPartExamined,
+ v.obliquity_degrees
+ FROM index i
+ JOIN volume_geometry_index v ON i.SeriesInstanceUID = v.SeriesInstanceUID
+ WHERE i.Modality = 'CT'
+ AND v.regularly_spaced_3d_volume = TRUE
+ LIMIT 10
+""")
+
+# Fraction of 3D-valid CT per collection
+client.sql_query("""
+ SELECT i.collection_id,
+ COUNT(*) as total_ct,
+ SUM(CASE WHEN v.regularly_spaced_3d_volume THEN 1 ELSE 0 END) as valid_3d,
+ ROUND(100.0 * SUM(CASE WHEN v.regularly_spaced_3d_volume THEN 1 ELSE 0 END) / COUNT(*), 1) as pct_valid
+ FROM index i
+ JOIN volume_geometry_index v ON i.SeriesInstanceUID = v.SeriesInstanceUID
+ WHERE i.Modality = 'CT'
+ GROUP BY i.collection_id
+ ORDER BY total_ct DESC
+ LIMIT 10
+""")
+```
+
+Key columns: `regularly_spaced_3d_volume` (composite flag), `obliquity_degrees` (0 = pure axial/sagittal/coronal), plus individual boolean checks: `single_orientation`, `orthogonal_orientation`, `unique_slice_positions`, `consistent_pixel_spacing`, `consistent_image_dimensions`, `uniform_slice_spacing`.
+
+## RT Structure Sets
+
+`rtstruct_index` has one row per RTSTRUCT series. Array columns (`ROINames`, `ROIGenerationAlgorithms`, `RTROIInterpretedTypes`) are stored as strings.
+
+```python
+client.fetch_index("rtstruct_index")
+
+# RTSTRUCT series with ROI counts and names
+client.sql_query("""
+ SELECT i.collection_id, i.SeriesInstanceUID,
+ r.total_rois, r.ROINames, r.RTROIInterpretedTypes,
+ r.referenced_SeriesInstanceUID
+ FROM index i
+ JOIN rtstruct_index r ON i.SeriesInstanceUID = r.SeriesInstanceUID
+ LIMIT 10
+""")
+
+# Collections with the most RTSTRUCT series
+client.sql_query("""
+ SELECT i.collection_id,
+ COUNT(*) as rtstruct_series,
+ ROUND(AVG(r.total_rois), 1) as avg_rois
+ FROM index i
+ JOIN rtstruct_index r ON i.SeriesInstanceUID = r.SeriesInstanceUID
+ GROUP BY i.collection_id
+ ORDER BY rtstruct_series DESC
+ LIMIT 10
+""")
+
+# Find source CT series for a given RTSTRUCT
+client.sql_query("""
+ SELECT r.SeriesInstanceUID as rtstruct_uid,
+ r.total_rois, r.ROINames,
+ src.SeriesInstanceUID as source_ct_uid,
+ src.collection_id, src.BodyPartExamined
+ FROM rtstruct_index r
+ JOIN index src ON r.referenced_SeriesInstanceUID = src.SeriesInstanceUID
+ LIMIT 10
+""")
+```
+
## Resources
- `references/index_tables_guide.md` for table schemas, DataFrame access, and join column references
- `references/clinical_data_guide.md` for clinical data patterns and value mapping
- `references/digital_pathology_guide.md` for pathology-specific queries
- `references/bigquery_guide.md` for advanced queries requiring full DICOM metadata
+- `references/parquet_access_guide.md` for direct Parquet queries without installing idc-index