/** * Get the interpolation type */ getInterpolationType(): InterpolationType;
/** * Get the interpolation type as a string */ getInterpolationTypeAsString(): string;
/** * Get the opacity of the object. * @default 1.0 */ getOpacity(): number;
/** * Get the component weighting function. * @param {Number} [idx] */ getPiecewiseFunction(idx?: number): vtkPiecewiseFunction;
/** * Get the currently set RGB transfer function. * @param {Number} [idx] */ getRGBTransferFunction(idx?: number): vtkColorTransferFunction;
/** * Alias to get the piecewise function (backwards compatibility) * @param {Number} [idx] */ getScalarOpacity(idx?: number): vtkPiecewiseFunction;
/** * Set the ambient lighting coefficient. * @param {Number} ambient The ambient lighting coefficient. */ setAmbient(ambient: number): boolean;
/** * Set the level value for window/level. * @param {Number} colorLevel The level value for window/level. */ setColorLevel(colorLevel: number): boolean;
/** * Set the window value for window/level. * @param {Number} colorWindow The window value for window/level. */ setColorWindow(colorWindow: number): boolean;
/** * * @param {Number} index * @param {Number} value */ setComponentWeight(index: number, value: number): boolean;
/** * Set the diffuse lighting coefficient. * @param {Number} diffuse The diffuse lighting coefficient. */ setDiffuse(diffuse: number): boolean;
/** * Set the interpolation type. * @param {InterpolationType} interpolationType The interpolation type. */ setInterpolationType(interpolationType: InterpolationType): boolean;
/** * Set `interpolationType` to `InterpolationType.LINEAR`. */ setInterpolationTypeToLinear(): boolean;
/** * Set `interpolationType` to `InterpolationType.NEAREST`. */ setInterpolationTypeToNearest(): boolean;
/** * Set the opacity of the object * @param {Number} opacity The opacity value. */ setOpacity(opacity: number): boolean;
/** * Set the piecewise function * @param {Number} index * @param {vtkPiecewiseFunction} func */ setPiecewiseFunction(index: number, func: vtkPiecewiseFunction): boolean;
/** * Set the color of a volume to an RGB transfer function * @param {Number} index * @param {vtkColorTransferFunction} func */ setRGBTransferFunction(index: number, func: vtkColorTransferFunction): boolean;
/** * Alias to set the piecewise function * @param {Number} index * @param {vtkPiecewiseFunction} func */ setScalarOpacity(index: number, func: vtkPiecewiseFunction): boolean;
/** * Use the range that is set on the lookup table, instead of setting the range from the * ColorWindow/ColorLevel settings * @defaultfalse * @param {Boolean} useLookupTableScalarRange */ setUseLookupTableScalarRange(useLookupTableScalarRange: boolean): boolean; }
/** * Method use to decorate a given object (publicAPI+model) with vtkImageProperty characteristics. * * @param publicAPI object on which methods will be bounds (public) * @param model object on which data structure will be bounds (protected) * @param {IImagePropertyInitialValues} [initialValues] (default: {}) */ exportfunctionextend(publicAPI: object, model: object, initialValues?: IImagePropertyInitialValues): void;
/** * Method use to create a new instance of vtkImageProperty * @param {IImagePropertyInitialValues} [initialValues] for pre-setting some of its content */ exportfunctionnewInstance(initialValues?: IImagePropertyInitialValues): vtkImageProperty;
/** * vtkImageProperty provides 2D image display support for vtk. * It can be associated with a vtkImageSlice prop and placed within a Renderer. * * This class resolves coincident topology with the same methods as vtkMapper. */ export declare constvtkImageProperty: { newInstance: typeof newInstance; extend: typeof extend; } exportdefault vtkImageProperty;
functionvtkImageProperty(publicAPI, model) { // Set our className model.classHierarchy.push('vtkImageProperty');
publicAPI.getMTime = () => { let mTime = model.mtime; let time;
for (let index = 0; index < VTK_MAX_VRCOMP; index++) { // Color MTimes if (model.componentData[index].rGBTransferFunction) { // time that RGB transfer function was last modified time = model.componentData[index].rGBTransferFunction.getMTime(); mTime = mTime > time ? mTime : time; }
// Piecewise function MTimes if (model.componentData[index].piecewiseFunction) { // time that weighting function was last modified time = model.componentData[index].piecewiseFunction.getMTime(); mTime = mTime > time ? mTime : time; } }
return mTime; };
// Set the color of a volume to an RGB transfer function publicAPI.setRGBTransferFunction = (index, func) => { // backwards compatible call without the component index let idx = index; let transferFunc = func; if (!Number.isInteger(index)) { transferFunc = index; idx = 0; } if (model.componentData[idx].rGBTransferFunction !== transferFunc) { model.componentData[idx].rGBTransferFunction = transferFunc; publicAPI.modified(); returntrue; } returnfalse; };
// Get the currently set RGB transfer function. publicAPI.getRGBTransferFunction = (idx = 0) => model.componentData[idx].rGBTransferFunction;
// Set the piecewise function publicAPI.setPiecewiseFunction = (index, func) => { let idx = index; let transferFunc = func; if (!Number.isInteger(index)) { transferFunc = index; idx = 0; } if (model.componentData[idx].piecewiseFunction !== transferFunc) { model.componentData[idx].piecewiseFunction = transferFunc; publicAPI.modified(); returntrue; } returnfalse; };
// Get the component weighting function. publicAPI.getPiecewiseFunction = (idx = 0) => model.componentData[idx].piecewiseFunction;
// Alias to set the piecewise function publicAPI.setScalarOpacity = (index, func) => { // backwards compatible call without the component index let idx = index; let transferFunc = func; if (!Number.isInteger(index)) { transferFunc = index; idx = 0; } return publicAPI.setPiecewiseFunction(idx, transferFunc); };
// Alias to get the piecewise function (backwards compatibility) publicAPI.getScalarOpacity = (idx = 0) => publicAPI.getPiecewiseFunction(idx);
publicAPI.setComponentWeight = (index, value) => { if (index < 0 || index >= VTK_MAX_VRCOMP) { vtkErrorMacro('Invalid index'); returnfalse; }
const val = Math.min(1, Math.max(0, value)); if (model.componentData[index].componentWeight !== val) { model.componentData[index].componentWeight = val; publicAPI.modified(); returntrue; } returnfalse; };
publicAPI.getComponentWeight = (index) => { if (index < 0 || index >= VTK_MAX_VRCOMP) { vtkErrorMacro('Invalid index'); return0.0; }