ENH: set a flag when DICOM ambiguous ordering fallback is used - #6766
ENH: set a flag when DICOM ambiguous ordering fallback is used#6766seanm wants to merge 1 commit into
Conversation
This flag can be used by callers to know the fallback happened, and warn end users.
|
| { | ||
| // Set a flag so that callers know this fallback occurred, and can show a warning. | ||
| m_DidUseAmbiguousOrdering = true; | ||
| } |
There was a problem hiding this comment.
When the same instance first orders an ambiguous series and then orders a geometrically sortable series, this branch latches m_DidUseAmbiguousOrdering to true, but the successful IPPSorter::Sort path returns without clearing it. SetInputDirectory rebuilds the series map without resetting the member, so callers can warn about or reject the later reliably ordered result. Reset the result for each ordering operation, or explicitly clear it before returning from a successful geometric sort.
| /** @ITKStartGrouping */ | ||
| itkSetMacro(DidUseAmbiguousOrdering, bool); | ||
| itkGetConstMacro(DidUseAmbiguousOrdering, bool); |
There was a problem hiding this comment.
Diagnostic result is publicly mutable
itkSetMacro(DidUseAmbiguousOrdering, bool) and itkBooleanMacro(DidUseAmbiguousOrdering) publish setters that allow callers to clear a real fallback result or fabricate one. Because the generated setter calls Modified(), changing this reporting-only value also invalidates the MTime-based series-map cache. Expose only a getter and keep updates to this result internal to the ordering implementation.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
This flag can be used by callers to know the fallback happened, and warn end users.
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.