[vtkusers] Fwd: RES: panoramic view
sercani
sercanimailgroups at gmail.com
Tue Jun 15 10:12:09 EDT 2010
Luis, i think your problem is with the dimension of the vtkImageData,
you shouldn't set its height to 500 pixels...You should find the
distance between xfm z coordinate and vtkPs's z coordinate and set it to
the height of the vtkImageData...And also you should set the spacing
values according to the original vtkImageData spacings...And i found out
my problem, i was giving the volumetric imagedata as the input of the
probefilter, i reversed it and it gives some results now...When i finish
it, i think we can compare our results....
15.06.2010 16:57, l.a.pereira yazmış:
>
>
> vtkParametricSpline* vtkpPs = vtkParametricSpline::New();
>
> vtkpPs->SetPoints(pts);
>
> vtkParametricFunctionSource* vtkpPfs =
> vtkParametricFunctionSource::New();
>
> vtkpPfs->SetParametricFunction(vtkpPs);
>
> vtkpPfs->SetUResolution(500);
>
> vtkTransform *xfm = vtkTransform::New();
>
> xfm->Translate(0, 0, 70);
>
> vtkTransformPolyDataFilter *xfmPd = vtkTransformPolyDataFilter::New();
>
> xfmPd->SetInput(vtkpPfs->GetOutput());
>
> xfmPd->SetTransform(xfm);
>
> vtkAppendPolyData *appendPD = vtkAppendPolyData::New();
>
> appendPD->AddInput(vtkpPfs->GetOutput());
>
> appendPD->AddInput(xfmPd->GetOutput());
>
> vtkRuledSurfaceFilter *rsf = vtkRuledSurfaceFilter::New();
>
> rsf->SetInputConnection(appendPD->GetOutputPort());
>
> rsf->SetResolution(500, 500);
>
> rsf->SetRuledModeToResample();
>
> rsf->Update();
>
> vtkProbeFilter* probe = vtkProbeFilter::New();
>
> probe->SetInput(rsf->GetOutput());
>
> probe->SetSource(pFrame->m_wndView.m_pImageData);
>
> probe->Update();
>
> vtkImageData *imagedata = vtkImageData::New();
>
> *imagedata->GetPointData()->SetScalars(probe->GetOutput()->GetPointData()->GetScalars());*
>
> imagedata->SetDimensions(500, 500, 1);
>
> imagedata->SetSpacing(1, 1, 1);
>
> imagedata->Update();
>
> vtkImageMapToColors* colorMap = vtkImageMapToColors::New();
>
> colorMap->PassAlphaToOutputOff();
>
> colorMap->SetActiveComponent(0);
>
> colorMap->SetOutputFormatToLuminance();
>
> colorMap->SetInput(imagedata);
>
> colorMap->SetLookupTable(pFrame->m_wndView.m_LookupTable_GrayScale);
>
> this->m_pImageActor = vtkImageActor::New(); //resulting view 3
>
> m_pImageActor->PickableOff();
>
> m_pImageActor->SetInput(colorMap->GetOutput());
>
> m_pImageActor->SetOrigin(0.0, 0.0, 0.0);
>
> m_pImageActor->SetPosition(0.0, 0.0, 0.0);
>
>
>
> ------------------------------------------------------------------------
>
> *Mensagem original*
> *De:* l.a.pereira < l.a.pereira at uol.com.br >
> *Para:* sercanimailgroups at gmail.com,bill.lorensen at gmail.com <
> bill.lorensen at gmail.com >,vtkusers at vtk.org < vtkusers at vtk.org >
> *Assunto:* RES: [vtkusers] panoramic view
> *Enviada:* 15/06/2010 10:51
>
> Sercani Hello,
>
> Unfortunately Bill did not find the example code. But I believe there
> is very little for me to achieve my goal. I also believe that together
> we can solve our problems. I am sending you a piece of code
> responsible for generating the images you can see in the attached
> file. My problem now is that I am not able to generate the final image
> in vtkImagedata. It is being created incorrectly (departure and
> distorted) as you can see the view number 3.
>
> If you can help me solve the distortion in vtkImageData believe we
> will have a solution to our problem. Thanks,From the five points of
> the curve in view 2 I create a spline curve to refer it to
> vtkruledsurface and vrkprobefilter.
>
> Following is the code that generates the image of view 3:
>
> vtkParametricSpline* vtkpPs = vtkParametricSpline::New();
>
> vtkpPs->SetPoints(pts);
>
> vtkParametricFunctionSource* vtkpPfs =
> vtkParametricFunctionSource::New();
>
> vtkpPfs->SetParametricFunction(vtkpPs);
>
> vtkpPfs->SetUResolution(500);
>
> vtkTransform *xfm = vtkTransform::New();
>
> xfm->Translate(0, 0, 70);
>
> vtkTransformPolyDataFilter *xfmPd = vtkTransformPolyDataFilter::New();
>
> xfmPd->SetInput(vtkpPfs->GetOutput());
>
> xfmPd->SetTransform(xfm);
>
> vtkAppendPolyData *appendPD = vtkAppendPolyData::New();
>
> appendPD->AddInput(vtkpPfs->GetOutput());
>
> appendPD->AddInput(xfmPd->GetOutput());
>
> vtkRuledSurfaceFilter *rsf = vtkRuledSurfaceFilter::New();
>
> rsf->SetInputConnection(appendPD->GetOutputPort());
>
> rsf->SetResolution(500, 500);
>
> rsf->SetRuledModeToResample();
>
> rsf->Update();
>
> vtkProbeFilter* probe = vtkProbeFilter::New();
>
> probe->SetInput(rsf->GetOutput());
>
> probe->SetSource(pFrame->m_wndView.m_pImageData);
>
> probe->Update();
>
> vtkImageData *imagedata = vtkImageData::New();
>
> imagedata->GetPointData()->SetScalars(da);
>
> imagedata->SetDimensions(500, 500, 1);
>
> imagedata->SetSpacing(1, 1, 1);
>
> imagedata->Update();
>
> vtkImageMapToColors* colorMap = vtkImageMapToColors::New();
>
> colorMap->PassAlphaToOutputOff();
>
> colorMap->SetActiveComponent(0);
>
> colorMap->SetOutputFormatToLuminance();
>
> colorMap->SetInput(imagedata);
>
> colorMap->SetLookupTable(pFrame->m_wndView.m_LookupTable_GrayScale);
>
> this->m_pImageActor = vtkImageActor::New(); //resulting view 3
>
> m_pImageActor->PickableOff();
>
> m_pImageActor->SetInput(colorMap->GetOutput());
>
> m_pImageActor->SetOrigin(0.0, 0.0, 0.0);
>
> m_pImageActor->SetPosition(0.0, 0.0, 0.0);
>
> -----Mensagem original-----
> De: sercani [mailto:sercanimailgroups at gmail.com]
> Enviada em: terça-feira, 15 de junho de 2010 04:09
> Para: l.a.pereira
> Assunto: Re: [vtkusers] panoramic view
>
> Hi Luis,
>
> Could you manage to solve the panaromic view problem? I have to do the
>
> same thing(curved MPR) but vtkProbeFilter is working very slowly, it
>
> couldn't finish the process while the input data set is a 512*512*48
>
> imagedata and the source is a ruled surface which is created from the
>
> vtkSplineWidget's polydata...If Bill Lorensen send the sample code, can
>
> you also send it to me?
>
> Sercani...
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100615/a8759fb6/attachment.htm>
More information about the vtkusers
mailing list