Slicer
4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
#include <Modules/Loadable/Volumes/Logic/vtkSlicerVolumesLogic.h>
Public Types | |
typedef ArchetypeVolumeNodeSet(* | ArchetypeVolumeNodeSetFactory) (std::string &volumeName, vtkMRMLScene *scene, int options) |
enum | LoadingOptions { LabelMap = 1, CenterImage = 2, SingleFile = 4, AutoWindowLevel = 8, DiscardOrientation = 16 } |
Loading options, bitfield. More... | |
typedef vtkSlicerVolumesLogic | Self |
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 | |
vtkMRMLScalarVolumeNode * | AddArchetypeScalarVolume (const char *filename, const char *volname, int loadingOptions, vtkStringArray *fileList) |
vtkMRMLVolumeNode * | AddArchetypeVolume (const char *filename, const char *volname, int loadingOptions) |
vtkMRMLVolumeNode * | AddArchetypeVolume (const char *filename, const char *volname, int loadingOptions, vtkStringArray *fileList) |
vtkMRMLVolumeNode * | AddArchetypeVolume (const char *filename, const char *volname) |
void | CenterVolume (vtkMRMLVolumeNode *volumeNode) |
std::string | CheckForLabelVolumeValidity (vtkMRMLScalarVolumeNode *volumeNode, vtkMRMLLabelMapVolumeNode *labelNode) |
vtkMRMLScalarVolumeNode * | CloneVolume (vtkMRMLVolumeNode *volumeNode, const char *name) |
std::string | CompareVolumeGeometry (vtkMRMLScalarVolumeNode *volumeNode1, vtkMRMLScalarVolumeNode *volumeNode2) |
void | ComputeTkRegVox2RASMatrix (vtkMRMLVolumeNode *VNode, vtkMatrix4x4 *M) |
Convenience method to compute a volume's Vox2RAS-tkreg Matrix. More... | |
vtkMRMLLabelMapVolumeNode * | CreateAndAddLabelVolume (vtkMRMLVolumeNode *volumeNode, const char *name) |
vtkMRMLLabelMapVolumeNode * | CreateAndAddLabelVolume (vtkMRMLScene *scene, vtkMRMLVolumeNode *volumeNode, const char *name) |
Create a label map volume to match the given volumeNode and add it to the scene. More... | |
vtkMRMLLabelMapVolumeNode * | CreateLabelVolume (vtkMRMLVolumeNode *volumeNode, const char *name) |
vtkMRMLLabelMapVolumeNode * | CreateLabelVolume (vtkMRMLScene *scene, vtkMRMLVolumeNode *volumeNode, const char *name) |
vtkMRMLLabelMapVolumeNode * | CreateLabelVolumeFromVolume (vtkMRMLScene *scene, vtkMRMLLabelMapVolumeNode *outputVolume, vtkMRMLVolumeNode *inputVolume) |
vtkMRMLScalarVolumeNode * | CreateScalarVolumeFromVolume (vtkMRMLScene *scene, vtkMRMLScalarVolumeNode *outputVolume, vtkMRMLVolumeNode *inputVolume) |
vtkMRMLLabelMapVolumeNode * | FillLabelVolumeFromTemplate (vtkMRMLLabelMapVolumeNode *labelNode, vtkMRMLVolumeNode *templateNode) |
vtkMRMLLabelMapVolumeNode * | FillLabelVolumeFromTemplate (vtkMRMLScene *scene, vtkMRMLLabelMapVolumeNode *labelNode, vtkMRMLVolumeNode *templateNode) |
vtkMRMLVolumeNode * | GetActiveVolumeNode () const |
virtual const char * | GetClassName () |
vtkMRMLColorLogic * | GetColorLogic () const |
virtual double | GetCompareVolumeGeometryEpsilon () |
virtual int | GetCompareVolumeGeometryPrecision () |
void | GetVolumeCenteredOrigin (vtkMRMLVolumeNode *volumeNode, double *origin) |
virtual int | IsA (const char *type) |
int | IsFreeSurferVolume (const char *filename) |
void | PreRegisterArchetypeVolumeNodeSetFactory (ArchetypeVolumeNodeSetFactory factory) |
void | PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE |
void | RegisterArchetypeVolumeNodeSetFactory (ArchetypeVolumeNodeSetFactory factory) |
int | SaveArchetypeVolume (const char *filename, vtkMRMLVolumeNode *volumeNode) |
Write volume's image data to a specified file. More... | |
void | SetActiveVolumeNode (vtkMRMLVolumeNode *ActiveVolumeNode) |
The currently active mrml volume node. More... | |
virtual void | SetColorLogic (vtkMRMLColorLogic *colorLogic) |
void | SetCompareVolumeGeometryEpsilon (double epsilon) |
void | TranslateFreeSurferRegistrationMatrixIntoSlicerRASToRASMatrix (vtkMRMLVolumeNode *V1Node, vtkMRMLVolumeNode *V2Node, vtkMatrix4x4 *FSRegistrationMatrix, vtkMatrix4x4 *ResultsMatrix) |
Public Member Functions inherited from vtkSlicerModuleLogic | |
virtual vtkSlicerApplicationLogic * | GetApplicationLogic () |
Get access to overall application state. More... | |
std::string | GetModuleShareDirectory () const |
void | PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE |
void | SetModuleShareDirectory (const std::string &shareDirectory) |
Public Member Functions inherited from vtkMRMLAbstractLogic | |
virtual vtkMRMLApplicationLogic * | GetMRMLApplicationLogic () const |
Get access to overall application state. More... | |
vtkMRMLScene * | GetMRMLScene () const |
Return a reference to the current MRML scene. More... | |
void | PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE |
virtual void | SetMRMLApplicationLogic (vtkMRMLApplicationLogic *logic) |
void | SetMRMLScene (vtkMRMLScene *newScene) |
Set and observe the MRMLScene. More... | |
Static Public Member Functions | |
static void | ClearVolumeImageData (vtkMRMLVolumeNode *volumeNode) |
Clear the image data of a volume node to contain all zeros. More... | |
static vtkMRMLScalarVolumeNode * | CloneVolume (vtkMRMLScene *scene, vtkMRMLVolumeNode *volumeNode, const char *name, bool cloneImageData=true) |
static vtkMRMLVolumeNode * | CloneVolumeGeneric (vtkMRMLScene *scene, vtkMRMLVolumeNode *volumeNode, const char *name, bool cloneImageData=true) |
Create a deep copy of a volumeNode and add it to the scene. More... | |
static vtkMRMLScalarVolumeNode * | CloneVolumeWithoutImageData (vtkMRMLScene *scene, vtkMRMLVolumeNode *volumeNode, const char *name) |
static int | IsTypeOf (const char *type) |
static vtkSlicerVolumesLogic * | New () |
static vtkMRMLScalarVolumeNode * | ResampleVolumeToReferenceVolume (vtkMRMLVolumeNode *inputVolumeNode, vtkMRMLVolumeNode *referenceVolumeNode) |
static vtkSlicerVolumesLogic * | SafeDownCast (vtkObject *o) |
Static Public Member Functions inherited from vtkSlicerModuleLogic | |
static int | IsTypeOf (const char *type) |
static vtkSlicerModuleLogic * | New () |
The Usual vtk class functions. More... | |
static vtkSlicerModuleLogic * | SafeDownCast (vtkObject *o) |
Static Public Member Functions inherited from vtkMRMLAbstractLogic | |
static int | IsTypeOf (const char *type) |
static vtkMRMLAbstractLogic * | New () |
static vtkMRMLAbstractLogic * | SafeDownCast (vtkObject *o) |
Protected Types | |
typedef std::list< ArchetypeVolumeNodeSetFactory > | NodeSetFactoryRegistry |
Protected Member Functions | |
vtkMRMLVolumeNode * | AddArchetypeVolume (const NodeSetFactoryRegistry &volumeRegistry, const char *filename, const char *volname, int loadingOptions, vtkStringArray *fileList) |
void | InitializeStorageNode (vtkMRMLStorageNode *storageNode, const char *filename, vtkStringArray *fileList, vtkMRMLScene *mrmlScene=NULL) |
void | operator= (const vtkSlicerVolumesLogic &) |
virtual void | ProcessMRMLNodesEvents (vtkObject *caller, unsigned long event, void *callData) VTK_OVERRIDE |
void | SetAndObserveColorToDisplayNode (vtkMRMLDisplayNode *displayNode, int labelmap, const char *filename) |
vtkSlicerVolumesLogic () | |
vtkSlicerVolumesLogic (const vtkSlicerVolumesLogic &) | |
virtual | ~vtkSlicerVolumesLogic () |
Protected Member Functions inherited from vtkSlicerModuleLogic | |
vtkSlicerModuleLogic () | |
virtual | ~vtkSlicerModuleLogic () |
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 () |
vtkObserverManager * | GetMRMLLogicsObserverManager () const |
vtkCallbackCommand * | GetMRMLNodesCallbackCommand () |
vtkObserverManager * | GetMRMLNodesObserverManager () const |
vtkCallbackCommand * | GetMRMLSceneCallbackCommand () |
vtkObserverManager * | GetMRMLSceneObserverManager () const |
int | GetPendingModifiedEventCount () const |
int | GetProcessingMRMLSceneEvent () const |
Return the event id currently processed or 0 if any. More... | |
int | InvokePendingModifiedEvent () |
virtual void | Modified () VTK_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 | ProcessMRMLSceneEvents (vtkObject *caller, unsigned long event, void *callData) |
virtual void | RegisterNodes () |
void | SetAndObserveMRMLSceneEventsInternal (vtkMRMLScene *newScene, vtkIntArray *events, vtkFloatArray *priorities=0) |
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 () | |
virtual | ~vtkMRMLAbstractLogic () |
Protected Attributes | |
vtkSmartPointer< vtkMRMLVolumeNode > | ActiveVolumeNode |
vtkSmartPointer< vtkMRMLColorLogic > | ColorLogic |
double | CompareVolumeGeometryEpsilon |
int | CompareVolumeGeometryPrecision |
NodeSetFactoryRegistry | VolumeRegistry |
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. More... | |
static void | MRMLNodesCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
MRMLNodesCallback is a static function to relay modified events from the nodes. More... | |
static void | MRMLSceneCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
Definition at line 61 of file vtkSlicerVolumesLogic.h.
typedef ArchetypeVolumeNodeSet(* vtkSlicerVolumesLogic::ArchetypeVolumeNodeSetFactory) (std::string &volumeName, vtkMRMLScene *scene, int options) |
Factory function to create a volume node, display node, and storage node, configure the in the specified scene, and initialize the storage node with the "options".
Definition at line 84 of file vtkSlicerVolumesLogic.h.
|
protected |
Definition at line 308 of file vtkSlicerVolumesLogic.h.
Definition at line 70 of file vtkSlicerVolumesLogic.h.
Definition at line 67 of file vtkSlicerVolumesLogic.h.
Loading options, bitfield.
Enumerator | |
---|---|
LabelMap | |
CenterImage | |
SingleFile | |
AutoWindowLevel | |
DiscardOrientation |
Definition at line 73 of file vtkSlicerVolumesLogic.h.
|
protected |
|
protectedvirtual |
|
protected |
vtkMRMLScalarVolumeNode* vtkSlicerVolumesLogic::AddArchetypeScalarVolume | ( | const char * | filename, |
const char * | volname, | ||
int | loadingOptions, | ||
vtkStringArray * | fileList | ||
) |
Load a scalar volume function directly, bypassing checks of all factories done in AddArchetypeVolume.
|
inline |
Overloaded function of AddArchetypeVolume to provide more loading options, where variable loadingOptions is bit-coded as following: bit 0: label map bit 1: centered bit 2: loading single file bit 3: calculate window level automatically bit 4: discard image orientation higher bits are reserved for future use
Definition at line 126 of file vtkSlicerVolumesLogic.h.
vtkMRMLVolumeNode* vtkSlicerVolumesLogic::AddArchetypeVolume | ( | const char * | filename, |
const char * | volname, | ||
int | loadingOptions, | ||
vtkStringArray * | fileList | ||
) |
|
inline |
Definition at line 131 of file vtkSlicerVolumesLogic.h.
|
protected |
Convenience function allowing to try to load a volume using a given list of NodeSetFactoryRegistry
void vtkSlicerVolumesLogic::CenterVolume | ( | vtkMRMLVolumeNode * | volumeNode | ) |
Center the volume on the origin (0,0,0)
std::string vtkSlicerVolumesLogic::CheckForLabelVolumeValidity | ( | vtkMRMLScalarVolumeNode * | volumeNode, |
vtkMRMLLabelMapVolumeNode * | labelNode | ||
) |
Return a string listing any warnings about the spatial validity of the labelmap with respect to the volume. An empty string indicates that the two volumes are identical samplings of the same spatial region and that the second volume input is a label map.
|
static |
Clear the image data of a volume node to contain all zeros.
vtkMRMLScalarVolumeNode* vtkSlicerVolumesLogic::CloneVolume | ( | vtkMRMLVolumeNode * | volumeNode, |
const char * | name | ||
) |
Create a deep copy of a volumeNode and add it to the current scene. If cloneImageData is false then the volume node is created without image data.
|
static |
Create a deep copy of a volumeNode and add it to the scene Only works for vtkMRMLScalarVolumeNode. The method is kept as is for background compatibility only, internally it calls CloneVolumeGeneric.
|
static |
Create a deep copy of a volumeNode and add it to the scene.
|
static |
Create a empty copy of a volumeNode without imageData and add it to the current scene
std::string vtkSlicerVolumesLogic::CompareVolumeGeometry | ( | vtkMRMLScalarVolumeNode * | volumeNode1, |
vtkMRMLScalarVolumeNode * | volumeNode2 | ||
) |
Generate a string listing any warnings about the spatial validity of the second volume with respect to the first volume. An empty string indicates that the two volumes are identical samplings of the same spatial region. Checks include: Valid image data. Same dimensions. Same spacing. Same origin. Same IJKtoRAS.
void vtkSlicerVolumesLogic::ComputeTkRegVox2RASMatrix | ( | vtkMRMLVolumeNode * | VNode, |
vtkMatrix4x4 * | M | ||
) |
Convenience method to compute a volume's Vox2RAS-tkreg Matrix.
vtkMRMLLabelMapVolumeNode* vtkSlicerVolumesLogic::CreateAndAddLabelVolume | ( | vtkMRMLVolumeNode * | volumeNode, |
const char * | name | ||
) |
Create a label map volume to match the given volumeNode and add it to the current scene
vtkMRMLLabelMapVolumeNode* vtkSlicerVolumesLogic::CreateAndAddLabelVolume | ( | vtkMRMLScene * | scene, |
vtkMRMLVolumeNode * | volumeNode, | ||
const char * | name | ||
) |
Create a label map volume to match the given volumeNode and add it to the scene.
vtkMRMLLabelMapVolumeNode* vtkSlicerVolumesLogic::CreateLabelVolume | ( | vtkMRMLVolumeNode * | volumeNode, |
const char * | name | ||
) |
vtkMRMLLabelMapVolumeNode* vtkSlicerVolumesLogic::CreateLabelVolume | ( | vtkMRMLScene * | scene, |
vtkMRMLVolumeNode * | volumeNode, | ||
const char * | name | ||
) |
vtkMRMLLabelMapVolumeNode* vtkSlicerVolumesLogic::CreateLabelVolumeFromVolume | ( | vtkMRMLScene * | scene, |
vtkMRMLLabelMapVolumeNode * | outputVolume, | ||
vtkMRMLVolumeNode * | inputVolume | ||
) |
Set a label map volume to match the given input volume node, under the assumption that the given label map node is already added to the scene. A display node will be added to it if the label node doesn't already have one, and the image data associated with the label node will be allocated according to the template volumeNode.
vtkMRMLScalarVolumeNode* vtkSlicerVolumesLogic::CreateScalarVolumeFromVolume | ( | vtkMRMLScene * | scene, |
vtkMRMLScalarVolumeNode * | outputVolume, | ||
vtkMRMLVolumeNode * | inputVolume | ||
) |
Set a scalar volume to match the given input volume node, under the assumption that the given label map node is already added to the scene. A display node will be added to it if the label node doesn't already have one, and the image data associated with the label node will be allocated according to the template volumeNode.
vtkMRMLLabelMapVolumeNode* vtkSlicerVolumesLogic::FillLabelVolumeFromTemplate | ( | vtkMRMLLabelMapVolumeNode * | labelNode, |
vtkMRMLVolumeNode * | templateNode | ||
) |
vtkMRMLLabelMapVolumeNode* vtkSlicerVolumesLogic::FillLabelVolumeFromTemplate | ( | vtkMRMLScene * | scene, |
vtkMRMLLabelMapVolumeNode * | labelNode, | ||
vtkMRMLVolumeNode * | templateNode | ||
) |
vtkMRMLVolumeNode* vtkSlicerVolumesLogic::GetActiveVolumeNode | ( | ) | const |
|
virtual |
Reimplemented from vtkSlicerModuleLogic.
vtkMRMLColorLogic* vtkSlicerVolumesLogic::GetColorLogic | ( | ) | const |
|
virtual |
Getting the epsilon value to use when determining if the elements of the IJK to RAS matrices of two volumes match. Defaults to 10 to the minus 6.
|
virtual |
Get the precision with which to print out volume geometry mismatches, value is set when setting the compare volume geometry epsilon.
void vtkSlicerVolumesLogic::GetVolumeCenteredOrigin | ( | vtkMRMLVolumeNode * | volumeNode, |
double * | origin | ||
) |
Compute the origin of the volume in order for the volume to be centered.
|
protected |
|
virtual |
Reimplemented from vtkSlicerModuleLogic.
int vtkSlicerVolumesLogic::IsFreeSurferVolume | ( | const char * | filename | ) |
Examine the file name to see if the extension is one of the supported freesurfer volume formats. Used to assign the proper colour node to label maps.
|
static |
|
static |
|
protected |
void vtkSlicerVolumesLogic::PreRegisterArchetypeVolumeNodeSetFactory | ( | ArchetypeVolumeNodeSetFactory | factory | ) |
Register a factory method that can create and configure a node set (ArchetypeVolumeNodeSet) containing a volume node, display node, and storage node. The nodes are configured within the factory method with default settings and are added to the scene and cross-referenced appropriately. Node types must be registered with the scene beforehand the factory is called. This version inserts the factory at the head of the list, and hence the factory will be tested first, rather than pushing onto the back of the list of factories.
void vtkSlicerVolumesLogic::PrintSelf | ( | ostream & | os, |
vtkIndent | indent | ||
) |
|
protectedvirtual |
Receives all the events fired by the nodes. To listen to a node, you can add an observer using GetMRMLNodesCallbackCommand() or use the utility macros vtk[SetAndObserve|Observe]MRMLNode[Event]Macro ProcessMRMLNodesEvents calls OnMRMLNodeModified when event is vtkCommand::ModifiedEvent.
Reimplemented from vtkMRMLAbstractLogic.
void vtkSlicerVolumesLogic::RegisterArchetypeVolumeNodeSetFactory | ( | ArchetypeVolumeNodeSetFactory | factory | ) |
Register a factory method that can create and configure a node set (ArchetypeVolumeNodeSet) containing a volume node, display node, and storage node. The nodes are configured within the factory method with default settings and are added to the scene and cross-referenced appropriately. Node types must be registered with the scene beforehand the factory is called. Factories are tested in the order they are registered.
|
static |
Convenience method to resample input volume using reference volume info
|
static |
int vtkSlicerVolumesLogic::SaveArchetypeVolume | ( | const char * | filename, |
vtkMRMLVolumeNode * | volumeNode | ||
) |
Write volume's image data to a specified file.
void vtkSlicerVolumesLogic::SetActiveVolumeNode | ( | vtkMRMLVolumeNode * | ActiveVolumeNode | ) |
The currently active mrml volume node.
|
protected |
|
virtual |
void vtkSlicerVolumesLogic::SetCompareVolumeGeometryEpsilon | ( | double | epsilon | ) |
Setting the epsilon value and associated precision to use when determining if the elements of the IJK to RAS matrices of two volumes match and how to print out the mismatched elements.
void vtkSlicerVolumesLogic::TranslateFreeSurferRegistrationMatrixIntoSlicerRASToRASMatrix | ( | vtkMRMLVolumeNode * | V1Node, |
vtkMRMLVolumeNode * | V2Node, | ||
vtkMatrix4x4 * | FSRegistrationMatrix, | ||
vtkMatrix4x4 * | ResultsMatrix | ||
) |
Computes matrix we need to register V1Node to V2Node given the "register.dat" matrix from tkregister2 (FreeSurfer)
|
protected |
Definition at line 318 of file vtkSlicerVolumesLogic.h.
|
protected |
Definition at line 320 of file vtkSlicerVolumesLogic.h.
|
protected |
Allowable difference in comparing volume geometry double values. Defaults to 1 to the power of 10 to the minus 6
Definition at line 326 of file vtkSlicerVolumesLogic.h.
|
protected |
Error print out precision, paried with CompareVolumeGeometryEpsilon. defaults to 6
Definition at line 330 of file vtkSlicerVolumesLogic.h.
|
protected |
Definition at line 322 of file vtkSlicerVolumesLogic.h.