Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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#ifndef __vtkSlicerGeneralizedReformatLogic_h
24#define __vtkSlicerGeneralizedReformatLogic_h
25
26// Slicer includes
28
29// GeneralizedReformat MRML includes
31
32// MRML includes
35
36// VTK includes
37class vtkMatrix4x4;
38class vtkPoints;
39#include <vtkSmartPointer.h>
40
41// STD includes
42#include <cstdlib>
43#include <map>
44
45#include "vtkSlicerGeneralizedReformatModuleLogicExport.h"
46
47class VTK_SLICER_GENERALIZEDREFORMAT_MODULE_LOGIC_EXPORT vtkSlicerGeneralizedReformatLogic : public vtkSlicerModuleLogic
48{
49public:
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
66 bool GetPointsProjectedToPlane(vtkPoints* pointsArrayIn, vtkMatrix4x4* transformWorldToPlane, vtkPoints* pointsArrayOut);
67
81 bool ComputeStraighteningTransform(vtkMRMLTransformNode* transformToStraightenedNode,
82 vtkMRMLMarkupsCurveNode* curveNode,
83 const double sliceSizeMm[2],
84 double outputSpacingMm,
85 bool stretching = false,
86 double rotationDeg = 0.0,
87 vtkMRMLModelNode* reslicingPlanesModelNode = nullptr);
88
100 bool StraightenVolume(vtkMRMLScalarVolumeNode* outputStraightenedVolume,
101 vtkMRMLScalarVolumeNode* volumeNode,
102 const double outputStraightenedVolumeSpacing[3],
103 vtkMRMLTransformNode* straighteningTransformNode);
104
112 bool ProjectVolume(vtkMRMLScalarVolumeNode* outputProjectedVolume, vtkMRMLScalarVolumeNode* inputStraightenedVolume, int projectionAxisIndex = 0);
113
127 bool ResampleVolume(std::string& resamplerName,
128 vtkMRMLVolumeNode* inputVolume,
129 vtkMRMLVolumeNode* outputVolume,
130 vtkMRMLTransformNode* resamplingTransform,
131 vtkMRMLVolumeNode* referenceVolume = nullptr,
134
137 void RegisterVolumeResampler(const std::string& resamplerName, vtkMRMLAbstractVolumeResampler* resampler);
138 void UnregisterVolumeResampler(const std::string& resamplerName);
139 bool IsVolumeResamplerRegistered(const std::string& resamplerName);
140 vtkMRMLAbstractVolumeResampler* GetVolumeResampler(const std::string& resamplerName);
142
143protected:
146
147 void SetMRMLSceneInternal(vtkMRMLScene* newScene) override;
149 void RegisterNodes() override;
150 void UpdateFromMRMLScene() override;
151 void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
153
155
156 std::map<std::string, vtkSmartPointer<vtkMRMLAbstractVolumeResampler>> Resamplers;
157
158private:
160 void operator=(const vtkSlicerGeneralizedReformatLogic&); // Not implemented
161};
162
163#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())