本文整理汇总了C++中mitk::surface::Pointer类的典型用法代码示例。如果您正苦于以下问题:C++ Pointer类的具体用法?C++ Pointer怎么用?C++ Pointer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Pointer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: accessor
void test3DSurfaceIn4DImage()
{
mitk::SurfaceToImageFilter::Pointer surfaceToImageFilter = mitk::SurfaceToImageFilter::New();
mitk::Image::Pointer additionalInputImage = mitk::Image::New();
unsigned int* dims = new unsigned int[4];
dims[0] = 32;
dims[1] = 32;
dims[2] = 32;
dims[3] = 2;
additionalInputImage->Initialize( mitk::MakeScalarPixelType<unsigned int>(),4,dims);
additionalInputImage->SetOrigin(m_Surface->GetGeometry()->GetOrigin());
additionalInputImage->GetGeometry()->SetIndexToWorldTransform(m_Surface->GetGeometry()->GetIndexToWorldTransform());
mitk::Image::Pointer secondStep = additionalInputImage->Clone();
unsigned int size = sizeof(unsigned char);
for (unsigned int i = 0; i < secondStep->GetDimension(); ++i)
size *= secondStep->GetDimension(i);
mitk::ImageWriteAccessor accessor( secondStep );
memset( accessor.GetData(), 1, size );
additionalInputImage->GetTimeGeometry()->Expand(2);
additionalInputImage->GetGeometry(1)->SetSpacing(secondStep->GetGeometry()->GetSpacing());
additionalInputImage->GetGeometry(1)->SetOrigin(secondStep->GetGeometry()->GetOrigin());
additionalInputImage->GetGeometry(1)->SetIndexToWorldTransform(secondStep->GetGeometry()->GetIndexToWorldTransform());
additionalInputImage->SetImportVolume(secondStep->GetData(),0);
additionalInputImage->SetImportVolume(secondStep->GetData(),1);
//Arrange the filter
surfaceToImageFilter->MakeOutputBinaryOn();
surfaceToImageFilter->SetInput(m_Surface);
surfaceToImageFilter->SetImage(additionalInputImage);
surfaceToImageFilter->Update();
mitk::ImagePixelReadAccessor<unsigned char,4> outputReader(surfaceToImageFilter->GetOutput());
itk::Index<4> idx;
bool valuesCorrect = true;
//Values outside the ball should be 0
idx[0] = 0; idx[1] = 0, idx[2] = 0; idx[3] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 0; idx[1] = 15, idx[2] = 15; idx[3] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 15; idx[1] = 15, idx[2] = 0; idx[3] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 15; idx[1] = 0, idx[2] = 15; idx[3] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 5; idx[1] = 9, idx[2] = 23; idx[3] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
//Values inside the ball should be 1 hould be 1
idx[0] = 15; idx[1] = 15, idx[2] = 15; idx[3] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 1);
idx[0] = 31; idx[1] = 15, idx[2] = 15; idx[3] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 1);
idx[0] = 2; idx[1] = 15, idx[2] = 15; idx[3] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 1);
idx[0] = 15; idx[1] = 15, idx[2] = 2; idx[3] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 1);
idx[0] = 15; idx[1] = 2, idx[2] = 15; idx[3] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 1);
idx[0] = 6; idx[1] = 9, idx[2] = 23; idx[3] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 1);
//Values inside the ball but in the second timestep hould be 0
idx[0] = 15; idx[1] = 15, idx[2] = 15; idx[3] = 1; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 31; idx[1] = 15, idx[2] = 15; idx[3] = 1; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 2; idx[1] = 15, idx[2] = 15; idx[3] = 1; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 15; idx[1] = 15, idx[2] = 2; idx[3] = 1; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 15; idx[1] = 2, idx[2] = 15; idx[3] = 1; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 6; idx[1] = 9, idx[2] = 23; idx[3] = 1; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
CPPUNIT_ASSERT_MESSAGE("SurfaceToImageFilter_BallSurfaceAsInput_Output4DCorrect", valuesCorrect == true);
}
示例2: setUp
/**
* @brief Setup Always call this method before each Test-case to ensure correct and new intialization of the used members for a new test case. (If the members are not used in a test, the method does not need to be called).
*/
void setUp() override
{
//generate two sets of points
m_PointsOne = vtkSmartPointer<vtkPoints>::New();
m_PointsOne->InsertNextPoint( 0.0, 0.0, 0.0 );
m_PointsOne->InsertNextPoint( 1.0, 0.0, 0.0 );
m_PointsOne->InsertNextPoint( 0.0, 1.0, 0.0 );
m_PointsOne->InsertNextPoint( 1.0, 1.0, 0.0 );
m_PointsTwo = vtkSmartPointer<vtkPoints>::New();
m_PointsTwo->InsertNextPoint( 0.0, 0.0, 0.0 );
m_PointsTwo->InsertNextPoint( 0.0, 0.0, 2.0 );
m_PointsTwo->InsertNextPoint( 0.0, 1.0, 0.0 );
m_PointsTwo->InsertNextPoint( 0.0, 1.0, 2.0 );
//generate two polygons
vtkSmartPointer<vtkPolygon> polygonOne = vtkSmartPointer<vtkPolygon>::New();
polygonOne->GetPointIds()->SetNumberOfIds(4);
polygonOne->GetPointIds()->SetId(0,0);
polygonOne->GetPointIds()->SetId(1,1);
polygonOne->GetPointIds()->SetId(2,2);
polygonOne->GetPointIds()->SetId(3,3);
vtkSmartPointer<vtkPolygon> polygonTwo = vtkSmartPointer<vtkPolygon>::New();
polygonTwo->GetPointIds()->SetNumberOfIds(4);
polygonTwo->GetPointIds()->SetId(0,3);
polygonTwo->GetPointIds()->SetId(1,2);
polygonTwo->GetPointIds()->SetId(2,0);
polygonTwo->GetPointIds()->SetId(3,1);
//generate polydatas
vtkSmartPointer<vtkCellArray> polygonArrayOne = vtkSmartPointer<vtkCellArray>::New();
polygonArrayOne->InsertNextCell(polygonOne);
m_PolyDataOne = vtkSmartPointer<vtkPolyData>::New();
m_PolyDataOne->SetPoints(m_PointsOne);
m_PolyDataOne->SetPolys(polygonArrayOne);
m_PolygonArrayTwo = vtkSmartPointer<vtkCellArray>::New();
m_PolygonArrayTwo->InsertNextCell(polygonTwo);
vtkSmartPointer<vtkPolyData> polyDataTwo = vtkSmartPointer<vtkPolyData>::New();
polyDataTwo->SetPoints(m_PointsOne);
polyDataTwo->SetPolys(m_PolygonArrayTwo);
//generate surfaces
m_Surface3D = mitk::Surface::New();
m_Surface3D->SetVtkPolyData( m_PolyDataOne );
m_Surface3DTwoTimeSteps = mitk::Surface::New();
m_Surface3DTwoTimeSteps->SetVtkPolyData( m_PolyDataOne, 0 );
m_Surface3DTwoTimeSteps->SetVtkPolyData( polyDataTwo, 1 );
}
示例3: CreateContourPositionInformation
mitk::SurfaceInterpolationController::ContourPositionInformation CreateContourPositionInformation(mitk::Surface::Pointer contour)
{
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo;
contourInfo.contour = contour;
double n[3];
double p[3];
contour->GetVtkPolyData()->GetPoints()->GetPoint(0, p);
vtkPolygon::ComputeNormal(contour->GetVtkPolyData()->GetPoints(), n);
contourInfo.contourNormal = n;
contourInfo.contourPoint = p;
return contourInfo;
}
示例4: Equal_DifferentPoints_ReturnsFalse
void Equal_DifferentPoints_ReturnsFalse()
{
mitk::Surface::Pointer surfaceWithADifferentPoint = m_Surface3D->Clone();
//modify points. m_Surface3D contains m_PointsOne
surfaceWithADifferentPoint->GetVtkPolyData()->SetPoints( m_PointsTwo );
MITK_ASSERT_NOT_EQUAL( m_Surface3D, surfaceWithADifferentPoint, "A surface with a single timestep and different points should not be equal.");
}
示例5:
mitk::Surface::Pointer mitk::SurfaceModifier::DeepCopy(mitk::Surface::Pointer originalSurface)
{
mitk::Surface::Pointer clonedSurface = mitk::Surface::New();
vtkSmartPointer<vtkPolyData> clonedPolyData = vtkPolyData::New();
clonedPolyData->DeepCopy(originalSurface->GetVtkPolyData());
clonedSurface->SetVtkPolyData(clonedPolyData);
return clonedSurface;
}
示例6: CompareSurfacePointPositions
bool CompareSurfacePointPositions(mitk::Surface::Pointer s1, mitk::Surface::Pointer s2)
{
vtkPoints* p1 = s1->GetVtkPolyData()->GetPoints();
vtkPoints* p2 = s2->GetVtkPolyData()->GetPoints();
if(p1->GetNumberOfPoints() != p2->GetNumberOfPoints())
return false;
for(int i = 0; i < p1->GetNumberOfPoints(); ++i)
{
if(p1->GetPoint(i)[0] != p2->GetPoint(i)[0] ||
p1->GetPoint(i)[1] != p2->GetPoint(i)[1] ||
p1->GetPoint(i)[2] != p2->GetPoint(i)[2] )
{
return true;
}
}
return false;
}
示例7: outputReader
void test3DSurfaceCorrect()
{
mitk::SurfaceToImageFilter::Pointer surfaceToImageFilter = mitk::SurfaceToImageFilter::New();
//todo I don't know if this image is always needed. There is no documentation of the filter. Use git blame and ask the author.
mitk::Image::Pointer additionalInputImage = mitk::Image::New();
unsigned int* dims = new unsigned int[3];
dims[0] = 32;
dims[1] = 32;
dims[2] = 32;
additionalInputImage->Initialize( mitk::MakeScalarPixelType<unsigned int>(),3,dims);
additionalInputImage->SetOrigin(m_Surface->GetGeometry()->GetOrigin());
additionalInputImage->GetGeometry()->SetIndexToWorldTransform(m_Surface->GetGeometry()->GetIndexToWorldTransform());
//Arrange the filter
//The docu does not really tell if this is always needed. Could we skip SetImage in any case?
surfaceToImageFilter->MakeOutputBinaryOn();
surfaceToImageFilter->SetInput(m_Surface);
surfaceToImageFilter->SetImage(additionalInputImage);
surfaceToImageFilter->Update();
mitk::ImagePixelReadAccessor<unsigned char,3> outputReader(surfaceToImageFilter->GetOutput());
itk::Index<3> idx;
bool valuesCorrect = true;
//Values outside the ball should be 0
idx[0] = 0; idx[1] = 0, idx[2] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 0; idx[1] = 15, idx[2] = 15; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 15; idx[1] = 15, idx[2] = 0; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 15; idx[1] = 0, idx[2] = 15; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
idx[0] = 5; idx[1] = 9, idx[2] = 23; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 0);
//Values inside the ball should be 1
idx[0] = 15; idx[1] = 15, idx[2] = 15; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 1);
idx[0] = 31; idx[1] = 15, idx[2] = 15; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 1);
idx[0] = 2; idx[1] = 15, idx[2] = 15; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 1);
idx[0] = 15; idx[1] = 15, idx[2] = 2; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 1);
idx[0] = 15; idx[1] = 2, idx[2] = 15; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 1);
idx[0] = 6; idx[1] = 9, idx[2] = 23; valuesCorrect = valuesCorrect && (outputReader.GetPixelByIndex(idx) == 1);
CPPUNIT_ASSERT_MESSAGE("SurfaceToImageFilter_BallSurfaceAsInput_OutputCorrect", valuesCorrect == true);
}
示例8: PerturbePoint
bool mitk::SurfaceModifier::PerturbeSurface(mitk::Surface::Pointer surface, double varianceX, double varianceY, double varianceZ, double maxNoiseVectorLenght)
{
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
points->ShallowCopy(surface->GetVtkPolyData()->GetPoints());
for(unsigned int i = 0; i < points->GetNumberOfPoints(); i++)
{
double p[3];
points->GetPoint(i, p);
mitk::Point3D point;
point[0] = p[0];
point[1] = p[1];
point[2] = p[2];
point = PerturbePoint(point,varianceX,varianceY,varianceZ,maxNoiseVectorLenght);
p[0] = point[0];
p[1] = point[1];
p[2] = point[2];
points->SetPoint(i, p);
}
surface->GetVtkPolyData()->SetPoints(points);
return true;
}
示例9:
void test3DSurfaceValidOutput()
{
mitk::SurfaceToImageFilter::Pointer surfaceToImageFilter = mitk::SurfaceToImageFilter::New();
mitk::Image::Pointer additionalInputImage = mitk::Image::New();
additionalInputImage->Initialize( mitk::MakeScalarPixelType<unsigned int>(), *m_Surface->GetTimeGeometry());
//Arrange the filter
surfaceToImageFilter->MakeOutputBinaryOn();
surfaceToImageFilter->SetInput(m_Surface);
surfaceToImageFilter->SetImage(additionalInputImage);
surfaceToImageFilter->Update();
CPPUNIT_ASSERT_MESSAGE("SurfaceToImageFilter_AnyInputImageAndModeSetToBinary_ResultIsImageWithUCHARPixelType", surfaceToImageFilter->GetOutput()->GetPixelType().GetComponentType() == itk::ImageIOBase::UCHAR);
}
示例10: TransformPoint
bool mitk::SurfaceModifier::TransformSurface(mitk::Surface::Pointer surface, itk::Matrix<double,3,3> TransformationR, itk::Vector<double,3> TransformationT)
{
//apply transformation
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
points->ShallowCopy(surface->GetVtkPolyData()->GetPoints());
for(unsigned int i = 0; i < points->GetNumberOfPoints(); i++)
{
double p[3];
points->GetPoint(i, p);
mitk::Point3D point;
point[0] = p[0];
point[1] = p[1];
point[2] = p[2];
point = TransformPoint(point,TransformationR,TransformationT);
p[0] = point[0];
p[1] = point[1];
p[2] = point[2];
points->SetPoint(i, p);
}
surface->GetVtkPolyData()->SetPoints(points);
return true;
}
示例11: mitkThrow
mitk::DataNode::Pointer QmitkUSNavigationStepPlacementPlanning::CalculatePlanningQuality(
mitk::Surface::Pointer targetSurface, mitk::PointSet::Pointer targetPoints)
{
if ( targetSurface.IsNull() )
{
mitkThrow() << "Target surface must not be null.";
}
m_PlacementQualityCalculator->SetTargetSurface(targetSurface);
m_PlacementQualityCalculator->SetTargetPoints(targetPoints);
m_PlacementQualityCalculator->Update();
mitk::DataNode::Pointer planningQualityResult = mitk::DataNode::New();
planningQualityResult->SetName("PlanningQuality");
double centersOfMassDistance = m_PlacementQualityCalculator->GetCentersOfMassDistance();
ui->centersOfMassValue->setText(QString::number(
centersOfMassDistance, 103, 2) + " mm");
planningQualityResult->SetFloatProperty("USNavigation::CentersOfMassDistance", centersOfMassDistance);
if ( m_PlannedTargetNodes.size() > 1 )
{
double meanAnglesDifference = m_PlacementQualityCalculator->GetMeanAngleDifference();
ui->angleDifferenceValue->setText(QString::number(
meanAnglesDifference, 103, 2) + QString::fromLatin1(" °"));
planningQualityResult->SetFloatProperty("USNavigation::MeanAngleDifference", meanAnglesDifference);
planningQualityResult->SetProperty("USNavigation::AngleDifferences",
mitk::GenericProperty<mitk::VnlVector>::New(m_PlacementQualityCalculator->GetAngleDifferences()));
}
else
{
ui->angleDifferenceValue->setText("not valid for one point");
}
return planningQualityResult;
}
示例12: tool
static void TestRead2()
{
mitk::NavigationToolReader::Pointer myReader = mitk::NavigationToolReader::New();
mitk::NavigationTool::Pointer readTool = myReader->DoRead("TestTool2.tool");
MITK_TEST_OUTPUT(<<"---- Testing navigation tool reader with second tool (aurora tool) ----");
//Test if the surfaces do have the same number of vertexes (it would be better to test for real equality of the surfaces!)
MITK_TEST_CONDITION_REQUIRED(dynamic_cast<mitk::Surface*>(readTool->GetDataNode()->GetData())->GetSizeOfPolyDataSeries()==m_testSurface->GetSizeOfPolyDataSeries(),"Test if surface was restored correctly ...");
//Test if the tool type is the same
MITK_TEST_CONDITION_REQUIRED(readTool->GetType()==mitk::NavigationTool::Instrument,"Testing Tool Type");
MITK_TEST_CONDITION_REQUIRED(readTool->GetTrackingDeviceType()==mitk::NDIAurora,"Testing Tracking Device Type");
MITK_TEST_CONDITION_REQUIRED(readTool->GetSerialNumber()=="0816","Testing Serial Number");
MITK_TEST_CONDITION_REQUIRED(readTool->GetCalibrationFile()=="none","Testing Calibration File");
}
示例13: count
void mitk::SurfaceInterpolationController::ReinitializeInterpolation(mitk::Surface::Pointer contours)
{
// 1. detect coplanar contours
// 2. merge coplanar contours into a single surface
// 4. add contour to pipeline
// Split the surface into separate polygons
vtkSmartPointer<vtkCellArray> existingPolys;
vtkSmartPointer<vtkPoints> existingPoints;
existingPolys = contours->GetVtkPolyData()->GetPolys();
existingPoints = contours->GetVtkPolyData()->GetPoints();
existingPolys->InitTraversal();
vtkSmartPointer<vtkIdList> ids = vtkSmartPointer<vtkIdList>::New();
typedef std::pair<mitk::Vector3D, mitk::Point3D> PointNormalPair;
std::vector<ContourPositionInformation> list;
std::vector<vtkSmartPointer<vtkPoints> > pointsList;
int count (0);
for( existingPolys->InitTraversal(); existingPolys->GetNextCell(ids);)
{
// Get the points
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
existingPoints->GetPoints(ids, points);
++count;
pointsList.push_back(points);
PointNormalPair p_n;
double n[3];
vtkPolygon::ComputeNormal(points, n);
p_n.first = n;
double p[3];
existingPoints->GetPoint(ids->GetId(0), p);
p_n.second = p;
ContourPositionInformation p_info;
p_info.contourNormal = n;
p_info.contourPoint = p;
list.push_back(p_info);
continue;
}
// Detect and sort coplanar polygons
auto outer = list.begin();
std::vector< std::vector< vtkSmartPointer<vtkPoints> > > relatedPoints;
while (outer != list.end())
{
auto inner = outer;
++inner;
std::vector< vtkSmartPointer<vtkPoints> > rel;
auto pointsIter = pointsList.begin();
rel.push_back((*pointsIter));
pointsIter = pointsList.erase(pointsIter);
while (inner != list.end())
{
if(ContoursCoplanar((*outer),(*inner)))
{
inner = list.erase(inner);
rel.push_back((*pointsIter));
pointsIter = pointsList.erase(pointsIter);
}
else
{
++inner;
++pointsIter;
}
}
relatedPoints.push_back(rel);
++outer;
}
// Build the separate surfaces again
std::vector<mitk::Surface::Pointer> finalSurfaces;
for (unsigned int i = 0; i < relatedPoints.size(); ++i)
{
vtkSmartPointer<vtkPolyData> contourSurface = vtkSmartPointer<vtkPolyData>::New();
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
vtkSmartPointer<vtkCellArray> polygons = vtkSmartPointer<vtkCellArray>::New();
unsigned int pointId (0);
for (unsigned int j = 0; j < relatedPoints.at(i).size(); ++j)
{
unsigned int numPoints = relatedPoints.at(i).at(j)->GetNumberOfPoints();
vtkSmartPointer<vtkPolygon> polygon = vtkSmartPointer<vtkPolygon>::New();
polygon->GetPointIds()->SetNumberOfIds(numPoints);
polygon->GetPoints()->SetNumberOfPoints(numPoints);
vtkSmartPointer<vtkPoints> currentPoints = relatedPoints.at(i).at(j);
for (unsigned k = 0; k < numPoints; ++k)
{
points->InsertPoint(pointId, currentPoints->GetPoint(k));
polygon->GetPointIds()->SetId(k, pointId);
++pointId;
}
polygons->InsertNextCell(polygon);
}
contourSurface->SetPoints(points);
contourSurface->SetPolys(polygons);
contourSurface->BuildLinks();
//.........这里部分代码省略.........
示例14: TestInstantiation
static void TestInstantiation()
{
// let's create an object of our class
mitk::TrackingVolumeGenerator::Pointer myTVGenerator = mitk::TrackingVolumeGenerator::New();
MITK_TEST_CONDITION_REQUIRED(myTVGenerator.IsNotNull(),"Testing instantiation");
}
static void TestTrackingSystemNotSpecified()
{
MITK_TEST_OUTPUT(<<"---- Testing Trackingsystem not specified ----");
mitk::TrackingVolumeGenerator::Pointer myTVGenerator = mitk::TrackingVolumeGenerator::New();
MITK_TEST_CONDITION((myTVGenerator->GetTrackingDeviceType() == mitk::TrackingSystemNotSpecified), "Tracking System not specified:");
myTVGenerator->Update();
mitk::Surface::Pointer volume = myTVGenerator->GetOutput();
MITK_TEST_CONDITION((volume->IsEmptyTimeStep(0) == false),"Output contains data");
}
static void TestClaronTrackingVolume()
{
MITK_TEST_OUTPUT(<< "---- Testing MicronTracker 2 Tracking Volume ----");
mitk::TrackingVolumeGenerator::Pointer myTVGenerator = mitk::TrackingVolumeGenerator::New ();
myTVGenerator->SetTrackingDeviceType(mitk::ClaronMicron);
MITK_TEST_CONDITION((myTVGenerator->GetTrackingDeviceType() == mitk::ClaronMicron),"loading MicronTracker Volume data:");
myTVGenerator->Update();
mitk::Surface::Pointer volume = myTVGenerator->GetOutput();
MITK_TEST_CONDITION((volume->IsEmptyTimeStep(0) == false),"Output contains data");
}
static void TestNDIAuroraTrackingVolume()
示例15: TestRead
static void TestRead()
{
mitk::NavigationToolReader::Pointer myReader = mitk::NavigationToolReader::New();
mitk::NavigationTool::Pointer readTool = myReader->DoRead("TestTool.tool");
MITK_TEST_OUTPUT(<<"---- Testing navigation tool reader with first test tool (claron tool) ----");
//Test if the surfaces do have the same number of vertexes (it would be better to test for real equality of the surfaces!)
MITK_TEST_CONDITION_REQUIRED(dynamic_cast<mitk::Surface*>(readTool->GetDataNode()->GetData())->GetSizeOfPolyDataSeries()==m_testSurface->GetSizeOfPolyDataSeries(),"Test if surface was restored correctly ...");
MITK_TEST_CONDITION_REQUIRED(readTool->GetType()==mitk::NavigationTool::Fiducial,"Testing Tool Type");
MITK_TEST_CONDITION_REQUIRED(readTool->GetTrackingDeviceType()==mitk::ClaronMicron,"Testing Tracking Device Type");
MITK_TEST_CONDITION_REQUIRED(readTool->GetSerialNumber()=="0815","Testing Serial Number");
std::ifstream TestFile(readTool->GetCalibrationFile().c_str());
MITK_TEST_CONDITION_REQUIRED(TestFile,"Testing If Calibration File Exists");
}