vtkvmtkCurvedMPRImageFilter的使用

vtkPolyData * centerline = vtkPolyData::New();

        vtkSmartPointer< vtkPoints > pointsc= vtkSmartPointer< vtkPoints >::New();
        vtkSmartPointer< vtkCellArray > linesc= vtkSmartPointer< vtkCellArray >::New();

        centerline->SetPoints(pointsc);
        centerline->SetLines(linesc);
        vtkIdType ptIds[2];

        centerline->GetPoints()->SetNumberOfPoints(2);
        centerline->GetLines()->Reset();
        ptIds[0] = 0;
        ptIds[1] = 1;
        centerline->GetLines()->InsertNextCell(2, ptIds);

        vtkPoints *centerlinePoints = centerline->GetPoints();
        double pt1[3]={122.76,122.76,88.5};
        double pt2[3]={0,0,88.5};
        centerlinePoints->SetPoint(0, pt1);
        centerlinePoints->SetPoint(1, pt2);


        vtkSmartPointer<vtkDoubleArray> FSTangents = vtkSmartPointer<vtkDoubleArray>::New();
         FSTangents->SetName("FSTangents");
         FSTangents->SetNumberOfTuples(1);
         FSTangents->InsertNextValue(1.0);
         FSTangents->InsertNextValue(1.0);
         FSTangents->InsertNextValue(1.0);
         centerline->GetPointData()->AddArray(FSTangents);
         centerline->Modified();

         vtkSmartPointer<vtkDoubleArray> ParallelTransportNormals = vtkSmartPointer<vtkDoubleArray>::New();
          ParallelTransportNormals->SetName("ParallelTransportNormals");
          ParallelTransportNormals->SetNumberOfTuples(1);
          ParallelTransportNormals->InsertNextValue(1);
          ParallelTransportNormals->InsertNextValue(1);
          ParallelTransportNormals->InsertNextValue(1);
          centerline->GetPointData()->AddArray(ParallelTransportNormals);
          centerline->Modified();


        auto cpr = vtkvmtkCurvedMPRImageFilter::New();
        cpr->SetInputConnection(myMapToColors->GetOutputPort());
        cpr->SetCenterline(centerline);
        cpr->SetParallelTransportNormalsArrayName("ParallelTransportNormals");

        cpr->SetFrenetTangentArrayName("FSTangents");
        cpr->SetInplaneOutputSpacing(0.4, 0.4);
        cpr->SetInplaneOutputSize(10, 10);
        cpr->SetReslicingBackgroundLevel(0);
        cpr->Update();

 

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值