How pixel position changes after sampling ?

Lets suppose, I have a 2D image of spacing value 1.0 with dimension of 512x546.
for this image i have a pixel value of 255 in position (218,141)

after doing a sampling on the 2D image with spacing 1.5 , the dimension becomes 341x364.
Now what will the position of the same pixel value of 255 ?

The documentation should be helpful:


In this links, they calculated using their origin value. In my case, my origin value after sampling is also {0,0}. In that case, how to calculate it?

Origin = [0,0] is a trivial case, which requires even less computation than the case of origin different from [0,0]. Just use 0 instead of examples’ value of origin.