import React, { useState } from 'react'; import { Button, PanelSection, ButtonGroup, IconButton, InputNumber } from '@ohif/ui'; import { DoubleSlider, Icons, Tooltip, TooltipTrigger, TooltipContent } from '@ohif/ui-next'; import { Enums } from '@cornerstonejs/core'; const controlClassNames = { sizeClassName: 'w-[58px] h-[28px]', arrowsDirection: 'horizontal', labelPosition: 'bottom', }; const Header = ({ title, tooltip }) => (
{tooltip}
{title}
); const DynamicVolumeControls = ({ isPlaying, onPlayPauseChange, // fps fps, onFpsChange, minFps, maxFps, // Frames currentFrameIndex, onFrameChange, framesLength, onGenerate, onDoubleRangeChange, onDynamicClick, }) => { const [computedView, setComputedView] = useState(false); const [computeViewMode, setComputeViewMode] = useState(Enums.DynamicOperatorType.SUM); const [sliderRangeValues, setSliderRangeValues] = useState([0, framesLength - 1]); const handleSliderChange = newValues => { onDoubleRangeChange(newValues); setSliderRangeValues(newValues); }; const formatLabel = value => Math.round(value); return (
Operation Buttons (SUM, AVERAGE, SUBTRACT): Select the mathematical operation to be applied to the data set.
Range Slider: Choose the numeric range within which the operation will be performed.
Generate Button: Execute the chosen operation on the specified range of data.
} />
); }; export default DynamicVolumeControls; function FrameControls({ isPlaying, onPlayPauseChange, fps, minFps, maxFps, onFpsChange, framesLength, onFrameChange, currentFrameIndex, computedView, }) { const getPlayPauseIconName = () => (isPlaying ? 'icon-pause' : 'icon-play'); return (
Play/Pause Button: Begin or pause the animation of the 4D visualization.
Frame Selector: Navigate through individual frames of the 4D data.
FPS (Frames Per Second) Selector: Adjust the playback speed of the animation.
} />
onPlayPauseChange(!isPlaying)} >
); }