23 m_RepresentationList(), m_TransformPosition(), m_TransformOrientation(), m_RotationMode(RotationStandard)
31 m_RepresentationList.clear();
38 RepresentationPointerMap::const_iterator iter = m_RepresentationList.find(idx);
39 if (iter != m_RepresentationList.end())
47 OffsetPointerMap::const_iterator iter = m_OffsetList.find(index);
48 if (iter != m_OffsetList.end())
61 m_OffsetList[index] =
offset;
74 DataObjectPointerArray inputs = this->GetInputs();
75 for (
unsigned int index=0; index < inputs.size(); index++)
94 MITK_WARN <<
"No BaseData associated with input " << index;
100 if (affineTransform.IsNull())
102 MITK_WARN <<
"AffineTransform IndexToWorldTransform not initialized!";
116 affineTransform->SetIdentity();
118 if (this->GetTransformOrientation(index) ==
true)
124 static AffineTransform3D::MatrixType m;
127 if(m_RotationMode == RotationStandard)
132 vnl_quaternion<double> doubleQuaternion(orientation.x(), orientation.y(), orientation.z(), orientation.r());
133 quatTransform->SetIdentity();
134 quatTransform->SetRotation(doubleQuaternion);
135 quatTransform->Modified();
139 else if(m_RotationMode == RotationTransposed)
141 vnl_matrix_fixed<mitk::ScalarType,3,3> rot = orientation.rotation_matrix_transpose();
142 for(
int i=0; i<3; i++)
for (
int j=0; j<3; j++) m[i][j] = rot[i][j];
144 affineTransform->SetMatrix(m);
147 if (this->GetTransformPosition(index) ==
true)
151 pos.SetVnlVector(nd->
GetPosition().GetVnlVector());
152 affineTransform->SetOffset(pos);
154 affineTransform->Modified();
158 if(offset.IsNotNull())
161 overallTransform->SetIdentity();
162 overallTransform->Compose(offset);
163 overallTransform->Compose(affineTransform);
182 itkDebugMacro(
"setting TransformPosition for index " << index <<
" to " << applyTransform);
183 BooleanInputMap::const_iterator it = this->m_TransformPosition.find(index);
184 if ((it != this->m_TransformPosition.end()) && (it->second == applyTransform))
187 this->m_TransformPosition[index] = applyTransform;
194 itkDebugMacro(
"returning TransformPosition for index " << index);
195 BooleanInputMap::const_iterator it = this->m_TransformPosition.find(index);
196 if (it != this->m_TransformPosition.end())
205 this->SetTransformPosition(index,
true);
211 this->SetTransformPosition(index,
false);
217 itkDebugMacro(
"setting TransformOrientation for index " << index <<
" to " << applyTransform);
218 BooleanInputMap::const_iterator it = this->m_TransformOrientation.find(index);
219 if ((it != this->m_TransformOrientation.end()) && (it->second == applyTransform))
222 this->m_TransformOrientation[index] = applyTransform;
229 itkDebugMacro(
"returning TransformOrientation for index " << index);
230 BooleanInputMap::const_iterator it = this->m_TransformOrientation.find(index);
231 if (it != this->m_TransformOrientation.end())
240 this->SetTransformOrientation(index,
true);
246 this->SetTransformOrientation(index,
false);
itk::SmartPointer< Self > Pointer
void SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing=false)
Set the spacing (m_Spacing).
void SetIndexToWorldTransform(mitk::AffineTransform3D *transform)
Base of all data objects.
void SetRepresentationObject(unsigned int index, BaseData *data)
Set the representation object of the input.
virtual void SetTransformOrientation(unsigned int index, bool applyTransform)
if set to true, the filter will use the orientation part of the input navigation data at the given in...
virtual void TransformOrientationOn(unsigned int index)
sets the TransformOrientation flag to true for the given index
NavigationDataToNavigationDataFilter is the base class of all filters that receive NavigationDatas as...
const mitk::Vector3D GetSpacing() const
Get the spacing (size of a pixel).
virtual void SetDataValid(bool _arg)
sets the dataValid flag of the NavigationData object indicating if the object contains valid data ...
virtual OrientationType GetOrientation() const
returns the orientation of the NavigationData object
mitk::Quaternion OrientationType
Type that holds the orientation part of the tracking data.
virtual void TransformPositionOff(unsigned int index)
sets the TransformPosition flag to false for the given index
~NavigationDataObjectVisualizationFilter()
Destructor.
mitk::AffineTransform3D::Pointer GetOffset(int index)
NavigationDataObjectVisualizationFilter()
Constructor.
const BaseData * GetRepresentationObject(unsigned int idx)
Get the representation object associated with the index idx.
void Modified() const override
Overload of function Modified() to prohibit several calls of Modified() using the ModifiedLock class...
virtual void TransformOrientationOff(unsigned int index)
sets the TransformOrientation flag to false for the given index
virtual bool GetTransformPosition(unsigned int index) const
returns whether position part of the input navigation data at the given index is used for the transfo...
void TransferMatrix(const itk::Matrix< U, NRows, NColumns > &in, itk::Matrix< V, NRows, NColumns > &out)
virtual void SetRotationMode(RotationMode r)
virtual bool IsDataValid() const
returns true if the object contains valid data
virtual PositionType GetPosition() const
returns position of the NavigationData object
virtual void Graft(const DataObject *data) override
Graft the data and information from one NavigationData to another.
virtual void GenerateData() override
virtual void SetTransformPosition(unsigned int index, bool applyTransform)
if set to true, the filter will use the position part of the input navigation data at the given index...
virtual void TransformPositionOn(unsigned int index)
sets the TransformPosition flag to true for the given index
void SetOffset(int index, mitk::AffineTransform3D::Pointer offset)
Defines an offset for a representation object. This offset is applied before the object is visualized...
mitk::BaseGeometry * GetGeometry(int t=0) const
Return the geometry, which is a TimeGeometry, of the data as non-const pointer.
virtual bool GetTransformOrientation(unsigned int index) const
returns whether orientation part of the input navigation data at the given index is used for the tran...
mitk::AffineTransform3D * GetIndexToWorldTransform()
Get the transformation used to convert from index to world coordinates.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.