nipy / heudiconv

Flexible DICOM conversion into structured directory layouts
https://heudiconv.readthedocs.io
Other
232 stars 125 forks source link

reproin: might want to change logic for dups to actually use datetime not seq number #740

Open yarikoptic opened 6 months ago

yarikoptic commented 6 months ago

As discovered in

we could have "wrong" sequence numbers e.g. upon restart of the scanner.

yarikoptic commented 5 months ago

since unlikely to ever become part of the official bids validator, we might need "our own" validation helper to detect such already accomplished problems.

Here is a script from @jungheejung she used to find those problematic cases where __dup functional were longer than non-dups, indicating that non-dup is likely a canceled run: https://github.com/spatialtopology/spacetop-prep/blob/master/spacetop_prep/datalad/remove_dups_anatfmap.sh

also in https://github.com/spatialtopology/spacetop-prep/issues/57#issuecomment-1961651646 I had used following oneliner to sort all sequences by time and not index to spot the problem:

[bids@rolando A004936] > for f in 0*/; do dcmdump +P 0008,0032  $f/0000011.dcm \
 | sed -e 's,\[,,g' -e 's, *#.*,,g' | sort -n -k 4 | tr '\n' ' '; echo  "$f"; done | sort -n -k 3