If I could get the scalar value of a point/cell (in world coordinate) on the rendering of 3d vtkImageData?

imageData->GetOutput()->GetPointData()->GetArray(“ImageScalars”);

I also tried the following code:
int* dimension = connector->GetOutput()->GetDimensions();
for (int x = 0; x < dimension[0]; x++)
{
double* pixel = static_cast<double*>(connector->GetOutput()->GetScalarPointer(x, 0, 0));
std::cout << pixel[x] << std::endl;
}

The output:
-6.818e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289
-2.06898e+289

I am wondering what data type to be selected to receive the result pixel.

Take a look at https://kitware.github.io/vtk-examples/site/Cxx/ImageData/IterateImageData/ for an example.