[vtkusers] vtkImageData::SetOrigin didn't take effect

michiel mentink michael.mentink at st-hughs.ox.ac.uk
Tue Mar 2 07:11:24 EST 2010


try using imgdata->GetOrigin()

cheers, Michael

On Tue, Mar 2, 2010 at 10:03 AM, 王君臣 <wangjunchen at gmail.com> wrote:

>
> hi, all
>
> I just encountered a strange thing that when I set the origin of
> vtkImageData, and read it out after the assignment, it turned out that the
> value hasn't changed (hold the value before the assignment).
>
> =====code seg =======
>
>    vtkImageData * imgdata = vNode->GetImageData();
>    double o[3];
>    imgdata->GetOrigin(o); // o is [100, 100, 100]
>    imgdata->SetOrigin(0, 0, 0); // assign origin to [0 0 0]
>    imgdata->GetOrigin(o);// still [100 100 100]
> ====================
>
> something I have to say is that the mehtod SetOrigin will trigger the
> vtkcommand::modifiedevent of the imgdata and in the handler I re-rendered
> the widget which contains the actor of the imgdata. imgdata is not connected
> to the filter, thus there is no possibility that the filter updated the
> imgdata.
>
> I need for your help, thanks.
> --
> Best Regards,
> WANG Junchen
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100302/4025d0af/attachment.htm>


More information about the vtkusers mailing list