17 #ifndef __itkMetaArrowConverter_txx
18 #define __itkMetaArrowConverter_txx
26 template <
unsigned int NDimensions>
35 template <
unsigned int NDimensions>
42 double spacing[NDimensions];
43 float length=arrow->Length();
45 for(
unsigned int i=0;i<NDimensions;i++)
47 spacing[i]=arrow->ElementSpacing()[i];
52 const double* metaPosition = arrow->Position();
53 const double* metaDirection = arrow->Direction();
56 for (
unsigned int i = 0; i < NDimensions; i++)
58 position[i] = metaPosition[i];
59 direction[i] = metaDirection[i];
61 spatialObject->SetPosition(position);
62 spatialObject->SetDirection(direction);
65 spatialObject->GetIndexToObjectTransform()->SetScaleComponent(spacing);
66 spatialObject->SetLength(length);
67 spatialObject->GetProperty()->SetName(arrow->Name());
68 spatialObject->SetId(arrow->ID());
69 spatialObject->SetParentId(arrow->ParentID());
70 spatialObject->GetProperty()->SetRed(arrow->Color()[0]);
71 spatialObject->GetProperty()->SetGreen(arrow->Color()[1]);
72 spatialObject->GetProperty()->SetBlue(arrow->Color()[2]);
73 spatialObject->GetProperty()->SetAlpha(arrow->Color()[3]);
79 template <
unsigned int NDimensions>
84 MetaArrow* arrow =
new MetaArrow(NDimensions);
86 float length = spatialObject->
GetLength();
90 arrow->ParentID(spatialObject->
GetParent()->GetId());
94 double position[NDimensions];
95 double direction[NDimensions];
98 for (
unsigned int i = 0; i < NDimensions; i++)
100 position[i] = spPosition[i];
101 direction[i] = spDirection[i];
103 arrow->Position(position);
104 arrow->Direction(direction);
108 arrow->ID(spatialObject->
GetId());
115 for(
unsigned int i=0;i<NDimensions;i++)
126 template <
unsigned int NDimensions>
132 MetaArrow* arrow =
new MetaArrow();
134 spatialObject = MetaArrowToArrowSpatialObject(arrow);
136 return spatialObject;
141 template <
unsigned int NDimensions>
146 MetaArrow* arrow = ArrowSpatialObjectToMetaArrow(spatialObject);