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
vtkSlicerCropVolumeLogic Class Reference

Crop a volume to the specified region of interest. More...

#include <Modules/Loadable/CropVolume/Logic/vtkSlicerCropVolumeLogic.h>

Inheritance diagram for vtkSlicerCropVolumeLogic:
Collaboration diagram for vtkSlicerCropVolumeLogic:

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

int Apply (vtkMRMLCropVolumeParametersNode *)
 Crop input volume using the specified ROI node.
 
int CropInterpolated (vtkMRMLDisplayableNode *roi, vtkMRMLVolumeNode *inputVolume, vtkMRMLVolumeNode *outputNode, bool isotropicResampling, double spacingScale, int interpolationMode, double fillValue)
 Perform interpolated cropping.
 
virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void RegisterNodes () override
 
- 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 CropVoxelBased (vtkMRMLDisplayableNode *roi, vtkMRMLVolumeNode *inputVolume, vtkMRMLVolumeNode *outputNode, bool limitToInputExtent=true, double fillValue=0.0)
 
static bool FitROIToInputVolume (vtkMRMLCropVolumeParametersNode *parametersNode)
 
static bool GetInterpolatedCropOutputGeometry (vtkMRMLDisplayableNode *roi, vtkMRMLVolumeNode *inputVolume, bool isotropicResampling, double spacingScale, int outputExtent[6], double outputSpacing[3])
 Computes output volume geometry for interpolated cropping (without actually cropping the image).
 
static bool GetVoxelBasedCropOutputExtent (vtkMRMLDisplayableNode *roi, vtkMRMLVolumeNode *inputVolume, int outputExtent[6], bool limitToInputExtent=false)
 
static bool IsROIAlignedWithInputVolume (vtkMRMLCropVolumeParametersNode *parametersNode)
 
static int IsTypeOf (const char *type)
 
static vtkSlicerCropVolumeLogicNew ()
 
static vtkSlicerCropVolumeLogicSafeDownCast (vtkObject *o)
 
static void SnapROIToVoxelGrid (vtkMRMLCropVolumeParametersNode *parametersNode)
 
- 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

 vtkSlicerCropVolumeLogic ()
 
 ~vtkSlicerCropVolumeLogic () 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 OnMRMLSceneNodeAdded (vtkMRMLNode *)
 
virtual void OnMRMLSceneNodeRemoved (vtkMRMLNode *)
 
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)
 
virtual void SetMRMLSceneInternal (vtkMRMLScene *newScene)
 
void SetProcessingMRMLSceneEvent (int event)
 
bool StartModify ()
 
virtual void UnobserveMRMLScene ()
 
virtual void UpdateFromMRMLScene ()
 
 vtkMRMLAbstractLogic ()
 
 ~vtkMRMLAbstractLogic () override
 

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

Crop a volume to the specified region of interest.

This class implements cropping and resampling of a volume. Two main use cases:

  1. Reduce size (both extent and resolution) of a large volume. Size reduction is useful, as it reduces memory need and makes visualization and processing faster.
  2. Increase resolution of a specific region. Increasing resolution (decreasing voxel size) is useful for segmentation and visualization of fine details.

If interpolation is disabled then only the extent of the volume is decreased. Cropping without resampling is very fast and needs almost no extra memory.

If interpolation is enabled, then both the size and resolution of the volume can be changed.

Limitations:

  • Region of interest (ROI) node cannot be under non-linear transform
  • Cropped output volume node cannot be under non-linear transform
  • If interpolation is disabled: input volume node cannot be under non-linear transform and ROI node must be aligned with the input volume

Definition at line 64 of file vtkSlicerCropVolumeLogic.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkSlicerCropVolumeLogic()

vtkSlicerCropVolumeLogic::vtkSlicerCropVolumeLogic ( )
protected

◆ ~vtkSlicerCropVolumeLogic()

vtkSlicerCropVolumeLogic::~vtkSlicerCropVolumeLogic ( )
overrideprotected

Member Function Documentation

◆ Apply()

int vtkSlicerCropVolumeLogic::Apply ( vtkMRMLCropVolumeParametersNode * )

Crop input volume using the specified ROI node.

◆ CropInterpolated()

int vtkSlicerCropVolumeLogic::CropInterpolated ( vtkMRMLDisplayableNode * roi,
vtkMRMLVolumeNode * inputVolume,
vtkMRMLVolumeNode * outputNode,
bool isotropicResampling,
double spacingScale,
int interpolationMode,
double fillValue )

Perform interpolated cropping.

◆ CropVoxelBased()

static int vtkSlicerCropVolumeLogic::CropVoxelBased ( vtkMRMLDisplayableNode * roi,
vtkMRMLVolumeNode * inputVolume,
vtkMRMLVolumeNode * outputNode,
bool limitToInputExtent = true,
double fillValue = 0.0 )
static

Perform non-interpolated (voxel-based) cropping. If limitToInputExtent is set to true (default) then the extent can only be smaller than the input volume.

◆ FitROIToInputVolume()

static bool vtkSlicerCropVolumeLogic::FitROIToInputVolume ( vtkMRMLCropVolumeParametersNode * parametersNode)
static

Sets ROI to fit to input volume. If ROI is under a non-linear transform then the ROI transform will be reset to RAS.

◆ GetClassName()

virtual const char * vtkSlicerCropVolumeLogic::GetClassName ( )
virtual

Reimplemented from vtkSlicerModuleLogic.

◆ GetInterpolatedCropOutputGeometry()

static bool vtkSlicerCropVolumeLogic::GetInterpolatedCropOutputGeometry ( vtkMRMLDisplayableNode * roi,
vtkMRMLVolumeNode * inputVolume,
bool isotropicResampling,
double spacingScale,
int outputExtent[6],
double outputSpacing[3] )
static

Computes output volume geometry for interpolated cropping (without actually cropping the image).

◆ GetVoxelBasedCropOutputExtent()

static bool vtkSlicerCropVolumeLogic::GetVoxelBasedCropOutputExtent ( vtkMRMLDisplayableNode * roi,
vtkMRMLVolumeNode * inputVolume,
int outputExtent[6],
bool limitToInputExtent = false )
static

Compute non-interpolated (voxel-based) cropping output volume geometry (without actually cropping the image). If limitToInputExtent is set to true (default) then the extent can only be smaller than the input volume.

◆ IsA()

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

Reimplemented from vtkSlicerModuleLogic.

◆ IsROIAlignedWithInputVolume()

static bool vtkSlicerCropVolumeLogic::IsROIAlignedWithInputVolume ( vtkMRMLCropVolumeParametersNode * parametersNode)
static

◆ IsTypeOf()

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

◆ New()

static vtkSlicerCropVolumeLogic * vtkSlicerCropVolumeLogic::New ( )
static

◆ PrintSelf()

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

◆ RegisterNodes()

void vtkSlicerCropVolumeLogic::RegisterNodes ( )
overridevirtual

Register node classes into the MRML scene. Called each time a new scene is set. Do nothing by default. Can be reimplemented in derived classes.

Reimplemented from vtkMRMLAbstractLogic.

◆ SafeDownCast()

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

◆ SnapROIToVoxelGrid()

static void vtkSlicerCropVolumeLogic::SnapROIToVoxelGrid ( vtkMRMLCropVolumeParametersNode * parametersNode)
static

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