Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mounted() {
this.threeDViewActive =
this.proxyManager.getActiveView().getClassName() === 'vtkViewProxy';
this.paletteCycler = createPaletteCycler(this.palette);
// used during the duration of widget placement
this.viewSubs = [];
// used to show/hide widgets per slice
this.repSubs = [];
this.widgetStateSub = makeSubManager();
},
beforeDestroy() {
function vtkLabelMapVolumeRepProxy(publicAPI, model) {
// Set our className
model.classHierarchy.push('vtkLabelMapVolumeRepProxy');
const labelMapSub = makeSubManager();
// Volume
model.mapper = vtkVolumeMapper.newInstance();
model.volume = vtkVolume.newInstance();
model.property = model.volume.getProperty();
model.property.setInterpolationTypeToNearest();
function updateTransferFunctions(labelmap) {
const colorMap = labelmap.getColorMap();
const cfun = vtkColorTransferFunction.newInstance();
const ofun = vtkPiecewiseFunction.newInstance();
Object.keys(colorMap).forEach((label) => {
const l = Number(label);
function vtkLabelMapSliceRepProxy(publicAPI, model) {
// Set our className
model.classHierarchy.push('vtkLabelMapSliceRepProxy');
const labelMapSub = makeSubManager();
model.property.setInterpolationType(InterpolationType.NEAREST);
function updateTransferFunctions(labelmap) {
const colorMap = labelmap.getColorMap();
const cfun = vtkColorTransferFunction.newInstance();
const ofun = vtkPiecewiseFunction.newInstance();
Object.keys(colorMap).forEach((label) => {
const l = Number(label);
cfun.addRGBPoint(l, ...colorMap[label].slice(0, 3).map((c) => c / 255));
ofun.addPoint(l, colorMap[label][3] / 255);
});
model.property.setRGBTransferFunction(cfun);
mounted() {
this.stateSub = makeSubManager();
},
beforeDestroy() {
mounted() {
this.widget = vtkPaintWidget.newInstance();
this.widget.setRadius(this.radius);
this.filter = null;
this.view3D = null;
this.paletteCycler = createPaletteCycler(this.palette);
this.subs = [];
this.labelmapSub = makeSubManager();
},
beforeDestroy() {
function emptyTool() {
return {
toolInfo: null,
widget: null,
viewWidget: null,
repId: -1,
slice: -1,
axis: '',
stateSub: makeSubManager(),
name: '',
extraInfo: '',
size: 16,
color: PALETTE[0],
};
}