[vtkusers] vtkImagePlaneWidget and save to jpg

David Gobbi david.gobbi at gmail.com
Tue Oct 5 07:05:08 EDT 2010


Hi Raul,

I think you want a RotateZ(90) here, because the widget has already
transformed the slice from its original orientation to the XY plane.

  David

On Tue, Oct 5, 2010 at 4:51 AM, Raúl Ferriz <raul at torresyvalero.com> wrote:
>  Many thanks Dave!
>
> Now I have another issue: when I save the file to a file, I want that image
> get rotated 90 degrees on Y axis (2D). I tried to do this way:
>
>        _imgdata = imagePlaneWidget->GetResliceOutput();
>        if ( _imgdata )
>        {
>                    // _imgdata is the image data
>                    transform->RotateY ( 90 );
>
>                    transformFilter->SetTransform ( transform );
>                    transformFilter->SetInput ( _imgdata );
>
>                    _imgcast_->SetOutputScalarTypeToUnsignedChar();
>                    _imgcast_->SetInput ( transformFilter->GetOutput() );
>                    _imgcast_->Update ();
>
>                    _writer_->SetFileName ( path );
>                    _writer_->SetInput ( _imgcast_->GetOutput () );
>                    _writer_->Write();
>        }
>
>
> But no rotation is made on saved file.



More information about the vtkusers mailing list