Skip to content

Commit

Permalink
Merge pull request #138 from jadh4v/feat-window-level-adjustment-pet-…
Browse files Browse the repository at this point in the history
…ct-overlay-example

feat(example): PET MIP with window/level adjustment
  • Loading branch information
floryst authored Sep 17, 2024
2 parents f2f8e5b + 6d6bb0d commit 0633dbc
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion usage/src/Volume/PET_CT_Overlay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ function Slider(props) {
const onChange = (e) => {
const value = Number(e.currentTarget.value);
props.setValue(value);
props.setPTValue(value);
if (props.setPTValue) {
props.setPTValue(value);
}
setTimeout(view?.renderView, 0);
};
return (
Expand Down Expand Up @@ -288,6 +290,9 @@ function Example(props) {
}
}, [window.ctData, window.ptData]);

const cdrMin = ptcolorLevel - ptcolorWindow / 2.0;
const cdrMax = ptcolorLevel + ptcolorWindow / 2.0;

return (
<MultiViewRoot>
<input id='fileInput' type='file' className='file' accept='.zip' onChange={loadLocalData}/>
Expand Down Expand Up @@ -349,6 +354,20 @@ function Example(props) {
setValue={setColorPreset}
style={{ top: '10px', left: '405px' }}
/>
<Slider
label='PET Level'
max={34611}
value={ptcolorLevel}
setValue={setPTColorLevel}
style={{ top: '90px', left: '5px' }}
/>
<Slider
label='PET Window'
max={69222}
value={ptcolorWindow}
setValue={setPTColorWindow}
style={{ top: '124px', left: '5px' }}
/>
<div className='loader' id='loader' />
<div
style={{
Expand Down Expand Up @@ -488,6 +507,7 @@ function Example(props) {
maximumSamplesPerRay: 2000,
}}
colorMapPreset='Grayscale'
colorDataRange={[cdrMin, cdrMax]}
useLookupTableScalarRange={false}
shade={false}
>
Expand Down

0 comments on commit 0633dbc

Please sign in to comment.