Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions examples/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import VTKCornerstonePaintingSyncExample from './VTKCornerstonePaintingSyncExamp
import VTKLoadImageDataExample from './VTKLoadImageDataExample.js';
import VTKCrosshairsExample from './VTKCrosshairsExample.js';
import VTKMPRRotateExample from './VTKMPRRotateExample.js';
import VTKVolumeRenderingExample from './VTKVolumeRenderingExample.js';

function LinkOut({ href, text }) {
return (
Expand Down Expand Up @@ -47,6 +48,12 @@ function Index() {
text:
'Demonstrates how to display two volumes simultaneously with different transfer functions for PET/CT Fusion.',
},
{
title: 'Volume Rendering',
url: '/volume-rendering',
text:
'Demonstrates how to perform volume rendering for a CT volume.',
},
{
title: 'Image Segmentation via Paint Widget',
url: '/painting',
Expand Down Expand Up @@ -137,6 +144,7 @@ function AppRouter() {
Example({ children: <VTKCornerstonePaintingSyncExample /> });
const crosshairs = () => Example({ children: <VTKCrosshairsExample /> });
const rotateMPR = () => Example({ children: <VTKMPRRotateExample /> });
const volumeRendering = () => Example({ children: <VTKVolumeRenderingExample /> });

return (
<Router>
Expand All @@ -148,6 +156,7 @@ function AppRouter() {
<Route exact path="/cornerstone-sync-painting" render={synced} />
<Route exact path="/crosshairs" render={crosshairs} />
<Route exact path="/rotate" render={rotateMPR} />
<Route exact path="/volume-rendering" render={volumeRendering} />
<Route exact path="/cornerstone-load-image-data" render={loadImage} />
<Route exact component={Index} />
</Switch>
Expand Down
7 changes: 2 additions & 5 deletions examples/VTKFusionExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,6 @@ function applyPreset(actor, preset) {
const { shiftRange } = getShiftRange(colorTransferArray);
let min = shiftRange[0];
const width = shiftRange[1] - shiftRange[0];

// TODO: Something about the rescaling is still very wrong
const shift = shiftRange[0];
min += shift;

const cfun = vtkColorTransferFunction.newInstance();
const normColorTransferValuePoints = [];
for (let i = 0; i < colorTransferArray.length; i += 4) {
Expand Down Expand Up @@ -390,6 +385,8 @@ class VTKFusionExample extends Component {

applyPreset(actor, preset);

this.rerenderAll();

this.setState({
ctTransferFunctionPresetId,
});
Expand Down
Loading