How to get image size in vtkimageviewer2 c++?

Hi everyone,

I’m trying to get the image size using vtkimageviewer2 by using this fcn:
virtual int* vtkImageViewer2::GetSize()
currently, I am getting 0 from (imagesmartpointer -> GetSize()). Since the return type is an int, I dereferenced it but it’s not working. So how do I actually access the image size?

virtual int vtkImageViewer2::GetSize ( );
Set/Get the size of the window in screen coordinates in pixels.
I think you can use GetSliceRange () instead.