File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ def reorient_volume(self, patvol):
146
146
3d numpy array
147
147
reoriented numpy array in LPS orientation
148
148
"""
149
+
149
150
# check the directions of the norm, col and row dir and revert some axis if necessary
150
151
if (self .normdir == - 1 ):
151
152
patvol = patvol [::- 1 ,:,:]
@@ -372,6 +373,13 @@ def get_multislice_3d_data(self, dcm_data):
372
373
self .v0 /= np .sqrt ((self .v0 ** 2 ).sum ())
373
374
self .v0 *= self .sliceDistance
374
375
376
+ # heuristic modification of v0 and normdir if SpacingBetweenSlices is negative
377
+ # tested on Siemens SPECT data
378
+ if 'SpacingBetweenSlices' in dcm_data :
379
+ if float (dcm_data .SpacingBetweenSlices ) < 0 :
380
+ self .v0 *= - 1
381
+ self .normdir *= - 1
382
+
375
383
ipp = None
376
384
377
385
if 'DetectorInformationSequence' in dcm_data :
@@ -403,6 +411,7 @@ def get_multislice_3d_data(self, dcm_data):
403
411
self .affine [:3 ,2 ] = self .v2
404
412
self .affine [:3 ,3 ] = self .offset
405
413
414
+
406
415
return patvol
407
416
408
417
You can’t perform that action at this time.
0 commit comments