updateWindowing method

void updateWindowing({
  1. double? center,
  2. double? width,
})

Updates the Window Center and Width to specific values.

Useful for programmatic presets (e.g., "Bone Window", "Lung Window").

Implementation

void updateWindowing({final double? center, final double? width}) {
  if (!hasData) return;

  if (center != null) {
    _currentWindowCenter = center;
  }
  if (width != null) {
    _currentWindowWidth = width.clamp(1.0, 8000.0);
  }

  notifyListeners();
}