Hello I recently used spec2nii to convert some twix data into nifti using version 0.3.4 installed on my institutions cluster computer. I used the command
spec2nii twix -e image -f meas_MID00605_FID73791_svs_edit_mgs_univ.nii --verbose ./meas_MID00605_FID73791_svs_edit_mgs_univ.dat which worked without error. However, I saw there was a newer version 0.8.5 and when we used the exact same command it resulted in the following error:
(neuroimaging) [robert727@c24b-s24 gambit_mrs]$ spec2nii twix -e image -f 2025_ISTHMUS.nii --verbose ./meas_MID00605_FID73791_svs_edit_mgs_univ.dat pymapVBVD version 0.6.1 Software version: VD Converting twix file meas_MID00605_FID73791_svs_edit_mgs_univ.dat. Looking for evalinfo flag image. Found data of size (4096, 44, 320). Normal vector = 0.0018652 -0.1712793 0.9852207. Mainly transverse. Before rotation around S: GP = 0.0000000 0.9852225 0.1712796 GR = -0.9999983 -0.0003195 0.0018376 GS = 0.0018652 -0.1712793 0.9852207 PHI = -0.1061386 After the Rotation around S: GP = -0.0018525 0.9852202 0.1712827 GR = -0.9999965 -0.0021446 0.0015203 GS = 0.0018652 -0.1712793 0.9852207 imagePositionPatient is [ 0.20970789 -43.96756016 19.2684186 ] imageOrientationPatient is [[-0.99999654 -0.00214456 0.00152035] [-0.00185246 0.98522017 0.17128274]] [-0.99999654 -0.00214456 0.00152035 -0.00185246 0.98522017 0.17128274] pixelSpacing is [31. 30.] Normalised ImageOrientationPatient in Q: [[-1. -0. 0. ] [-0. 0.99 0.17] [ 0. 0. 0. ]] After slice normal calculation. Q: [[-1. -0. 0. ] [-0. 0.99 0.17] [-0. 0.17 -0.99]] After scaling. Q: [[-30. -0.06 -0.06] [ -0.06 30.54 5.14] [ 0.05 5.31 -29.56]] Final Q: [[-30. -0.06 -0.06 0.21] [ -0.06 30.54 5.14 -43.97] [ 0.05 5.31 -29.56 19.27] [ 0. 0. 0. 1. ]] Final Q44: [[ 30. 0.06 0.06 -0.21] [ 0.06 -30.54 -5.14 43.97] [ 0.05 5.31 -29.56 19.27] [ 0. 0. 0. 1. ]] Traceback (most recent call last): File "/apps/spec2nii/0.8.5/bin/spec2nii", line 10, in <module> sys.exit(main()) ~~~~^^ File "/apps/spec2nii/0.8.5/lib/python3.13/site-packages/spec2nii/spec2nii.py", line 701, in main spec2nii(*args) ~~~~~~~~^^^^^^^ File "/apps/spec2nii/0.8.5/lib/python3.13/site-packages/spec2nii/spec2nii.py", line 297, in __init__ args.func(args) ~~~~~~~~~^^^^^^ File "/apps/spec2nii/0.8.5/lib/python3.13/site-packages/spec2nii/spec2nii.py", line 518, in twix self.imageOut, self.fileoutNames = process_twix(twixObj, ~~~~~~~~~~~~^^^^^^^^^ args.fileout, ^^^^^^^^^^^^^ ...<4 lines>... args.verbose, ^^^^^^^^^^^^^ remove_os=args.remove_os) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/apps/spec2nii/0.8.5/lib/python3.13/site-packages/spec2nii/Siemens/twixfunctions.py", line 127, in process_twix return process_svs( twixObj, ...<5 lines>... quiet=quiet, verbose=verbose) File "/apps/spec2nii/0.8.5/lib/python3.13/site-packages/spec2nii/Siemens/twixfunctions.py", line 371, in process_svs reord_data, meta_obj, dim_tags = mgs_svs_ed_twix(twixObj, ~~~~~~~~~~~~~~~^^^^^^^^^ reord_data, ^^^^^^^^^^^ meta_obj, ^^^^^^^^^ dim_tags) ^^^^^^^^^ File "/apps/spec2nii/0.8.5/lib/python3.13/site-packages/spec2nii/Siemens/twix_special_case.py", line 129, in mgs_svs_ed_twix seq_mode = twixObj['hdr']['Phoenix'][('sWipMemBlock', 'alFree', '7')] ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: ('sWipMemBlock', 'alFree', '7')
I have attached a good portion of the twix header but let me know if there is any other information that would help. Any help is greatly appreciated!
dat_0605_header.txt
Hello I recently used spec2nii to convert some twix data into nifti using version 0.3.4 installed on my institutions cluster computer. I used the command
spec2nii twix -e image -f meas_MID00605_FID73791_svs_edit_mgs_univ.nii --verbose ./meas_MID00605_FID73791_svs_edit_mgs_univ.datwhich worked without error. However, I saw there was a newer version 0.8.5 and when we used the exact same command it resulted in the following error:(neuroimaging) [robert727@c24b-s24 gambit_mrs]$ spec2nii twix -e image -f 2025_ISTHMUS.nii --verbose ./meas_MID00605_FID73791_svs_edit_mgs_univ.dat pymapVBVD version 0.6.1 Software version: VD Converting twix file meas_MID00605_FID73791_svs_edit_mgs_univ.dat. Looking for evalinfo flag image. Found data of size (4096, 44, 320). Normal vector = 0.0018652 -0.1712793 0.9852207. Mainly transverse. Before rotation around S: GP = 0.0000000 0.9852225 0.1712796 GR = -0.9999983 -0.0003195 0.0018376 GS = 0.0018652 -0.1712793 0.9852207 PHI = -0.1061386 After the Rotation around S: GP = -0.0018525 0.9852202 0.1712827 GR = -0.9999965 -0.0021446 0.0015203 GS = 0.0018652 -0.1712793 0.9852207 imagePositionPatient is [ 0.20970789 -43.96756016 19.2684186 ] imageOrientationPatient is [[-0.99999654 -0.00214456 0.00152035] [-0.00185246 0.98522017 0.17128274]] [-0.99999654 -0.00214456 0.00152035 -0.00185246 0.98522017 0.17128274] pixelSpacing is [31. 30.] Normalised ImageOrientationPatient in Q: [[-1. -0. 0. ] [-0. 0.99 0.17] [ 0. 0. 0. ]] After slice normal calculation. Q: [[-1. -0. 0. ] [-0. 0.99 0.17] [-0. 0.17 -0.99]] After scaling. Q: [[-30. -0.06 -0.06] [ -0.06 30.54 5.14] [ 0.05 5.31 -29.56]] Final Q: [[-30. -0.06 -0.06 0.21] [ -0.06 30.54 5.14 -43.97] [ 0.05 5.31 -29.56 19.27] [ 0. 0. 0. 1. ]] Final Q44: [[ 30. 0.06 0.06 -0.21] [ 0.06 -30.54 -5.14 43.97] [ 0.05 5.31 -29.56 19.27] [ 0. 0. 0. 1. ]] Traceback (most recent call last): File "/apps/spec2nii/0.8.5/bin/spec2nii", line 10, in <module> sys.exit(main()) ~~~~^^ File "/apps/spec2nii/0.8.5/lib/python3.13/site-packages/spec2nii/spec2nii.py", line 701, in main spec2nii(*args) ~~~~~~~~^^^^^^^ File "/apps/spec2nii/0.8.5/lib/python3.13/site-packages/spec2nii/spec2nii.py", line 297, in __init__ args.func(args) ~~~~~~~~~^^^^^^ File "/apps/spec2nii/0.8.5/lib/python3.13/site-packages/spec2nii/spec2nii.py", line 518, in twix self.imageOut, self.fileoutNames = process_twix(twixObj, ~~~~~~~~~~~~^^^^^^^^^ args.fileout, ^^^^^^^^^^^^^ ...<4 lines>... args.verbose, ^^^^^^^^^^^^^ remove_os=args.remove_os) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/apps/spec2nii/0.8.5/lib/python3.13/site-packages/spec2nii/Siemens/twixfunctions.py", line 127, in process_twix return process_svs( twixObj, ...<5 lines>... quiet=quiet, verbose=verbose) File "/apps/spec2nii/0.8.5/lib/python3.13/site-packages/spec2nii/Siemens/twixfunctions.py", line 371, in process_svs reord_data, meta_obj, dim_tags = mgs_svs_ed_twix(twixObj, ~~~~~~~~~~~~~~~^^^^^^^^^ reord_data, ^^^^^^^^^^^ meta_obj, ^^^^^^^^^ dim_tags) ^^^^^^^^^ File "/apps/spec2nii/0.8.5/lib/python3.13/site-packages/spec2nii/Siemens/twix_special_case.py", line 129, in mgs_svs_ed_twix seq_mode = twixObj['hdr']['Phoenix'][('sWipMemBlock', 'alFree', '7')] ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: ('sWipMemBlock', 'alFree', '7')I have attached a good portion of the twix header but let me know if there is any other information that would help. Any help is greatly appreciated!
dat_0605_header.txt