https://www.mathworks.com/help/medical-imaging/ref/medicalref3d.worldtosubscript.html
worldToSubscript - Convert from patient coordinates to row and column subscripts - MATLAB
This MATLAB function maps points from the patient coordinate system to the nearest subscript indices row, col, and slice, using the spatial referencing...
convertpatientcoordinates