dgobbi / vtk-dicom

A set of classes for using DICOM in VTK.
BSD 3-Clause "New" or "Revised" License
250 stars 94 forks source link

Command-line program for writing tsv files #135

Open dgobbi opened 7 years ago

dgobbi commented 7 years ago

The idea is to have something like dicomtocsv, but for writing tab-separated value files. In fact, it could be an option for dicomtocsv (or there could be a generic program for creating tabular data in various formats).

The advantage of TSV over CSV is that tabs are rare in DICOM. Tabs are only allowed in only LT, ST, UT which are already troublesome due to allowing carriage returns and newlines. In comparison, commas and quotes are allowed in any text VR except for CS, DS, and IS.

The disadvantage is that TSV files are generally not "human readable" because tabs and spaces cannot often be distinguished. Tabs do not always line up the columns, because it is common for some of the values to be longer than a tab. But it is easy to convert TSV files into other formats, and more importantly, TSV files are the standard tabular format for BIDS (Brain Imaging Data Structure).

dgobbi commented 7 years ago

Having dicomdump-like program to output JSON or XML is very closely related to this idea. One program would summarize the data as a table, the other would summarize the data as an object.

As for the names, one would be dicomscan and the other would be dicomdump (i.e. same name as before, with more output options).