Slicer
4.11
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 () |
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) 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... | |
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... | |
virtual vtkMRMLAbstractLogic * | GetModuleLogic (const char *moduleName) |
Convenience method for getting another module's logic from the application logic. More... | |
std::string | GetModuleShareDirectory () const |
void | PrintSelf (ostream &os, vtkIndent indent) 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) 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 Attributes | |
vtkSmartPointer< vtkMRMLVolumeNode > | ActiveVolumeNode |
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 63 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 86 of file vtkSlicerVolumesLogic.h.
|
protected |
Definition at line 307 of file vtkSlicerVolumesLogic.h.
Definition at line 72 of file vtkSlicerVolumesLogic.h.
Definition at line 69 of file vtkSlicerVolumesLogic.h.
Loading options, bitfield.
Enumerator | |
---|---|
LabelMap | |
CenterImage | |
SingleFile | |
AutoWindowLevel | |
DiscardOrientation |
Definition at line 75 of file vtkSlicerVolumesLogic.h.
|
protected |
|
overrideprotected |
|
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 125 of file vtkSlicerVolumesLogic.h.
vtkMRMLVolumeNode* vtkSlicerVolumesLogic::AddArchetypeVolume | ( | const char * | filename, |
const char * | volname, | ||
int | loadingOptions, | ||
vtkStringArray * | fileList | ||
) |
|
inline |
Definition at line 130 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.
|
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.
|
override |
|
overrideprotectedvirtual |
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 |
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 317 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 323 of file vtkSlicerVolumesLogic.h.
|
protected |
Error print out precision, paried with CompareVolumeGeometryEpsilon. defaults to 6
Definition at line 327 of file vtkSlicerVolumesLogic.h.
|
protected |
Definition at line 319 of file vtkSlicerVolumesLogic.h.