MedicalUltrasound / Image3dAPI

Interface for loading 3D ultrasound data
Other
49 stars 17 forks source link

Clarify expected result of GetECG when no ECG present. #115

Open SteveKauffman opened 5 years ago

SteveKauffman commented 5 years ago

When the TestViewer.exe is run on an image that has no ECG data, we were returning an EcgSeries object with 0 samples.

Unfortunately this causes TestViewer's DrawEcg() method to attempt dividing by zero.

I think we need to clarify what the expected result of GetECG() is in the case that there is no ECG data associated with the image. In C++, it makes sense for GetECG(EcgSeries* ecg) to set 'ecg' to 0. Unclear to me the impact on C# clients of the interface using EcgSeries ecg = m_source.GetECG().

Thoughts?

forderud commented 5 years ago

Good point Steve.

I don't really have any preference on if lack of ECG should be reported as E_FAIL (or other error code) and/or an empty ECG struct, Maybe https://github.com/MedicalUltrasound/Image3dAPI/pull/116 could be a pragmatic solution?