Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web into main
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
bc41f4b4c1
|
@ -4,7 +4,8 @@ import vtkPiecewiseFunction from '@kitware/vtk.js/Common/DataModel/PiecewiseFunc
|
||||||
import { utilities } from '@cornerstonejs/core'
|
import { utilities } from '@cornerstonejs/core'
|
||||||
const { getColormap } = utilities.colormap
|
const { getColormap } = utilities.colormap
|
||||||
function setPetColorMapTransferFunctionForVolumeActor(
|
function setPetColorMapTransferFunctionForVolumeActor(
|
||||||
volumeInfo
|
volumeInfo,
|
||||||
|
isPT = false
|
||||||
) {
|
) {
|
||||||
const { volumeActor, preset } = volumeInfo
|
const { volumeActor, preset } = volumeInfo
|
||||||
const mapper = volumeActor.getMapper()
|
const mapper = volumeActor.getMapper()
|
||||||
|
@ -22,8 +23,14 @@ function setPetColorMapTransferFunctionForVolumeActor(
|
||||||
|
|
||||||
// Create scalar opacity function
|
// Create scalar opacity function
|
||||||
const ofun = vtkPiecewiseFunction.newInstance()
|
const ofun = vtkPiecewiseFunction.newInstance()
|
||||||
|
if (isPT) {
|
||||||
|
ofun.addPoint(0, 0.0)
|
||||||
|
ofun.addPoint(0.1, 1.0)
|
||||||
|
} else {
|
||||||
ofun.addPoint(0, 0.0)
|
ofun.addPoint(0, 0.0)
|
||||||
ofun.addPoint(0.1, 0.9)
|
ofun.addPoint(0.1, 0.9)
|
||||||
|
}
|
||||||
|
|
||||||
ofun.addPoint(5, 1.0)
|
ofun.addPoint(5, 1.0)
|
||||||
|
|
||||||
volumeActor.getProperty().setScalarOpacity(0, ofun)
|
volumeActor.getProperty().setScalarOpacity(0, ofun)
|
||||||
|
|
|
@ -592,7 +592,7 @@ export default {
|
||||||
.setVolumes([{
|
.setVolumes([{
|
||||||
volumeId: this.volumeId, callback: (r) => {
|
volumeId: this.volumeId, callback: (r) => {
|
||||||
if (this.series.Modality === 'PT') {
|
if (this.series.Modality === 'PT') {
|
||||||
setPetColorMapTransferFunctionForVolumeActor(r)
|
setPetColorMapTransferFunctionForVolumeActor(r, true)
|
||||||
} else {
|
} else {
|
||||||
setCtTransferFunctionForVolumeActor(r)
|
setCtTransferFunctionForVolumeActor(r)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue