@@ -35,28 +35,21 @@ export default function insertSlice(imageData, index, image) {
35
35
}
36
36
37
37
function _getScalingFunctionForModality ( image ) {
38
- const patientStudyModule = cornerstone . metaData . get (
39
- 'patientStudyModule' ,
40
- image . imageId
41
- ) ;
38
+ const { slope, intercept } = image ;
39
+
42
40
const seriesModule = cornerstone . metaData . get (
43
41
'generalSeriesModule' ,
44
42
image . imageId
45
43
) ;
46
44
47
- const { slope, intercept } = image ;
48
-
49
- if ( ! patientStudyModule ) {
50
- throw new Error ( 'patientStudyModule metadata is required' ) ;
51
- }
52
-
53
- if ( ! seriesModule ) {
54
- throw new Error ( 'seriesModule metadata is required' ) ;
55
- }
56
-
57
- const modality = seriesModule . modality ;
58
-
59
- if ( modality === 'PT' ) {
45
+ if ( seriesModule && seriesModule . modality === 'PT' ) {
46
+ const patientStudyModule = cornerstone . metaData . get (
47
+ 'patientStudyModule' ,
48
+ image . imageId
49
+ ) ;
50
+ if ( ! patientStudyModule ) {
51
+ throw new Error ( 'patientStudyModule metadata is required' ) ;
52
+ }
60
53
const patientWeight = patientStudyModule . patientWeight ; // In kg
61
54
62
55
if ( ! patientWeight ) {
@@ -112,7 +105,7 @@ function _getScalingFunctionForModality(image) {
112
105
}
113
106
114
107
function _getSUV ( slope , intercept , patientWeight , correctedDose , pixel ) {
115
- const modalityPixelValue = pixel * slope + intercept ;
108
+ const modalityPixelValue = _getModalityScaledPixel ( slope , intercept , pixel ) ;
116
109
117
110
return ( 1000 * modalityPixelValue * patientWeight ) / correctedDose ;
118
111
}
0 commit comments