[vtkusers] Reading DICOM using vtkImageActor
Sam Raby
rabysam28 at gmail.com
Fri Mar 21 01:57:19 EDT 2014
Thanks David. Adding SafeDownCast rectified the error, and I can now
change the slice number using vtkImageSliceMapper object.
I initially was going to change the slice number through vtkImageActor, but
the method that is in charge (i.e. SetZSlice) appeared to be not working,
as reported in the past on the link, and hence I thought to change the
slice number via its mapper. Thanks for the help!
http://www.paraview.org/Bug/bug_relationship_graph.php?
bug_id=3661&graph=dependency
-S
On Wed, Mar 19, 2014 at 2:28 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> On Wed, Mar 19, 2014 at 12:59 PM, Sam Raby <rabysam28 at gmail.com> wrote:
> > thanks for the feedback. I am following your solution as below:
> >
> > vtkImageSliceMapper* myMapper = myActor->GetMapper();
> > myMapper->SetSliceNumber(sliceNum);
> >
> > However I am getting the following error:
> >
> > error: invalid conversion from 'vtkImageMapper3D*' to
> 'vtkImageSliceMapper*'
> > [-fpermissive]
> >
> > I was not sure how to address this. Am I missing something here?
>
> Oops, I guess it needs a cast.
>
> vtkImageSliceMapper* myMapper =
> vtkImageSliceMapper::SafeDownCast(myActor->GetMapper());
>
> Perhaps vtkImageActor should have a SetSliceNumber() and
> SetOrientation() method itself, instead of these methods being just in
> the mapper.
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140321/2955e121/attachment.html>
More information about the vtkusers
mailing list