Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkSlicerGeneralizedReformatLogic Class Reference

#include <Modules/Loadable/GeneralizedReformat/Logic/vtkSlicerGeneralizedReformatLogic.h>

Inheritance diagram for vtkSlicerGeneralizedReformatLogic:
Collaboration diagram for vtkSlicerGeneralizedReformatLogic:

Public Types

typedef vtkSlicerModuleLogic Superclass
 
- Public Types inherited from vtkSlicerModuleLogic
typedef vtkMRMLAbstractLogic Superclass
 
- Public Types inherited from vtkMRMLAbstractLogic
typedef vtkObject Superclass
 
typedef void(vtkMRMLAbstractLogic::* TaskFunctionPointer) (void *clientdata)
 

Public Member Functions

bool ComputeStraighteningTransform (vtkMRMLTransformNode *transformToStraightenedNode, vtkMRMLMarkupsCurveNode *curveNode, const double sliceSizeMm[2], double outputSpacingMm, bool stretching=false, double rotationDeg=0.0, vtkMRMLModelNode *reslicingPlanesModelNode=nullptr)
 
virtual const char * GetClassName ()
 
bool GetPointsProjectedToPlane (vtkPoints *pointsArrayIn, vtkMatrix4x4 *transformWorldToPlane, vtkPoints *pointsArrayOut)
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
bool ProjectVolume (vtkMRMLScalarVolumeNode *outputProjectedVolume, vtkMRMLScalarVolumeNode *inputStraightenedVolume, int projectionAxisIndex=0)
 
bool ResampleVolume (std::string &resamplerName, vtkMRMLVolumeNode *inputVolume, vtkMRMLVolumeNode *outputVolume, vtkMRMLTransformNode *resamplingTransform, vtkMRMLVolumeNode *referenceVolume=nullptr, int interpolationType=vtkMRMLAbstractVolumeResampler::InterpolationTypeLinear, const vtkMRMLAbstractVolumeResampler::ResamplingParameters &resamplingParameters=vtkMRMLAbstractVolumeResampler::ResamplingParameters())
 
bool StraightenVolume (vtkMRMLScalarVolumeNode *outputStraightenedVolume, vtkMRMLScalarVolumeNode *volumeNode, const double outputStraightenedVolumeSpacing[3], vtkMRMLTransformNode *straighteningTransformNode)
 
void RegisterVolumeResampler (const std::string &resamplerName, vtkMRMLAbstractVolumeResampler *resampler)
 
void UnregisterVolumeResampler (const std::string &resamplerName)
 
bool IsVolumeResamplerRegistered (const std::string &resamplerName)
 
vtkMRMLAbstractVolumeResamplerGetVolumeResampler (const std::string &resamplerName)
 
- Public Member Functions inherited from vtkSlicerModuleLogic
virtual vtkSlicerApplicationLogicGetApplicationLogic ()
 Get access to overall application state.
 
virtual vtkMRMLAbstractLogicGetModuleLogic (const char *moduleName)
 Convenience method for getting another module's logic from the application logic.
 
std::string GetModuleShareDirectory () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void SetModuleShareDirectory (const std::string &shareDirectory)
 
- Public Member Functions inherited from vtkMRMLAbstractLogic
virtual vtkMRMLApplicationLogicGetMRMLApplicationLogic () const
 Get access to overall application state.
 
vtkMRMLSceneGetMRMLScene () const
 Return a reference to the current MRML scene.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual void SetMRMLApplicationLogic (vtkMRMLApplicationLogic *logic)
 
void SetMRMLScene (vtkMRMLScene *newScene)
 Set and observe the MRMLScene.
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkSlicerGeneralizedReformatLogicNew ()
 
static vtkSlicerGeneralizedReformatLogicSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSlicerModuleLogic
static int IsTypeOf (const char *type)
 
static vtkSlicerModuleLogicNew ()
 The Usual vtk class functions.
 
static vtkSlicerModuleLogicSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkMRMLAbstractLogic
static int IsTypeOf (const char *type)
 
static vtkMRMLAbstractLogicNew ()
 
static vtkMRMLAbstractLogicSafeDownCast (vtkObject *o)
 

Protected Member Functions

void OnMRMLSceneNodeAdded (vtkMRMLNode *node) override
 
void OnMRMLSceneNodeRemoved (vtkMRMLNode *node) override
 
void RegisterNodes () override
 Register MRML Node classes to Scene. Gets called automatically when the MRMLScene is attached to this logic class.
 
void SetMRMLSceneInternal (vtkMRMLScene *newScene) override
 
void UpdateFromMRMLScene () override
 
 vtkSlicerGeneralizedReformatLogic ()
 
 ~vtkSlicerGeneralizedReformatLogic () override
 
- Protected Member Functions inherited from vtkSlicerModuleLogic
 vtkSlicerModuleLogic ()
 
 ~vtkSlicerModuleLogic () override
 
- Protected Member Functions inherited from vtkMRMLAbstractLogic
int EndModify (bool wasModifying)
 
virtual bool EnterMRMLLogicsCallback () const
 
virtual bool EnterMRMLNodesCallback () const
 
virtual bool EnterMRMLSceneCallback () const
 
bool GetDisableModifiedEvent () const
 
int GetInMRMLLogicsCallbackFlag () const
 
int GetInMRMLNodesCallbackFlag () const
 
int GetInMRMLSceneCallbackFlag () const
 
vtkCallbackCommand * GetMRMLLogicsCallbackCommand ()
 
vtkObserverManagerGetMRMLLogicsObserverManager () const
 
vtkCallbackCommand * GetMRMLNodesCallbackCommand ()
 
vtkObserverManagerGetMRMLNodesObserverManager () const
 
vtkCallbackCommand * GetMRMLSceneCallbackCommand ()
 
vtkObserverManagerGetMRMLSceneObserverManager () const
 
int GetPendingModifiedEventCount () const
 
int GetProcessingMRMLSceneEvent () const
 Return the event id currently processed or 0 if any.
 
int InvokePendingModifiedEvent ()
 
void Modified () override
 
virtual void ObserveMRMLScene ()
 
virtual void OnMRMLNodeModified (vtkMRMLNode *)
 
virtual void OnMRMLSceneEndBatchProcess ()
 
virtual void OnMRMLSceneEndClose ()
 
virtual void OnMRMLSceneEndImport ()
 
virtual void OnMRMLSceneEndRestore ()
 
virtual void OnMRMLSceneNew ()
 
virtual void OnMRMLSceneStartBatchProcess ()
 
virtual void OnMRMLSceneStartClose ()
 
virtual void OnMRMLSceneStartImport ()
 
virtual void OnMRMLSceneStartRestore ()
 
virtual void ProcessMRMLLogicsEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void ProcessMRMLNodesEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void ProcessMRMLSceneEvents (vtkObject *caller, unsigned long event, void *callData)
 
void SetAndObserveMRMLSceneEventsInternal (vtkMRMLScene *newScene, vtkIntArray *events, vtkFloatArray *priorities=nullptr)
 
void SetDisableModifiedEvent (bool onOff)
 
void SetInMRMLLogicsCallbackFlag (int flag)
 
void SetInMRMLNodesCallbackFlag (int flag)
 
void SetInMRMLSceneCallbackFlag (int flag)
 
void SetProcessingMRMLSceneEvent (int event)
 
bool StartModify ()
 
virtual void UnobserveMRMLScene ()
 
 vtkMRMLAbstractLogic ()
 
 ~vtkMRMLAbstractLogic () override
 

Protected Attributes

std::map< std::string, vtkSmartPointer< vtkMRMLAbstractVolumeResampler > > Resamplers
 
double TransformSpacingFactor { 5.0 }
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkMRMLAbstractLogic
static void MRMLLogicsCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 MRMLLogicCallback is a static function to relay modified events from the logics.
 
static void MRMLNodesCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 MRMLNodesCallback is a static function to relay modified events from the nodes.
 
static void MRMLSceneCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 

Detailed Description

Definition at line 49 of file vtkSlicerGeneralizedReformatLogic.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkSlicerGeneralizedReformatLogic()

vtkSlicerGeneralizedReformatLogic::vtkSlicerGeneralizedReformatLogic ( )
protected

◆ ~vtkSlicerGeneralizedReformatLogic()

vtkSlicerGeneralizedReformatLogic::~vtkSlicerGeneralizedReformatLogic ( )
overrideprotected

Member Function Documentation

◆ ComputeStraighteningTransform()

bool vtkSlicerGeneralizedReformatLogic::ComputeStraighteningTransform ( vtkMRMLTransformNode * transformToStraightenedNode,
vtkMRMLMarkupsCurveNode * curveNode,
const double sliceSizeMm[2],
double outputSpacingMm,
bool stretching = false,
double rotationDeg = 0.0,
vtkMRMLModelNode * reslicingPlanesModelNode = nullptr )

Compute transform that straightens volume (useful for example for visualization of curved vessels)

Parameters
transformToStraightenedNodethe computed transform
curveNodecurve that defines the planar reformation
sliceSizeMmdimensions of slice that is produced
outputSpacingMmspacing to be used along the curve
stretchingif True then stretching transform will be computed, otherwise straightening
rotationDegnumber of degrees to rotate the output
reslicingPlanesModelNode
Returns
True if the transform computation is successful, false if input parameters are null.
See also
GetPointsProjectedToPlane()

◆ GetClassName()

virtual const char * vtkSlicerGeneralizedReformatLogic::GetClassName ( )
virtual

Reimplemented from vtkSlicerModuleLogic.

◆ GetPointsProjectedToPlane()

bool vtkSlicerGeneralizedReformatLogic::GetPointsProjectedToPlane ( vtkPoints * pointsArrayIn,
vtkMatrix4x4 * transformWorldToPlane,
vtkPoints * pointsArrayOut )

Projects input points onto a specified plane.

Parameters
pointsArrayInInput points in world coordinates.
transformWorldToPlaneTransformation matrix from world to plane coordinates.
pointsArrayOutOutput points projected onto the plane.
Returns
True if projection is successful, false if input parameters are null.

This function transforms input points into the plane's coordinate system, where the plane's normal aligns with the Z-axis. The projection is performed by setting the Z coordinate of each point to zero, effectively flattening it onto the plane. The points are then transformed back into world coordinates and stored in pointsArrayOut.

◆ GetVolumeResampler()

vtkMRMLAbstractVolumeResampler * vtkSlicerGeneralizedReformatLogic::GetVolumeResampler ( const std::string & resamplerName)

◆ IsA()

virtual int vtkSlicerGeneralizedReformatLogic::IsA ( const char * type)
virtual

Reimplemented from vtkSlicerModuleLogic.

◆ IsTypeOf()

static int vtkSlicerGeneralizedReformatLogic::IsTypeOf ( const char * type)
static

◆ IsVolumeResamplerRegistered()

bool vtkSlicerGeneralizedReformatLogic::IsVolumeResamplerRegistered ( const std::string & resamplerName)

◆ New()

static vtkSlicerGeneralizedReformatLogic * vtkSlicerGeneralizedReformatLogic::New ( )
static

◆ OnMRMLSceneNodeAdded()

void vtkSlicerGeneralizedReformatLogic::OnMRMLSceneNodeAdded ( vtkMRMLNode * )
overrideprotectedvirtual

If vtkMRMLScene::NodeAddedEvent has been set to be observed in SetMRMLSceneInternal, it is called when the scene fires the event

See also
ProcessMRMLSceneEvents, SetMRMLSceneInternal
OnMRMLSceneNodeRemoved, vtkMRMLScene::NodeAboutToBeAdded

Reimplemented from vtkMRMLAbstractLogic.

◆ OnMRMLSceneNodeRemoved()

void vtkSlicerGeneralizedReformatLogic::OnMRMLSceneNodeRemoved ( vtkMRMLNode * )
overrideprotectedvirtual

If vtkMRMLScene::NodeRemovedEvent has been set to be observed in SetMRMLSceneInternal, it is called when the scene fires the event

See also
ProcessMRMLSceneEvents, SetMRMLSceneInternal
OnMRMLSceneNodeAdded, vtkMRMLScene::NodeAboutToBeRemoved

Reimplemented from vtkMRMLAbstractLogic.

◆ PrintSelf()

void vtkSlicerGeneralizedReformatLogic::PrintSelf ( ostream & os,
vtkIndent indent )
override

◆ ProjectVolume()

bool vtkSlicerGeneralizedReformatLogic::ProjectVolume ( vtkMRMLScalarVolumeNode * outputProjectedVolume,
vtkMRMLScalarVolumeNode * inputStraightenedVolume,
int projectionAxisIndex = 0 )

Create panoramic volume by mean intensity projection along an axis of the straightened volume

Parameters
outputProjectedVolumeresulting 2-dimensional projection
inputStraightenedVolumeinput volume to be projected
projectionAxisIndexaxis to perform the projection on
Returns
True if the projection volume computation is successful, false if input parameters are null.

◆ RegisterNodes()

void vtkSlicerGeneralizedReformatLogic::RegisterNodes ( )
overrideprotectedvirtual

Register MRML Node classes to Scene. Gets called automatically when the MRMLScene is attached to this logic class.

Reimplemented from vtkMRMLAbstractLogic.

◆ RegisterVolumeResampler()

void vtkSlicerGeneralizedReformatLogic::RegisterVolumeResampler ( const std::string & resamplerName,
vtkMRMLAbstractVolumeResampler * resampler )

Register/unregister resampler.

◆ ResampleVolume()

bool vtkSlicerGeneralizedReformatLogic::ResampleVolume ( std::string & resamplerName,
vtkMRMLVolumeNode * inputVolume,
vtkMRMLVolumeNode * outputVolume,
vtkMRMLTransformNode * resamplingTransform,
vtkMRMLVolumeNode * referenceVolume = nullptr,
int interpolationType = vtkMRMLAbstractVolumeResampler::InterpolationTypeLinear,
const vtkMRMLAbstractVolumeResampler::ResamplingParameters & resamplingParameters = vtkMRMLAbstractVolumeResampler::ResamplingParameters() )

Resample volume using the registered resampler.

Parameters
resamplerNamethe name as registered with vtkMRMLApplicationLogic
inputVolumethe volume to be resampled
outputVolumethe resulting volume
resamplingTransformthe transform to apply
referenceVolume
interpolationTypesee enum in vtkMRMLAbstractVolumeResampler.h
resamplingParametersreserved for future use
Returns
True if the volume resampling computation is successful, false if input parameters are null.
See also
vtkMRMLApplicationLogic::GetVolumeResampler()

◆ SafeDownCast()

static vtkSlicerGeneralizedReformatLogic * vtkSlicerGeneralizedReformatLogic::SafeDownCast ( vtkObject * o)
static

◆ SetMRMLSceneInternal()

void vtkSlicerGeneralizedReformatLogic::SetMRMLSceneInternal ( vtkMRMLScene * newScene)
overrideprotectedvirtual

Called each time a new scene is set. Can be reimplemented in derived classes. Doesn't observe the scene by default, that means that UpdateFromMRMLScene() won't be called by default when a scene is imported, closed or restored, only when a new scene is set.

See also
SetAndObserveMRMLSceneInternal() SetAndObserveMRMLSceneEventsInternal()
UpdateFromMRMLScene()

Reimplemented from vtkMRMLAbstractLogic.

◆ StraightenVolume()

bool vtkSlicerGeneralizedReformatLogic::StraightenVolume ( vtkMRMLScalarVolumeNode * outputStraightenedVolume,
vtkMRMLScalarVolumeNode * volumeNode,
const double outputStraightenedVolumeSpacing[3],
vtkMRMLTransformNode * straighteningTransformNode )

Straighten volume for curved planar reformation

Parameters
outputStraightenedVolumeresult of straightening computation
volumeNodeinput volume to be straightened
outputStraightenedVolumeSpacingspacing in the output volume
straighteningTransformNodetransform to be applied
Returns
True if the volume computation is successful, false if input parameters are null.
See also
vtkMRMLApplicationLogic::IsVolumeResamplerRegistered()
ResampleVolume()

◆ UnregisterVolumeResampler()

void vtkSlicerGeneralizedReformatLogic::UnregisterVolumeResampler ( const std::string & resamplerName)

◆ UpdateFromMRMLScene()

void vtkSlicerGeneralizedReformatLogic::UpdateFromMRMLScene ( )
overrideprotectedvirtual

Called every time the scene has been significantly changed. If the scene BatchProcessState events are observed (in SetMRMLSceneInternal() ), UpdateFromMRMLScene is called after each batch process (Close, Import, Restore...). It is also being called by default when a new scene is set (SetMRMLScene).

See also
SetMRMLSceneInternal, UnobserveMRMLScene, ObserveMRMLScene

Reimplemented from vtkMRMLAbstractLogic.

Member Data Documentation

◆ Resamplers

std::map<std::string, vtkSmartPointer<vtkMRMLAbstractVolumeResampler> > vtkSlicerGeneralizedReformatLogic::Resamplers
protected

Definition at line 165 of file vtkSlicerGeneralizedReformatLogic.h.

◆ TransformSpacingFactor

double vtkSlicerGeneralizedReformatLogic::TransformSpacingFactor { 5.0 }
protected

Definition at line 163 of file vtkSlicerGeneralizedReformatLogic.h.


The documentation for this class was generated from the following file: