Conversation
- DICOM import: Write slice timing data using space as delimiter rather than comma; also restrict floating-point precision to that of the precision of the data provided. - dwipreproc: When importing slice timing data, make various attempts to coerce the data into a list of floats.
Rather than setting up 'basestring' depending on Python 2 or 3 in order to test whether or not a variable is of string type, rely on the 'six' module.
|
I have to admit I've not had a chance to get my head around these issues to comment meaningfully. I assume this fix is necessary to fix issues on |
Trouble is that there's three different PRs (#1735, #1738, #1771), all dealing with a common underlying fundamental issue but at different levels and with different scopes. Since #1771 is not mine I don't 100% understand exactly what the overlap is there, and there's also the issue of
I suspect we need to have some exemplar data, on which we can test both |
|
Aborting; given magnitude of issues with JSON data handling, will not be resolving such on |
Extracted changes from #1735 in order to apply to dev. In dwifslpreproc, perform a robust parsing of slice timing information from the image header. During DICOM import, separate slice timings by space rather than comma; although the results of JSON export should be the same following #1771 / #1843, use of space delimiter for vector data is more consistent with other multi-dimensional data handling in image headers.
It seems a bit of a mess has accumulated with respect to JSON data and the handling thereof, which is now having downstream effects at bids-apps/MRtrix3_connectome#59.
In addition to this fix for
master, further modifications will be required ondevto get JSON data handling working properly:The behaviour of
mrinfo -json_keyval/mrinfo -json_allandmrconvert -json_exportdiffers; the latter handles rotation of phase encoding / slice encoding directions while the former do not.While
mrinfo -json_allappropriately writes basic header information in their native data format (e.g. numerical matrix for header transform), the contents ofkeyval()are all written as strings.mrinfowas intended to convert numerical matrix data appropriately, but that seems to not be working right now. It's also the case that simple things like integer values may be better written to JSON as integer values rather than the string representations thereof.