File tree 4 files changed +32
-2
lines changed
4 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -382,7 +382,8 @@ DicomMetaDictionary.sopClassNamesByUID = {
382
382
"1.2.840.10008.5.1.4.1.1.88.33" : "ComprehensiveSR" ,
383
383
"1.2.840.10008.5.1.4.1.1.128" : "PETImage" ,
384
384
"1.2.840.10008.5.1.4.1.1.130" : "EnhancedPETImage" ,
385
- "1.2.840.10008.5.1.4.1.1.128.1" : "LegacyConvertedEnhancedPETImage"
385
+ "1.2.840.10008.5.1.4.1.1.128.1" : "LegacyConvertedEnhancedPETImage" ,
386
+ "1.2.840.10008.5.1.4.1.1.77.1.5.1" : "OphthalmicPhotography8BitImage"
386
387
} ;
387
388
388
389
DicomMetaDictionary . dictionary = dictionary ;
Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ class Normalizer {
51
51
PETImageNormalizer ;
52
52
sopClassUIDMap [ toUID . Segmentation ] = SEGImageNormalizer ;
53
53
sopClassUIDMap [ toUID . DeformableSpatialRegistration ] = DSRNormalizer ;
54
+ sopClassUIDMap [ toUID . OphthalmicPhotography8BitImage ] =
55
+ OPImageNormalizer ;
54
56
return sopClassUIDMap [ sopClassUID ] ;
55
57
}
56
58
@@ -531,6 +533,12 @@ class DSRNormalizer extends Normalizer {
531
533
}
532
534
}
533
535
536
+ class OPImageNormalizer extends Normalizer {
537
+ normalize ( ) {
538
+ this . dataset = this . datasets [ 0 ] ; // only one dataset per series and for now we assume it is normalized
539
+ }
540
+ }
541
+
534
542
export { Normalizer } ;
535
543
export { ImageNormalizer } ;
536
544
export { MRImageNormalizer } ;
@@ -543,3 +551,4 @@ export { PETImageNormalizer };
543
551
export { SEGImageNormalizer } ;
544
552
export { PMImageNormalizer } ;
545
553
export { DSRNormalizer } ;
554
+ export { OPImageNormalizer } ;
Original file line number Diff line number Diff line change 1
- it ( "No tests yet" , ( ) => { } ) ;
1
+ import "regenerator-runtime/runtime.js" ;
2
+
3
+ import fs from "fs" ;
4
+ import { jest } from "@jest/globals" ;
5
+ import { DicomMessage } from "../src/DicomMessage" ;
6
+ import { DicomMetaDictionary } from "../src/DicomMetaDictionary" ;
7
+ import dcmjs from "../src" ;
8
+
9
+ // The asset downloads in this file might take some time on a slower connection
10
+ jest . setTimeout ( 60000 ) ;
11
+
12
+ it ( "test_normalizer_op" , async ( ) => {
13
+ const file = fs . readFileSync ( 'test/sample-op.dcm' ) ;
14
+ const dicomDict = DicomMessage . readFile ( file . buffer ) ;
15
+
16
+ const dataset = DicomMetaDictionary . naturalizeDataset ( dicomDict . dict ) ;
17
+ const multiframe = dcmjs . normalizers . Normalizer . normalizeToDataset ( [ dataset ] ) ;
18
+
19
+ expect ( dataset . NumberOfFrames ) . toEqual ( 1 ) ;
20
+ expect ( multiframe . NumberOfFrames ) . toEqual ( 1 ) ;
21
+ } ) ;
You can’t perform that action at this time.
0 commit comments