In the TwixBuilder.build_mrsdata(), the voxel dimension does not seem to be included when constructing the object, nor returned in the parse_twix_header() method.
However, I can see that it is extracted here:
|
# get voxel size |
|
ro_fov_matches = [ |
|
r"sSpecPara\.sVoI\.dReadoutFOV\s*=\s*(-?[[0-9]*[.]?[0-9]*]{0,})\s*", |
|
r"<ParamDouble.\"VoI_RoFOV\"> { <Precision> \d+( -?[0-9\.]+)? }", |
|
r"<ParamDouble\.\"VoI_RoFOV\">\s*{\s*(-?[0-9\.]+)?\s*}" |
|
] |
|
pe_fov_matches = [ |
|
r"sSpecPara\.sVoI\.dPhaseFOV\s*=\s*(-?[[0-9]*[.]?[0-9]*]{0,})\s*", |
|
r"<ParamDouble.\"VoI_PeFOV\"> { <Precision> \d+( -?[0-9\.]+)? }", |
|
r"<ParamDouble\.\"VoI_PeFOV\">\s*{\s*(-?[0-9\.]+)?\s*}" |
|
] |
|
slice_thickness_matches = [ |
|
r"sSpecPara\.sVoI\.dThickness\s*=\s*(-?[[0-9]*[.]?[0-9]*]{0,})\s*", |
|
r"<ParamDouble.\"VoI_SliceThickness\"> { <Precision> \d+( -?[0-9\.]+)? }", |
|
r"<ParamDouble\.\"VoI_SliceThickness\">\s*{\s*(-?[0-9\.]+)?\s*}" |
|
] |
|
ro_fov = get_meta_regex(ro_fov_matches, header_string, default=0) |
|
pe_fov = get_meta_regex(pe_fov_matches, header_string, default=0) |
|
slice_thickness = get_meta_regex(slice_thickness_matches, header_string, default=0) |
which is then used in transformation_matrix():
|
transform = transformation_matrix(row_vector, |
|
column_vector, |
|
[pos_sag, pos_cor, pos_tra], |
|
[ro_fov, pe_fov, slice_thickness]) |
To confirm, I compared to Siemens' DICOM reader and we can see voxel size/dimension is the last argument of
|
voxel_size = (*csa_header["PixelSpacing"], |
|
csa_header["SliceThickness"]) |
|
transform = transformation_matrix(row_vector, |
|
column_vector, |
|
csa_header["VoiPosition"], |
|
voxel_size) |
In the
TwixBuilder.build_mrsdata(), the voxel dimension does not seem to be included when constructing the object, nor returned in theparse_twix_header()method.TwixBuilder.build_mrsdata()suspect/suspect/io/twix.py
Lines 64 to 70 in 86d3c37
parse_twix_header()suspect/suspect/io/twix.py
Lines 284 to 299 in 86d3c37
However, I can see that it is extracted here:
suspect/suspect/io/twix.py
Lines 179 to 197 in 86d3c37
which is then used in
transformation_matrix():suspect/suspect/io/twix.py
Lines 279 to 282 in 86d3c37
To confirm, I compared to Siemens' DICOM reader and we can see voxel size/dimension is the last argument of
suspect/suspect/io/siemens.py
Lines 176 to 181 in 02fce7f