19 #include "MITKUSTelemedScanConverterPlugin.h"
24 m_ImageMutex(
itk::FastMutexLock::
New()),
30 m_OldnXPelsPerUnit(0),
50 Usgfw2Lib::tagImageResolution resolutionInMetersActual;
51 m_ImageProperties->GetResolution(&resolutionInMetersActual, 0);
52 if (m_OldnXPelsPerUnit != resolutionInMetersActual.nXPelsPerUnit || m_OldnYPelsPerUnit != resolutionInMetersActual.nYPelsPerUnit)
55 if (m_Image.IsNotNull() && m_Image->GetGeometry() != NULL)
57 m_OldnXPelsPerUnit = resolutionInMetersActual.nXPelsPerUnit;
58 m_OldnYPelsPerUnit = resolutionInMetersActual.nYPelsPerUnit;
59 UpdateImageGeometry();
64 if ( m_Image->IsInitialized() )
69 image->Initialize(m_Image->GetPixelType(), m_Image->GetDimension(), m_Image->GetDimensions());
71 image->SetSlice(inputReadAccessor.GetData());
72 image->SetGeometry(m_Image->GetGeometry());
74 m_ImageMutex->Unlock();
81 Usgfw2Lib::tagPixelsOrigin origin = Usgfw2Lib::tagPixelsOrigin();
82 Usgfw2Lib::tagImageResolution resolutionInMeters;
83 m_ImageProperties->GetResolution(&resolutionInMeters,0);
86 spacing[0] = ((double)1 / resolutionInMeters.nXPelsPerUnit) * 1000;
87 spacing[1] = ((double)1 / resolutionInMeters.nXPelsPerUnit) * 1000;
91 if(m_Image.IsNotNull() && (m_Image->GetGeometry()!=NULL))
93 m_Image->GetGeometry()->SetSpacing(spacing);
94 m_Image->GetGeometry()->Modified();
97 {
MITK_WARN <<
"image or geometry was NULL, can't adapt geometry";}
98 m_ImageMutex->Unlock();
101 MITK_DEBUG <<
"depth: " << m_DepthProperties->GetCurrent();
107 IUnknown* tmp_obj = NULL;
113 MITK_ERROR(
"USImageSource")(
"USTelemedImageSource") <<
"Could not create scan converter plugin.";
118 if ( ! m_PluginCallback )
123 m_PluginCallback->SetOutputImage(m_Image.GetPointer(), m_ImageMutex);
129 m_PluginCallback->SetScanConverterPlugin(0);
134 m_Plugin = (Usgfw2Lib::IUsgScanConverterPlugin*)tmp_obj;
135 m_PluginCallback->SetScanConverterPlugin(m_Plugin);
138 m_UsgDataView = usgDataView;
141 if (!m_DepthProperties) {
CREATE_TelemedControl(m_DepthProperties, m_UsgDataView, Usgfw2Lib::IID_IUsgDepth, Usgfw2Lib::IUsgDepth, Usgfw2Lib::SCAN_MODE_B);}
142 if (!m_ImageProperties) {
CREATE_TelemedControl(m_ImageProperties, m_UsgDataView, Usgfw2Lib::IID_IUsgImageProperties, Usgfw2Lib::IUsgImageProperties, Usgfw2Lib::SCAN_MODE_B);}
DataCollection - Class to facilitate loading/accessing structured data.
virtual void GetNextRawImage(mitk::Image::Pointer &)
virtual ~USTelemedImageSource()
Image class for storing images.
bool CreateUsgControl(Usgfw2Lib::IUsgDataView *dataView, const IID &typeId, ULONG scanMode, ULONG streamId, void **ctrl)
Telemed API plugin for getting images from scan lines. Implements a COM interface whereat only the fu...
bool CreateAndConnectConverterPlugin(Usgfw2Lib::IUsgDataView *, Usgfw2Lib::tagScanMode)
Connect this object to the Telemed API. This method is for being used by mitk::USTelemedDevice.
void UpdateImageGeometry()
ImageReadAccessor class to get locked read access for a particular image part.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.