import os import json from typing import Callable, Optional, Tuple, Any from pathlib import Path import numpy as np import pydicom import torch from torch import Tensor from torch.utils.data import Dataset class SyntaxDataset(Dataset): """ PyTorch dataset for training the 3D backbone on DICOM videos. Expected JSON entries contain: - "path": relative path to the DICOM file from the JSON directory - "artery": 0 (left) or 1 (right) - "