Skip to content

Commit

Permalink
Run linting
Browse files Browse the repository at this point in the history
  • Loading branch information
igoroctaviano committed Oct 27, 2023
1 parent 3ea7038 commit 79e7215
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 85 deletions.
2 changes: 1 addition & 1 deletion src/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -794,5 +794,5 @@ export {
_getCommonZCoordinate,
_getCoordinateDimensionality,
_getPoint,
_getCoordinates,
_getCoordinates
}
38 changes: 19 additions & 19 deletions src/bulkAnnotations/getExtendedROI.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import dcmjs from 'dcmjs'

const getExtendedROI = ({ feature, roi, metadata }) => {
const annotationGroupUID = feature.get("annotationGroupUID")
const annotationGroupUID = feature.get('annotationGroupUID')
const annotationGroupMetadata = metadata.AnnotationGroupSequence.find(
(item) => item.AnnotationGroupUID === annotationGroupUID
)

if (annotationGroupUID == null || annotationGroupMetadata == null) {
throw new Error(
"Could not obtain information of annotation from " +
'Could not obtain information of annotation from ' +
`annotation group "${annotationGroupUID}".`
)
}
Expand All @@ -19,16 +19,16 @@ const getExtendedROI = ({ feature, roi, metadata }) => {
roi.addEvaluation(
new dcmjs.sr.valueTypes.CodeContentItem({
name: new dcmjs.sr.coding.CodedConcept({
value: "276214006",
meaning: "Finding category",
schemeDesignator: "SCT",
value: '276214006',
meaning: 'Finding category',
schemeDesignator: 'SCT'
}),
value: new dcmjs.sr.coding.CodedConcept({
value: findingCategory.CodeValue,
meaning: findingCategory.CodeMeaning,
schemeDesignator: findingCategory.CodingSchemeDesignator,
schemeDesignator: findingCategory.CodingSchemeDesignator
}),
relationshipType: dcmjs.sr.valueTypes.RelationshipTypes.HAS_CONCEPT_MOD,
relationshipType: dcmjs.sr.valueTypes.RelationshipTypes.HAS_CONCEPT_MOD
})
)
}
Expand All @@ -39,16 +39,16 @@ const getExtendedROI = ({ feature, roi, metadata }) => {
roi.addEvaluation(
new dcmjs.sr.valueTypes.CodeContentItem({
name: new dcmjs.sr.coding.CodedConcept({
value: "121071",
meaning: "Finding",
schemeDesignator: "DCM",
value: '121071',
meaning: 'Finding',
schemeDesignator: 'DCM'
}),
value: new dcmjs.sr.coding.CodedConcept({
value: findingType.CodeValue,
meaning: findingType.CodeMeaning,
schemeDesignator: findingType.CodingSchemeDesignator,
schemeDesignator: findingType.CodingSchemeDesignator
}),
relationshipType: dcmjs.sr.valueTypes.RelationshipTypes.HAS_CONCEPT_MOD,
relationshipType: dcmjs.sr.valueTypes.RelationshipTypes.HAS_CONCEPT_MOD
})
)
}
Expand All @@ -70,25 +70,25 @@ const getExtendedROI = ({ feature, roi, metadata }) => {
name: new dcmjs.sr.coding.CodedConcept({
value: name.CodeValue,
meaning: name.CodeMeaning,
schemeDesignator: name.CodingSchemeDesignator,
schemeDesignator: name.CodingSchemeDesignator
}),
unit: new dcmjs.sr.coding.CodedConcept({
value: unit.CodeValue,
meaning: unit.CodeMeaning,
schemeDesignator: unit.CodingSchemeDesignator,
schemeDesignator: unit.CodingSchemeDesignator
}),
relationshipType: dcmjs.sr.valueTypes.RelationshipTypes.CONTAINS,
relationshipType: dcmjs.sr.valueTypes.RelationshipTypes.CONTAINS
})
if (measurementItem.ReferencedImageSequence != null) {
const ref = measurementItem.ReferencedImageSequence[0]
const image = new dcmjs.sr.valueTypes.ImageContentItem({
name: new dcmjs.sr.coding.CodedConcept({
value: "121112",
meaning: "Source of Measurement",
schemeDesignator: "DCM",
value: '121112',
meaning: 'Source of Measurement',
schemeDesignator: 'DCM'
}),
referencedSOPClassUID: ref.ReferencedSOPClassUID,
referencedSOPInstanceUID: ref.ReferencedSOPInstanceUID,
referencedSOPInstanceUID: ref.ReferencedSOPInstanceUID
})
if (ref.ReferencedOpticalPathIdentifier != null) {
image.ReferencedSOPSequence[0].ReferencedOpticalPathIdentifier =
Expand Down
36 changes: 18 additions & 18 deletions src/bulkAnnotations/utils.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import PointGeometry from "ol/geom/Point"
import PolygonGeometry from "ol/geom/Polygon"
import Feature from "ol/Feature"
import { getTopLeft, getBottomRight } from "ol/extent"
import PointGeometry from 'ol/geom/Point'
import PolygonGeometry from 'ol/geom/Polygon'
import Feature from 'ol/Feature'
import { getTopLeft, getBottomRight } from 'ol/extent'

import { _getCentroid, _getCoordinates } from "../annotation"
import { _getCoordinates } from '../annotation'
import {
_scoord3dCoordinates2geometryCoordinates,
_geometryCoordinates2scoord3dCoordinates,
} from "../scoord3dUtils"
_geometryCoordinates2scoord3dCoordinates
} from '../scoord3dUtils'

/**
* Get viewport bounding box
Expand All @@ -26,7 +26,7 @@ export const getViewportBoundingBox = ({ view, pyramid, affine }) => {
)
return {
topLeft: scoord3DCoords[0],
bottomRight: scoord3DCoords[1],
bottomRight: scoord3DCoords[1]
}
}

Expand Down Expand Up @@ -66,7 +66,7 @@ export const getPolygonFeature = ({
affineInverse,
commonZCoordinate,
coordinateDimensionality,
annotationGroupUID,
annotationGroupUID
}) => {
const offset = graphicIndex[annotationIndex] - 1

Expand All @@ -92,7 +92,7 @@ export const getPolygonFeature = ({
}

return new Feature({
geometry: new PolygonGeometry([polygonCoordinates]),
geometry: new PolygonGeometry([polygonCoordinates])
})
}

Expand All @@ -112,7 +112,7 @@ export const getPointFeature = ({
affineInverse,
commonZCoordinate,
coordinateDimensionality,
annotationGroupUID,
annotationGroupUID
}) => {
const offset = graphicIndex[annotationIndex] - 1
const coordinate = _getCoordinates(graphicData, offset, commonZCoordinate)
Expand All @@ -122,7 +122,7 @@ export const getPointFeature = ({
affineInverse
)
return new Feature({
geometry: new PointGeometry(renderableCoordinate),
geometry: new PointGeometry(renderableCoordinate)
})
}

Expand All @@ -140,7 +140,7 @@ export const getFeaturesFromBulkAnnotations = ({
affineInverse,
view,
featureFunction,
isHighResolution,
isHighResolution
}) => {
console.info('create features from bulk annotations')

Expand Down Expand Up @@ -179,14 +179,14 @@ export const getFeaturesFromBulkAnnotations = ({
affineInverse,
commonZCoordinate,
coordinateDimensionality,
annotationGroupUID,
annotationGroupUID
})

feature.setId(annotationGroupUID + '-' + annotationIndex)
feature.set("annotationGroupUID", annotationGroupUID, true)
feature.set('annotationGroupUID', annotationGroupUID, true)

measurements.forEach((measurement, measurementIndex) => {
const key = "measurementValue" + measurementIndex
const key = 'measurementValue' + measurementIndex
const value = measurement.values[annotationIndex]
/**
* Needed for the WebGL renderer. This is required for the point layer which uses webgl
Expand All @@ -199,12 +199,12 @@ export const getFeaturesFromBulkAnnotations = ({
}

return features
};
}

export default {
getFeaturesFromBulkAnnotations,
getPointFeature,
getPolygonFeature,
isCoordinateInsideBoundingBox,
getViewportBoundingBox,
getViewportBoundingBox
}
Loading

0 comments on commit 79e7215

Please sign in to comment.