Skip to content

Commit b2d750f

Browse files
authored
Merge pull request #132 from sankhesh/pet_mip
Add MIP rendering of PET data
2 parents a1297f7 + 39f142d commit b2d750f

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

usage/src/Volume/PET_CT_Overlay.jsx

+36-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import vtkITKHelper from '@kitware/vtk.js/Common/DataModel/ITKHelper';
22
import vtkLiteHttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper';
33
import vtkResourceLoader from '@kitware/vtk.js/IO/Core/ResourceLoader';
44
import vtkColorMaps from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps.js';
5+
import { BlendMode } from '@kitware/vtk.js/Rendering/Core/VolumeMapper/Constants.js';
56
import { unzipSync } from 'fflate';
67
import { useContext, useEffect, useState } from 'react';
78
import './PET_CT_Overlay.css';
@@ -15,6 +16,7 @@ import {
1516
SliceRepresentation,
1617
UseDataSet,
1718
View,
19+
VolumeRepresentation,
1820
} from 'react-vtk-js';
1921

2022
function Slider(props) {
@@ -243,7 +245,7 @@ function Example(props) {
243245
style={{
244246
position: 'absolute',
245247
left: '0px',
246-
width: '50%',
248+
width: '33%',
247249
height: '100%',
248250
}}
249251
>
@@ -298,8 +300,8 @@ function Example(props) {
298300
<div
299301
style={{
300302
position: 'absolute',
301-
left: '50%',
302-
width: '50%',
303+
left: '33%',
304+
width: '33%',
303305
height: '100%',
304306
}}
305307
>
@@ -353,6 +355,37 @@ function Example(props) {
353355
</SliceRepresentation>
354356
</View>
355357
</div>
358+
<div
359+
style={{
360+
position: 'absolute',
361+
left: '66%',
362+
width: '33%',
363+
height: '100%',
364+
}}
365+
>
366+
<View
367+
id='0'
368+
camera={{
369+
position: [0, 0, 0],
370+
focalPoint: [0, 1, 0],
371+
viewUp: [0, 0, 1],
372+
parallelProjection: true,
373+
}}
374+
background={[0, 0, 0]}
375+
>
376+
<VolumeRepresentation
377+
mapper={{
378+
blendMode: BlendMode.MAXIMUM_INTENSITY_BLEND,
379+
maximumSamplesPerRay: 2000,
380+
}}
381+
colorMapPreset='Grayscale'
382+
useLookupTableScalarRange={false}
383+
shade={false}
384+
>
385+
<UseDataSet id='ptData' />
386+
</VolumeRepresentation>
387+
</View>
388+
</div>
356389
</div>
357390
</ShareDataSetRoot>
358391
</MultiViewRoot>

0 commit comments

Comments
 (0)