From 1fb232a1162a33097b96114479d6af5314fd4284 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Sun, 4 Aug 2019 11:31:45 +0200 Subject: [PATCH 1/2] API: Extend API with "presentation state" support This will expose a sorted list of slice/rendering "views" that clients can utilize to reconstruct slice/rendering views that are similar to the views shown on screen when saving the original data. Out of scope for now: * The on-screen layout is currently _not_ exposed. Clients will need to handle positioning themselves, which might not match the original layout. * Perspective projections is not currently supported, only a orthographic cube. Clip-planes is similarly not supported either. Implementers will therefore need to expose the orthographic representation that most closely resembles what is displayed on the original system. --- Image3dAPI/IImage3d.idl | 19 +++++++++++++++++++ Image3dAPI/UNREGISTER_Image3dAPI.bat | 1 + 2 files changed, 20 insertions(+) diff --git a/Image3dAPI/IImage3d.idl b/Image3dAPI/IImage3d.idl index e1256ce..a474941 100644 --- a/Image3dAPI/IImage3d.idl +++ b/Image3dAPI/IImage3d.idl @@ -274,6 +274,22 @@ cpp_quote("#else") cpp_quote("static_assert(sizeof(EcgSeries) == 2*8+2*4, \"EcgSeries size mismatch\");") cpp_quote("#endif") + +[object, + oleautomation, // use "automation" marshaler (oleaut32.dll) + uuid(DCAC585F-3EC1-4440-96B6-83090408B027), + helpstring("Interface for retrieving the default slice/rendering 'views' of the 3D data.")] +interface IPresentationState : IUnknown { + [helpstring("Get number of default slice/rendering views.\n" + "Shall return 0 if no default views are available.")] + HRESULT GetViewCount ([out, retval] unsigned int * count); + + [helpstring("Get slice/rendering view by index.\n" + "The views shall by sorted by 'importance'. Clients unable to display all views should therefore display the first 'N' views.\n" + "Slices are indicated by the 'dir3' vector being empty, whereas it is non-empty for renderings.")] + HRESULT GetView ([in] unsigned int index, [out, retval] Cart3dGeom * view); +}; + [ object, oleautomation, // use "automation" marshaler (oleaut32.dll) uuid(D483D815-52DD-4750-8CA2-5C6C489588B6), @@ -297,6 +313,9 @@ interface IImage3dSource : IUnknown { [helpstring("Get ECG data if available [optional]. Shall return S_OK with an empty EcgSeries if EGC is not available.")] HRESULT GetECG ([out,retval] EcgSeries * ecg); + [helpstring("Get presentation state corresponding to the 'views' shown on screen when the data was originally stored [optional].")] + HRESULT GetPresentationState (IPresentationState * pstate); + [helpstring("")] HRESULT GetProbeInfo ([out,retval] ProbeInfo * probe); diff --git a/Image3dAPI/UNREGISTER_Image3dAPI.bat b/Image3dAPI/UNREGISTER_Image3dAPI.bat index 6f6a849..ecea863 100644 --- a/Image3dAPI/UNREGISTER_Image3dAPI.bat +++ b/Image3dAPI/UNREGISTER_Image3dAPI.bat @@ -16,6 +16,7 @@ for %%P in (32 64) do ( :: IImage3d.idl reg delete "HKCR\Interface\{D483D815-52DD-4750-8CA2-5C6C489588B6}" /f /reg:%%P 2> NUL reg delete "HKCR\Interface\{CD30759B-EB38-4469-9CA5-4DF75737A31B}" /f /reg:%%P 2> NUL + reg delete "HKCR\Interface\{DCAC585F-3EC1-4440-96B6-83090408B027}" /f /reg:%%P 2> NUL ) ::pause From b2b9c6a9641b8d8cff8004ab291bb0c5f08b8166 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Wed, 19 Feb 2020 15:52:56 +0100 Subject: [PATCH 2/2] Update DummyLoader after API upgrade Only an API update so far. Actual color-flow support will be added in a later PR. --- DummyLoader/Image3dSource.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DummyLoader/Image3dSource.hpp b/DummyLoader/Image3dSource.hpp index 4806d6b..e0a9692 100644 --- a/DummyLoader/Image3dSource.hpp +++ b/DummyLoader/Image3dSource.hpp @@ -32,6 +32,10 @@ class ATL_NO_VTABLE Image3dSource : HRESULT STDMETHODCALLTYPE GetSopInstanceUID(/*out*/BSTR *uid_str) override; + HRESULT STDMETHODCALLTYPE GetPresentationState(IPresentationState *) override { + return E_NOTIMPL; + } + DECLARE_REGISTRY_RESOURCEID(IDR_Image3dSource) BEGIN_COM_MAP(Image3dSource)