chore(prettier): full repo linting and code reformatting once and for all (#3627)
This commit is contained in:
1 parent
01500a2d4c
commit
9045ddaedc
656 files changed
+21737
-20628
No files matched your search
@@ -98,15 +98,9 @@ function initializeDataset(annotations, metadataProvider) {
|
||||
const rtSOPInstanceUID = DicomMetaDictionary.uid();
|
||||
|
||||
// get the first annotation data
|
||||
const {
|
||||
referencedImageId: imageId,
|
||||
FrameOfReferenceUID,
|
||||
} = annotations[0].metadata;
|
||||
const { referencedImageId: imageId, FrameOfReferenceUID } = annotations[0].metadata;
|
||||
|
||||
const { studyInstanceUID } = metadataProvider.get(
|
||||
'generalSeriesModule',
|
||||
imageId
|
||||
);
|
||||
const { studyInstanceUID } = metadataProvider.get('generalSeriesModule', imageId);
|
||||
|
||||
const patientModule = getPatientModule(imageId, metadataProvider);
|
||||
const rtSeriesModule = getRTSeriesModule(imageId, metadataProvider);
|
||||
@@ -136,23 +130,11 @@ function initializeDataset(annotations, metadataProvider) {
|
||||
}
|
||||
|
||||
function getPatientModule(imageId, metadataProvider) {
|
||||
const generalSeriesModule = metadataProvider.get(
|
||||
'generalSeriesModule',
|
||||
imageId
|
||||
);
|
||||
const generalStudyModule = metadataProvider.get(
|
||||
'generalStudyModule',
|
||||
imageId
|
||||
);
|
||||
const patientStudyModule = metadataProvider.get(
|
||||
'patientStudyModule',
|
||||
imageId
|
||||
);
|
||||
const generalSeriesModule = metadataProvider.get('generalSeriesModule', imageId);
|
||||
const generalStudyModule = metadataProvider.get('generalStudyModule', imageId);
|
||||
const patientStudyModule = metadataProvider.get('patientStudyModule', imageId);
|
||||
const patientModule = metadataProvider.get('patientModule', imageId);
|
||||
const patientDemographicModule = metadataProvider.get(
|
||||
'patientDemographicModule',
|
||||
imageId
|
||||
);
|
||||
const patientDemographicModule = metadataProvider.get('patientDemographicModule', imageId);
|
||||
|
||||
return {
|
||||
Modality: generalSeriesModule.modality,
|
||||
@@ -169,11 +151,7 @@ function getPatientModule(imageId, metadataProvider) {
|
||||
};
|
||||
}
|
||||
|
||||
function getReferencedFrameOfReferenceSequence(
|
||||
toolData,
|
||||
metadataProvider,
|
||||
dataset
|
||||
) {
|
||||
function getReferencedFrameOfReferenceSequence(toolData, metadataProvider, dataset) {
|
||||
const { referencedImageId: imageId, FrameOfReferenceUID } = toolData.metadata;
|
||||
const instance = metadataProvider.get('instance', imageId);
|
||||
const { SeriesInstanceUID } = instance;
|
||||
@@ -190,9 +168,7 @@ function getReferencedFrameOfReferenceSequence(
|
||||
RTReferencedSeriesSequence: [
|
||||
{
|
||||
SeriesInstanceUID,
|
||||
ContourImageSequence: [
|
||||
...ReferencedSeriesSequence[0].ReferencedInstanceSequence,
|
||||
],
|
||||
ContourImageSequence: [...ReferencedSeriesSequence[0].ReferencedInstanceSequence],
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -209,10 +185,7 @@ function getReferencedSeriesSequence(toolData, index, metadataProvider) {
|
||||
|
||||
const ReferencedSeriesSequence = [];
|
||||
if (SeriesInstanceUID) {
|
||||
const series = DicomMetadataStore.getSeries(
|
||||
StudyInstanceUID,
|
||||
SeriesInstanceUID
|
||||
);
|
||||
const series = DicomMetadataStore.getSeries(StudyInstanceUID, SeriesInstanceUID);
|
||||
|
||||
const ReferencedSeries = {
|
||||
SeriesInstanceUID,
|
||||
|
||||
+2
-7
@@ -20,18 +20,13 @@ class AnnotationToPointData {
|
||||
const toolClass = AnnotationToPointData.TOOL_NAMES[toolName];
|
||||
|
||||
if (!toolClass) {
|
||||
throw new Error(
|
||||
`Unknown tool type: ${toolName}, cannot convert to RTSSReport`
|
||||
);
|
||||
throw new Error(`Unknown tool type: ${toolName}, cannot convert to RTSSReport`);
|
||||
}
|
||||
|
||||
// Each toolData should become a list of contours, ContourSequence
|
||||
// contains a list of contours with their pointData, their geometry
|
||||
// type and their length.
|
||||
const ContourSequence = toolClass.getContourSequence(
|
||||
annotation,
|
||||
metadataProvider
|
||||
);
|
||||
const ContourSequence = toolClass.getContourSequence(annotation, metadataProvider);
|
||||
|
||||
// Todo: random rgb color for now, options should be passed in
|
||||
const color = [
|
||||
|
||||
+1
-6
@@ -29,12 +29,7 @@ function getPointData(points) {
|
||||
// Since this is a closed contour, the order of the points is important.
|
||||
// re-order the points to be in the correct order clockwise
|
||||
// Spread to make sure Float32Arrays are converted to arrays
|
||||
const orderedPoints = [
|
||||
...points[0],
|
||||
...points[1],
|
||||
...points[3],
|
||||
...points[2],
|
||||
];
|
||||
const orderedPoints = [...points[0], ...points[1], ...points[3], ...points[2]];
|
||||
const pointsArray = orderedPoints.flat();
|
||||
|
||||
// reduce the precision of the points to 2 decimal places
|
||||
|
||||
Reference in new issue
Block a user