vtkHardwarePicker and vtkImageData

we are trying to use the vtkHardwarePicker to give information about a user hovered location in a data set. With unstructured grids this seems to be working correctly. However with vtkImageData when the user hovers over a cell (cell centered data) I get information from the extracted surface instead of the cell centered data. I am wondering if we are just using this incorrectly or if there are special hoops I need to jump through when using a vtkImageData?

We use a vtkImageToStructuredGrid and vtkDataSetMapper to show the data on screen. Then here is our function to attempt to get information from the vtkHardwarePicker:

std::string GenerateHoverString()
    int* clickPos = m_VisualizationWidget->renderWindow()->GetInteractor()->GetEventPosition();
    vtkNew<vtkHardwarePicker> picker;
    // pick a dataset
    int const pickResult = picker->Pick(clickPos[0], clickPos[1], 0, m_Renderer);
    if(pickResult == 1)
      vtkDataSet* pickedDataSet = picker->GetDataSet();
      if(pickedDataSet != nullptr)
        vtkIdType cellId = picker->GetCellId();
        vtkIdType pointId = picker->GetPointId();
          return printDataValues(pickedDataSet->GetPointData(), pointId, "Point");
          return printDataValues(pickedDataSet->GetCellData(), cellId, "Cell");
    return {""};

I am hoping this is just a simple misunderstanding on my part on how to use the vtkHardwarePicker. Maybe I need to work my way back up through the vtk pipeline to find the original source instead of what comes out of the vtkImageToStructuredGrid filter?

Why do you use vtkImageToStructuredGrid and not vtkDataSetMapper only?

Honestly, not really sure why. It seemed to work for what we needed so we stuck with it. I am not sure of the actual difference. I’m willing to try what ever though.

Remove it and see what happens.

@Michael_Jackson How are you rendering the image data? Which mapper do you use? If you’re rendering it using the dataset mapper, that just extracts the outer geometry to render - which is why the picker just picks surface cells.