Skip to content

Commit

Permalink
API: Introduce a new IImage3dStream interface to also support color-f…
Browse files Browse the repository at this point in the history
…low data.
  • Loading branch information
Fredrik Orderud authored and forderud committed Aug 4, 2019
1 parent ee27f8f commit 9c18910
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
42 changes: 35 additions & 7 deletions Image3dAPI/IImage3d.idl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ enum Image3dAPIVersion {
} Image3dAPIVersion;


typedef [
v1_enum, // 32bit enum size
helpstring("Enum of supported image types (extended upon demand).")]
enum ImageType {
IMAGE_TYPE_INVALID = 0, ///< make sure that "cleared" state is invalid
IMAGE_TYPE_TISSUE = 1, ///< grayscale B-mode image
IMAGE_TYPE_BLOOD_VEL = 2, ///< blood velocities (color-flow) (rel. to probe)
} ImageType;

typedef [
v1_enum, // 32bit enum size
helpstring("Enum of supported image formats (extended upon demand).")]
Expand Down Expand Up @@ -285,21 +294,40 @@ 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(D7D2A41A-F738-41EB-8133-1B06DDA1FF40),
helpstring("3D image stream interface. Used to group frames sharing a common type (e.g. tissue or color-flow).")]
interface IImage3dStream : IUnknown {
[helpstring("Get stream type.")]
HRESULT GetType ([out, retval] ImageType * type);

[helpstring("Get the number of frames available")]
HRESULT GetFrameCount ([out, retval] unsigned int * size);

[helpstring("Get the time of all frames (useful for matching frame indices to ECG before retrieving image data) ")]
HRESULT GetFrameTimes ([out, retval] SAFEARRAY(double) * frame_times);

[helpstring("Get image data (const) for a given frame within a specified geometry")]
HRESULT GetFrame ([in] unsigned int index, [out, retval] Image3d * data);
};


[ object,
oleautomation, // use "automation" marshaler (oleaut32.dll)
uuid(D483D815-52DD-4750-8CA2-5C6C489588B6),
helpstring("Interface for retrieving 3D image data.")]
interface IImage3dSource : IUnknown {
[helpstring("Get the number of frames available")]
HRESULT GetFrameCount ([out,retval] unsigned int * size);
[helpstring("Get the number of streams available.")]
HRESULT GetStreamCount ([out, retval] unsigned int * size);

[helpstring("Get the time of all frames (useful for matching frame indices to ECG before retrieving image data) ")]
HRESULT GetFrameTimes ([out, retval] SAFEARRAY(double) * frame_times);
[helpstring("Get cartesian image stream. The geometry and resolution arguments are advisory, and might not be honored.\n"
"Clients should therefore check the actual geometry and resolution of the retrieved stream afterwards.")]
HRESULT GetStream ([in] int index, [in] Cart3dGeom geom, [in] unsigned int max_resolution[3], [out, retval] IImage3dStream ** stream);

[helpstring("Get image data (const) for a given frame within a specified geometry")]
HRESULT GetFrame ([in] unsigned int index, [in] Cart3dGeom geom, [in] unsigned short max_resolution[3], [out,retval] Image3d * data);

[helpstring("Get a bounding box encapsulating all image data. Can be used as intput to GetFrame to avoid cropping.")]
[helpstring("Get a bounding box encapsulating all image data. Can be used as intput to GetStream to avoid cropping.")]
HRESULT GetBoundingBox ([out,retval] Cart3dGeom * geom);

[helpstring("Retrieve color-map table for mapping image intensities to RGBx values. Length depend on format.")]
Expand Down
1 change: 1 addition & 0 deletions Image3dAPI/UNREGISTER_Image3dAPI.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ reg delete "HKCR\TypeLib\{3ff1aab8-f3d8-33d4-825d-00104b3646c0}" /f 2> NUL

for %%P in (32 64) do (
:: IImage3d.idl
reg delete "HKCR\Interface\{D7D2A41A-F738-41EB-8133-1B06DDA1FF40}" /f /reg:%%P 2> NUL
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
)
Expand Down

0 comments on commit 9c18910

Please sign in to comment.