13 #include <vtkRenderer.h> 14 #include <vtkVolumeMapper.h> 15 #include <vtkImageData.h> 43 mPatientModelService(patientModelService)
45 this->setVisualizerType();
57 mTrackedStream = trackedStream;
64 this->newTool(mTrackedStream->getProbeTool());
65 this->newVideoSource(mTrackedStream->getVideoSource());
69 void StreamRep3D::newTool(
ToolPtr tool)
78 ImagePtr image = mTrackedStream->getChangingImage();
82 this->initTransferFunction(image);
84 mVideoSource = videoSource;
89 void StreamRep3D::initTransferFunction(
ImagePtr image)
95 opacity[200] = image->getMaxAlphaValue();
96 tf3D->resetAlpha(opacity);
97 image->setTransferFunctions3D(tf3D);
102 return mTrackedStream;
107 return "StreamRep3D";
110 void StreamRep3D::setVisualizerType()
112 QString visualizerType =
settings()->
value(
"View3D/ImageRender3DVisualizer").toString();
113 if(visualizerType ==
"vtkVolumeTextureMapper3D")
115 else if(visualizerType ==
"vtkGPUVolumeRayCastMapper")
118 reportError(QString(
"StreamRep3D::setVisualizerType(): No visualizer found for string=%1").arg(visualizerType));
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
void setTrackedStream(TrackedStreamPtr trackedStream)
void reportError(QString msg)
boost::shared_ptr< class TrackedStream > TrackedStreamPtr
boost::shared_ptr< class Image > ImagePtr
static boost::shared_ptr< REP > wrap_new(REP *object, QString uid)
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
void newVideoSource(VideoSourcePtr videoSource)
boost::shared_ptr< class StreamRep3D > StreamRep3DPtr
void newTool(ToolPtr tool)
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
boost::shared_ptr< class VideoSource > VideoSourcePtr
virtual QString getType() const
Settings * settings()
Shortcut for accessing the settings instance.
virtual void setImage(ImagePtr image)
set the reps image
void setUseGPUVolumeRayCastMapper()
std::map< int, int > IntIntMap
void setUseVolumeTextureMapper()
Display a 3D stream in 3D.
static StreamRep3DPtr New(SpaceProviderPtr spaceProvider, PatientModelServicePtr patientModelService, const QString &uid="")
boost::shared_ptr< class ImageTF3D > ImageTF3DPtr
TrackedStreamPtr getTrackedStream()
void vtkImageDataChangedSlot()
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr