Skip to content

Commit 0633dbc

Browse files
authored
Merge pull request #138 from jadh4v/feat-window-level-adjustment-pet-ct-overlay-example
feat(example): PET MIP with window/level adjustment
2 parents f2f8e5b + 6d6bb0d commit 0633dbc

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

usage/src/Volume/PET_CT_Overlay.jsx

+21-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ function Slider(props) {
2727
const onChange = (e) => {
2828
const value = Number(e.currentTarget.value);
2929
props.setValue(value);
30-
props.setPTValue(value);
30+
if (props.setPTValue) {
31+
props.setPTValue(value);
32+
}
3133
setTimeout(view?.renderView, 0);
3234
};
3335
return (
@@ -288,6 +290,9 @@ function Example(props) {
288290
}
289291
}, [window.ctData, window.ptData]);
290292

293+
const cdrMin = ptcolorLevel - ptcolorWindow / 2.0;
294+
const cdrMax = ptcolorLevel + ptcolorWindow / 2.0;
295+
291296
return (
292297
<MultiViewRoot>
293298
<input id='fileInput' type='file' className='file' accept='.zip' onChange={loadLocalData}/>
@@ -349,6 +354,20 @@ function Example(props) {
349354
setValue={setColorPreset}
350355
style={{ top: '10px', left: '405px' }}
351356
/>
357+
<Slider
358+
label='PET Level'
359+
max={34611}
360+
value={ptcolorLevel}
361+
setValue={setPTColorLevel}
362+
style={{ top: '90px', left: '5px' }}
363+
/>
364+
<Slider
365+
label='PET Window'
366+
max={69222}
367+
value={ptcolorWindow}
368+
setValue={setPTColorWindow}
369+
style={{ top: '124px', left: '5px' }}
370+
/>
352371
<div className='loader' id='loader' />
353372
<div
354373
style={{
@@ -488,6 +507,7 @@ function Example(props) {
488507
maximumSamplesPerRay: 2000,
489508
}}
490509
colorMapPreset='Grayscale'
510+
colorDataRange={[cdrMin, cdrMax]}
491511
useLookupTableScalarRange={false}
492512
shade={false}
493513
>

0 commit comments

Comments
 (0)