Skip to content

Commit

Permalink
Rename SIGMOID to SAMPLED_SIGMOID
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouwen committed Feb 12, 2023
1 parent 6e81031 commit ac069b7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
8 changes: 3 additions & 5 deletions packages/core/src/RenderingEngine/BaseVolumeViewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
* Sets the properties for the volume viewport on the volume
* Sets the VOILUTFunction property for the volume viewport on the volume
*
* @param VOILUTFunction - Sets the voi mode (LINEAR, EXACT_LINEAR, or SIGMOID)
* @param VOILUTFunction - Sets the voi mode (LINEAR or SAMPLED_SIGMOID)
* @param volumeId - The volume id to set the properties for (if undefined, the first volume)
* @param suppressEvents - If true, the viewport will not emit events
*/
Expand Down Expand Up @@ -235,9 +235,7 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {

// scaling logic here
// https://github.com/Kitware/vtk-js/blob/c6f2e12cddfe5c0386a73f0793eb6d9ab20d573e/Sources/Rendering/OpenGL/VolumeMapper/index.js#L957-L972
// Todo, windowlevelTool needs to send property instead of
// directly changing the transferfunction range which is not valid for sigmoid
if (this.VOILUTFunction === VOILUTFunctionType.SIGMOID) {
if (this.VOILUTFunction === VOILUTFunctionType.SAMPLED_SIGMOID) {
const cfun = createSigmoidRGBTransferFunction(voiRangeToUse);
volumeActor.getProperty().setRGBTransferFunction(0, cfun);
} else {
Expand All @@ -263,7 +261,7 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
* (if fusion, it sets it for the first volume in the fusion)
*
* @param voiRange - Sets the lower and upper voi
* @param VOILUTFunction - Sets the voi mode (LINEAR, EXACT_LINEAR, or SIGMOID)
* @param VOILUTFunction - Sets the voi mode (LINEAR, or SAMPLED_SIGMOID)
* @param volumeId - The volume id to set the properties for (if undefined, the first volume)
* @param suppressEvents - If true, the viewport will not emit events
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/RenderingEngine/StackViewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ class StackViewport extends Viewport implements IStackViewport {
// scaling logic here
// https://github.com/Kitware/vtk-js/blob/master/Sources/Rendering/OpenGL/ImageMapper/index.js#L540-L549
imageActor.getProperty().setUseLookupTableScalarRange(true);
if (this.VOILUTFunction === VOILUTFunctionType.SIGMOID) {
if (this.VOILUTFunction === VOILUTFunctionType.SAMPLED_SIGMOID) {
const cfun = createSigmoidRGBTransferFunction(voiRangeToUse);
if (this.invert) {
invertRgbTransferFunction(cfun);
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/enums/VOILUTFunctionType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*/
enum VOILUTFunctionType {
LINEAR = 'LINEAR',
SIGMOID = 'SIGMOID',
EXACT_LINEAR = 'EXACT_LINEAR',
SAMPLED_SIGMOID = 'SIGMOID', // SIGMOID is sampled in 1024 even steps so we call it SAMPLED_SIGMOID
// EXACT_LINEAR = 'EXACT_LINEAR', TODO: Add EXACT_LINEAR option from DICOM NEMA
}

export default VOILUTFunctionType;
2 changes: 1 addition & 1 deletion packages/core/src/types/Metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Metadata = {
Rows: number;
/** Window Level/Center for the image */
voiLut: Array<VOI>;
/** VOILUTFunction for the image which is LINEAR, EXACT_LINEAR, or SIGMOID */
/** VOILUTFunction for the image which is LINEAR or SAMPLED_SIGMOID */
VOILUTFunction: string;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/StackViewportProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { VOIRange } from './voi';
type StackViewportProperties = {
/** voi range (upper, lower) for the viewport */
voiRange?: VOIRange;
/** VOILUTFunction type which is LINEAR, EXACT_LINEAR, or SIGMOID */
/** VOILUTFunction type which is LINEAR or SAMPLED_SIGMOID */
VOILUTFunction?: VOILUTFunctionType;
/** invert flag - whether the image is inverted */
invert?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/VolumeViewportProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import VOILUTFunctionType from '../enums/VOILUTFunctionType';
type VolumeViewportProperties = {
/** voi range (upper, lower) for the viewport */
voiRange?: VOIRange;
/** VOILUTFunction type which is LINEAR, EXACT_LINEAR, or SIGMOID */
/** VOILUTFunction type which is LINEAR or SAMPLED_SIGMOID */
VOILUTFunction?: VOILUTFunctionType;
};

Expand Down

0 comments on commit ac069b7

Please sign in to comment.