nencki-lobi / bids-flow

Connecting orthanc, heudiconv and mriqc
1 stars 0 forks source link

Check "IsStable" before preprocessing #4

Open bkossows opened 5 years ago

bkossows commented 5 years ago

One should check in sentinel.sh whether patient does not acquire new images.

http://localhost:8080/patients/patient_id -> IsStable

bkossows commented 5 years ago

If not, we could remove existing output (subject’s nifti and .heudiconv) and then convert from scratch

bkossows commented 5 years ago

For studies with pause (and closed) and coil exchange (also closed) we can then check OnStablePatient. This way we prevent from converting the same subject (heudiconv crash) multiple times.

mslw commented 5 years ago

Seems like a good idea. Just one additional thing to take care of. When converting multiple sessions at once, we would have to take care to specify session for heudiconv if there are two of them in the same dicom folder, otherwise it would complain about conflicting session IDs, see #3

bkossows commented 5 years ago

OnStable time has been changed to 30 min. Although there is enough time for most cases, repeated conversions may still happen. In that case:

  1. we should really think about clearing .heudiconv before,
  2. we could potentially stop any running processes (?)
mslw commented 5 years ago

Great, this should cover most cases. I'd still give it an hour, but maybe you're right that we should solve the issue at its root.

Do we know what exactly crashes when new scans arrive after OnStable time (when the machinery is already running)? I think it's heudiconv.

I remember that running heudiconv on the files in /opt/.trash gave me an error about conflicting study IDs. However, is it possible that different study IDs would be generated when files are being sent (potentially) a few times from PACS to mibackup? I might be confusing something here.