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.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Portions (c) Copyright Brigham and Women's Hospital (BWH) All Rights Reserved.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16==============================================================================*/
17
18// .NAME vtkSlicerGeneralizedReformatLogic - slicer logic class for volumes manipulation
19// .SECTION Description
20// This class manages the logic associated with reading, saving,
21// and changing propertied of the volumes
22
23
24#ifndef __vtkSlicerGeneralizedReformatLogic_h
25#define __vtkSlicerGeneralizedReformatLogic_h
26
27// Slicer includes
29
30// GeneralizedReformat MRML includes
32
33// MRML includes
36
37// VTK includes
38class vtkMatrix4x4;
39class vtkPoints;
40#include <vtkSmartPointer.h>
41
42// STD includes
43#include <cstdlib>
44#include <map>
45
46#include "vtkSlicerGeneralizedReformatModuleLogicExport.h"
47
48
49class VTK_SLICER_GENERALIZEDREFORMAT_MODULE_LOGIC_EXPORT vtkSlicerGeneralizedReformatLogic :
51{
52public:
53
56 void PrintSelf(ostream& os, vtkIndent indent) override;
57
70 bool GetPointsProjectedToPlane(vtkPoints* pointsArrayIn,
71 vtkMatrix4x4* transformWorldToPlane,
72 vtkPoints* pointsArrayOut);
73
87 bool ComputeStraighteningTransform(vtkMRMLTransformNode* transformToStraightenedNode,
88 vtkMRMLMarkupsCurveNode* curveNode,
89 const double sliceSizeMm[2],
90 double outputSpacingMm,
91 bool stretching = false,
92 double rotationDeg = 0.0,
93 vtkMRMLModelNode* reslicingPlanesModelNode = nullptr);
94
106 bool StraightenVolume(vtkMRMLScalarVolumeNode* outputStraightenedVolume,
107 vtkMRMLScalarVolumeNode* volumeNode,
108 const double outputStraightenedVolumeSpacing[3],
109 vtkMRMLTransformNode* straighteningTransformNode);
110
118 bool ProjectVolume(vtkMRMLScalarVolumeNode* outputProjectedVolume,
119 vtkMRMLScalarVolumeNode* inputStraightenedVolume,
120 int projectionAxisIndex = 0);
121
135 bool ResampleVolume(std::string& resamplerName,
136 vtkMRMLVolumeNode* inputVolume,
137 vtkMRMLVolumeNode* outputVolume,
138 vtkMRMLTransformNode* resamplingTransform,
139 vtkMRMLVolumeNode* referenceVolume = nullptr,
141 const vtkMRMLAbstractVolumeResampler::ResamplingParameters& resamplingParameters =
143
146 void RegisterVolumeResampler(const std::string& resamplerName, vtkMRMLAbstractVolumeResampler* resampler);
147 void UnregisterVolumeResampler(const std::string& resamplerName);
148 bool IsVolumeResamplerRegistered(const std::string& resamplerName);
149 vtkMRMLAbstractVolumeResampler* GetVolumeResampler(const std::string& resamplerName);
151
152protected:
155
156 void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
158 void RegisterNodes() override;
159 void UpdateFromMRMLScene() override;
160 void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
162
164
165 std::map<std::string, vtkSmartPointer<vtkMRMLAbstractVolumeResampler>> Resamplers;
166private:
167
169 void operator=(const vtkSlicerGeneralizedReformatLogic&); // Not implemented
170};
171
172#endif
std::map< std::string, std::string > ResamplingParameters
MRML node to represent a curve markup Curve Markups nodes contain N control points....
MRML node to represent a 3D surface model.
Abstract Superclass for all specific types of MRML nodes.
MRML node for representing a volume (image stack).
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for representing a transformation between this node space and a parent node space.
MRML node for representing a volume (image stack).
void OnMRMLSceneNodeAdded(vtkMRMLNode *node) override
void RegisterNodes() override
Register MRML Node classes to Scene. Gets called automatically when the MRMLScene is attached to this...
void PrintSelf(ostream &os, vtkIndent indent) override
bool ProjectVolume(vtkMRMLScalarVolumeNode *outputProjectedVolume, vtkMRMLScalarVolumeNode *inputStraightenedVolume, int projectionAxisIndex=0)
bool StraightenVolume(vtkMRMLScalarVolumeNode *outputStraightenedVolume, vtkMRMLScalarVolumeNode *volumeNode, const double outputStraightenedVolumeSpacing[3], vtkMRMLTransformNode *straighteningTransformNode)
static vtkSlicerGeneralizedReformatLogic * New()
void SetMRMLSceneInternal(vtkMRMLScene *newScene) override
void UnregisterVolumeResampler(const std::string &resamplerName)
void RegisterVolumeResampler(const std::string &resamplerName, vtkMRMLAbstractVolumeResampler *resampler)
bool IsVolumeResamplerRegistered(const std::string &resamplerName)
std::map< std::string, vtkSmartPointer< vtkMRMLAbstractVolumeResampler > > Resamplers
bool ComputeStraighteningTransform(vtkMRMLTransformNode *transformToStraightenedNode, vtkMRMLMarkupsCurveNode *curveNode, const double sliceSizeMm[2], double outputSpacingMm, bool stretching=false, double rotationDeg=0.0, vtkMRMLModelNode *reslicingPlanesModelNode=nullptr)
vtkMRMLAbstractVolumeResampler * GetVolumeResampler(const std::string &resamplerName)
bool GetPointsProjectedToPlane(vtkPoints *pointsArrayIn, vtkMatrix4x4 *transformWorldToPlane, vtkPoints *pointsArrayOut)
void OnMRMLSceneNodeRemoved(vtkMRMLNode *node) override
bool ResampleVolume(std::string &resamplerName, vtkMRMLVolumeNode *inputVolume, vtkMRMLVolumeNode *outputVolume, vtkMRMLTransformNode *resamplingTransform, vtkMRMLVolumeNode *referenceVolume=nullptr, int interpolationType=vtkMRMLAbstractVolumeResampler::InterpolationTypeLinear, const vtkMRMLAbstractVolumeResampler::ResamplingParameters &resamplingParameters=vtkMRMLAbstractVolumeResampler::ResamplingParameters())