File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -529,19 +529,21 @@ def _run_interface(self, runtime):
529529 diff = np .linalg .inv (qform ) @ new_qform
530530 trans , rot , _ , _ = transforms3d .affines .decompose44 (diff )
531531 angle = transforms3d .axangles .mat2axangle (rot )[1 ]
532+ xyz_unit = img .header .get_xyzt_units ()[0 ]
533+ if xyz_unit == "unknown" :
534+ xyz_unit = "mm"
535+
532536 total_trans = np .sqrt (
533537 np .sum (trans * trans )
534538 ) # Add angle and total_trans to report
535539 warning_txt = "Note on orientation: qform matrix overwritten"
536- description = """\
540+ description = f """\
537541 <p class="elem-desc">
538542 The qform has been copied from sform.
539- The difference in angle is {angle:.02g}.
540- The difference in translation is {total_trans:.02g}.
543+ The difference in angle is { angle :.02g} radians .
544+ The difference in translation is { total_trans :.02g} { xyz_unit } .
541545 </p>
542- """ .format (
543- angle = angle , total_trans = total_trans
544- )
546+ """
545547 elif qform_code > 0 :
546548 # qform code indicates the qform is supposed to be valid. Use more stridency.
547549 warning_txt = "WARNING - Invalid qform information"
You can’t perform that action at this time.
0 commit comments