I understand that you want to preserve the 'index' value of DICOM images in the 3D plots. To achieve this you can cretae custom tooltip by using MATLAB 'datacursormode' function.
Here is an example implementing custom data tooltip.
img=dicomread('dcmImage.dcm');
index = img';
dcm = datacursormode(gcf);
set(dcm, 'Enable', 'on', 'UpdateFcn', @(src, event_obj) myDataCursor(src, event_obj, img));
% Define the custom data cursor function
function txt = myDataCursor(~, info, img)
x = info.Position(1);
y = info.Position(2);
z=img(x,y);
myDatatipText = "(x: %s, y: %s, index: %s)";
txt = sprintf(myDatatipText, num2str(x), num2str(y),num2str(z));
end
For more information, please refer to MATLAB documentation on 'datacursormode' function.
Hope this helps in resolving your query.