From 22b9c14af34fb8ae4e1eaa8b15913a705aee67e1 Mon Sep 17 00:00:00 2001 From: Erik Ziegler Date: Thu, 29 Jul 2021 12:39:20 +0200 Subject: [PATCH] fix: minor jsdoc issues preventing API docs from building --- src/drawing/drawArrow.js | 2 +- .../modules/segmentationModule/colorLUT.js | 2 +- .../segmentation/strategies/correction.js | 23 +++++++++++++++---- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/drawing/drawArrow.js b/src/drawing/drawArrow.js index 781463d5b..f4df12a71 100644 --- a/src/drawing/drawArrow.js +++ b/src/drawing/drawArrow.js @@ -12,7 +12,7 @@ import drawJoinedLines from './drawJoinedLines.js'; * @param {Object} end The end position. * @param {string} color The color of the arrow. * @param {number} lineWidth The width of the arrow line. - * @param {number[]|| undefined} [lineDash] The optional lineDash style. + * @param {number[] | undefined} [lineDash] The optional lineDash style. * @returns {undefined} */ export default function(context, start, end, color, lineWidth, lineDash) { diff --git a/src/store/modules/segmentationModule/colorLUT.js b/src/store/modules/segmentationModule/colorLUT.js index 0de041e2b..bf26f2f01 100644 --- a/src/store/modules/segmentationModule/colorLUT.js +++ b/src/store/modules/segmentationModule/colorLUT.js @@ -53,7 +53,7 @@ export function getColorForSegmentIndexColorLUT( * * @param {Object|number} labelmap3DOrColorLUTIndex Either a `Labelmap3D` object (who's referenced colorLUT will be changed), or a colorLUTIndex. * @param {number} segmentIndex The segmentIndex color to change. - * @param {[number,number,number,number]} colorArray The color values in RGBA array format. + * @param {number[]} colorArray The color values in RGBA array format (required length 4). */ export function setColorForSegmentIndexOfColorLUT( labelmap3DOrColorLUTIndex, diff --git a/src/tools/segmentation/strategies/correction.js b/src/tools/segmentation/strategies/correction.js index 8a88bf615..6cf5d8052 100644 --- a/src/tools/segmentation/strategies/correction.js +++ b/src/tools/segmentation/strategies/correction.js @@ -18,7 +18,7 @@ const logger = getLogger('util:segmentation:operations:correction'); * - Stroke in-out-in: Section is added. * * @param {Object} evt The cornerstone event. - * @param {} operationData An object containing the `pixelData` to + * @param {Object} operationData An object containing the `pixelData` to * modify, the `segmentIndex` and the `points` array. * * @returns {null} @@ -462,13 +462,26 @@ function getNodesPerpendicularToPathPixel(pathPixel, nextPathPixel) { } /** - * Splits the path of nodes into seperate add/remove operations. + * @typedef {Object} Node + * @property {number} x - the X position + * @property {number} y - the Y position + * @property {number} segment - The segment index + */ + +/** + * @typedef {Object} SegmentationOperations + * @property {boolean} additive - Whether the operation is additive or not + * @property {Node[]} nodes - The array of nodes + */ + +/** + * Splits the path of nodes into separate add/remove operations. * * @param {Object[]} nodes The array of nodes. * @param {number} segmentIndex The label value to replace. - * @returns {{additive: boolean, nodes: []}[]} An array of operations to perform, - * whether they are `additive` and the - * corresponding `nodes` of the operation. + * @returns {SegmentationOperations[]} An array of operations to perform, + * whether they are `additive` and the + * corresponding `nodes` of the operation. */ function splitLineIntoSeperateOperations(nodes, segmentIndex) { // Check whether the first node is inside a segment of the appropriate label or not.