Caching stores expensive preprocessing results temporarily so later requests can reuse them instead of repeatedly reading and transforming raw data. For CT samples, this can make a data-loading pipeline dramatically faster. section 12.5.1 section 12.8
A practical caching setup can use several layers:
- Keep a recently requested CT object in memory, accepting frequent misses when access order changes. section 12.5.1
- Persist extracted candidate arrays on disk so later requests read compact float32 values rather than reload, convert, and crop the full scan. section 12.5.1
- Cache before augmentation; otherwise, an augmented sample may be persisted and reused instead of generating fresh transformations. section 14.6.1
- Remove stale cache files when cached function definitions materially change, or old outputs may no longer match their inputs. section 12.5.1
@functools.lru_cache(1, typed=True) def getCt(series_uid): return Ct(series_uid) @raw_cache.memoize(typed=True) def getCtRawCandidate(series_uid, center_xyz, width_irc): ct = getCt(series_uid) ct_chunk, center_irc = ct.getRawCandidate(center_xyz, width_irc) return ct_chunk, center_irc
A one-entry in-memory cache retains CT objects, while a disk-backed memoized function stores extracted candidate chunks and centers for reuse. section 12.5.1





































