The IBackprojector interface as of writing (please remember that this is an alpha release and is subjected to major changes in the future) consists of three simple functions.
interface IBackProjectorRenderer : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE
BackProjectPhantom(
/* [in] */ IBackProjector *pIBackProjector,
/* [in] */ IPhantom *pIPhantom,
/* [in] */ IVolume *pIVolume) = 0;
virtual HRESULT STDMETHODCALLTYPE
BackProjectProjection(
/* [in] */ IBackProjector *pIBackProjector,
/* [in] */ IProjection *pIProjection,
/* [in] */ IVolume*pIVolume) = 0;
virtual HRESULT STDMETHODCALLTYPE
BackProjectProjectionCollection(
/* [in] */ IBackProjector *pIBackProjector,
/* [in] */ IProjectionCollection *pIProjectionCollection,
/* [in] */ IVolume *pIVolume) = 0;
};
The first function, BackProjectPhantom, while defined is not currently
supported so for the moment just ignore it.
The second function, BackProjectProjection, is called by a Backprojector
to render into a Volume, as passed as IVolume interface pointer, a single
Projection.
If your backprojection method is smart enough to speed up backprojection
by exploiting groupal properties, ignore BackProjectProjection and implement
only BackProjectProjectionCollection. This function asks for the backprojection
of the entire collection of projections.
interface IBackProjector : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE
SetComputation(
/* [in] */ int ComputationSteps,
/* [in] */ const BSTR DisplayStringWhileComputing) = 0;
virtual HRESULT STDMETHODCALLTYPE
StepComputation( void) = 0;
};
These two methods are used by Strange Engine to display messages in
the Backprojector status bar while the rendering is progressing. Moreover
by calling the SetComputation/StepComputation pair you makes also possible
for Strange Engine to compute rendering times which are reported at the
end of the computation.
interface IVolume : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE
GetVoxelGeometry(
/* [out] */ float *DimX,
/* [out] */ float *DimY,
/* [out] */ float *DimZ,
/* [out] */ float *MinX,
/* [out] */ float *MinY,
/* [out] */ float *MinZ,
/* [out] */ float *MaxX,
/* [out] */ float *MaxY,
/* [out] */ float *MaxZ,
/* [out] */ float *StepX,
/* [out] */ float *StepY,
/* [out] */ float *StepZ,
/* [out] */ int *NumX,
/* [out] */ int *NumY,
/* [out] */ int *NumZ) = 0;
virtual HRESULT STDMETHODCALLTYPE
GetDataPointer(
/* [out] */ float *pData) = 0;
};
The GetVoxelGeometry method is used by the IBackProjectorRenderer implementer
to get information about the volume geometry.
GetDataPointer returns a linear float* pointer in which to write calculated
voxel values.
interface IProjectionCollection : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE
GetHomogeneity(
/* [out] */ BOOL *IsHomogeneous) = 0;
virtual HRESULT STDMETHODCALLTYPE
GetCount(
/* [out] */ int *pProjectionCount) = 0;
virtual HRESULT STDMETHODCALLTYPE
GetAt(
/* [in] */ int Position,
/* [out] */ IListElementStub *pIListElementStub) = 0;
};
IsHomogeneous checks if the given collection is made of similar (i.e.
with same dimensions and pixel number) projections. As of now returns always
TRUE.
GetCount returns the number of projections, while GetAt returns a Stub
interface to the projection in the given Position.
Stub interfaces are used to load and offload projections from memory.
interface IListElementStub : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE
Load( void) = 0;
virtual HRESULT STDMETHODCALLTYPE
OffLoad( void) = 0;
};
Call Load before using the projection and OffLoad after you have done processing it (so Strange Engine can free some memory). You can get a IProjection pointer by QueryInterface on the IListElementStub interface.
interface IProjection : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE
GetRasterGeometry(
/* [out] */ float *DimX,
/* [out] */ float *DimY,
/* [out] */ float *MinX,
/* [out] */ float *MinY,
/* [out] */ float *MaxX,
/* [out] */ float *MaxY,
/* [out] */ float *StepX,
/* [out] */ float *StepY,
/* [out] */ int *NumX,
/* [out] */ int *NumY) = 0;
virtual HRESULT STDMETHODCALLTYPE
GetSourcePosition(
/* [out] */ float *x,
/* [out] */ float *y,
/* [out] */ float *z) = 0;
virtual HRESULT STDMETHODCALLTYPE
GetDetectorCenterPosition(
/* [out] */ float *x,
/* [out] */ float *y,
/* [out] */ float *z) = 0;
virtual HRESULT STDMETHODCALLTYPE
GetDetectorTrajectoryMatrix(
/* [out] */ double m[ 16 ]) = 0;
virtual HRESULT STDMETHODCALLTYPE
GetDataPointer(
/* [out] */ float *pData) = 0;
};
All methods should be self-explaining. The 4 x 4 matrix provided by
GetDetectorTrajectoryMatrix describes the matrix used by the system to
generate the trajectory of the detector. Please note that currently Strange
Engine generates ONLY trajectories of kind circle-on-xz. In the future
interface changes to support more elaborate trajectories are very likely.
This page hosted by
Get your own Free Home Page