34 #include <vtkRenderer.h> 35 #include <vtkVolumeMapper.h> 36 #include <vtkImageData.h> 64 mPatientModelService(patientModelService)
66 this->setVisualizerType();
78 mTrackedStream = trackedStream;
85 this->newTool(mTrackedStream->getProbeTool());
86 this->newVideoSource(mTrackedStream->getVideoSource());
90 void StreamRep3D::newTool(
ToolPtr tool)
99 ImagePtr image = mTrackedStream->getChangingImage();
103 this->initTransferFunction(image);
105 mVideoSource = videoSource;
110 void StreamRep3D::initTransferFunction(
ImagePtr image)
116 opacity[200] = image->getMaxAlphaValue();
117 tf3D->resetAlpha(opacity);
118 image->setTransferFunctions3D(tf3D);
123 return mTrackedStream;
128 return "StreamRep3D";
131 void StreamRep3D::setVisualizerType()
133 QString visualizerType =
settings()->
value(
"View3D/ImageRender3DVisualizer").toString();
134 if(visualizerType ==
"vtkVolumeTextureMapper3D")
136 else if(visualizerType ==
"vtkGPUVolumeRayCastMapper")
139 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