Skip to content

Commit

Permalink
Add throw jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Jan 14, 2025
1 parent a928b41 commit 1e8f6ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/image/annotationGroupFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@ export class AnnotationGroupFactory {
}

/**
* Check dicom elements. Throws an error if not suitable.
* Check dicom elements.
*
* @param {Object<string, DataElement>} dataElements The DICOM data elements.
* @returns {string|undefined} A possible warning.
* @throws Error for missing or wrong data.
*/
checkElements(dataElements) {
// reset
Expand Down Expand Up @@ -218,6 +219,7 @@ export class AnnotationGroupFactory {
*
* @param {Object<string, DataElement>} dataElements The DICOM tags.
* @returns {AnnotationGroup} A new annotation group.
* @throws Error for missing or wrong data.
*/
create(dataElements) {
const annotations = [];
Expand Down
4 changes: 3 additions & 1 deletion src/image/imageFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ export class ImageFactory {
}

/**
* Check dicom elements. Throws an error if not suitable.
* Check dicom elements.
*
* @param {DataElements} dataElements The DICOM data elements.
* @returns {string|undefined} A possible warning.
* @throws Error for missing or wrong data.
*/
checkElements(dataElements) {
// reset
Expand Down Expand Up @@ -106,6 +107,7 @@ export class ImageFactory {
* Uint32Array | Int32Array} pixelBuffer The pixel buffer.
* @param {number} numberOfFiles The input number of files.
* @returns {Image} A new Image.
* @throws Error for missing or wrong data.
*/
create(dataElements, pixelBuffer, numberOfFiles) {
const size2D = getImage2DSize(dataElements);
Expand Down
4 changes: 3 additions & 1 deletion src/image/maskFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,11 @@ export class MaskFactory {
}

/**
* Check dicom elements. Throws an error if not suitable.
* Check dicom elements.
*
* @param {Object<string, DataElement>} _dicomElements The DICOM tags.
* @returns {string|undefined} A possible warning.
* @throws Error for missing or wrong data.
*/
checkElements(_dicomElements) {
// does nothing
Expand All @@ -348,6 +349,7 @@ export class MaskFactory {
* Uint16Array | Int16Array |
* Uint32Array | Int32Array} pixelBuffer The pixel buffer.
* @returns {Image} A new Image.
* @throws Error for missing or wrong data.
*/
create(dataElements, pixelBuffer) {
// check required and supported tags
Expand Down

0 comments on commit 1e8f6ef

Please sign in to comment.