[vtkusers] Reading DICOM using vtkImageActor

David Gobbi david.gobbi at gmail.com
Wed Mar 19 15:28:22 EDT 2014


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


More information about the vtkusers mailing list